pawanpaudel93 / m3u-parser

A parser for m3u files. It parses the contents of the m3u file to a list of streams information which can be saved as a JSON/CSV/M3U file.
MIT License
33 stars 16 forks source link

Doesn't work if you specify the full path to the file. #15

Closed r35p3ct closed 2 years ago

r35p3ct commented 2 years ago

Doesn't work if you specify the full path to the file like: /var/www/html/m3u/kb.m3u

  File "/usr/local/lib/python3.7/dist-packages/m3u_parser/m3u_parser.py", line 96, in parse_m3u
    if urlparse(path).scheme != "" or re.search(self._url_regex, path):
  File "/usr/lib/python3.7/urllib/parse.py", line 367, in urlparse
    url, scheme, _coerce_result = _coerce_args(url, scheme)
  File "/usr/lib/python3.7/urllib/parse.py", line 123, in _coerce_args
    return _decode_args(args) + (_encode_result,)
  File "/usr/lib/python3.7/urllib/parse.py", line 107, in _decode_args
    return tuple(x.decode(encoding, errors) if x else '' for x in args)
  File "/usr/lib/python3.7/urllib/parse.py", line 107, in <genexpr>
    return tuple(x.decode(encoding, errors) if x else '' for x in args)
pawanpaudel93 commented 2 years ago

@r35p3ct Can you install the latest version and check if full path to the file works correctly. ?

r35p3ct commented 2 years ago

os.path.join - work str path - work if i use pathlib - didnt work File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\urllib\parse.py", line 634, in unquote if '%' not in string: TypeError: argument of type 'WindowsPath' is not iterable

pawanpaudel93 commented 2 years ago

os.path.join - work str path - work if i use pathlib - didnt work File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\urllib\parse.py", line 634, in unquote if '%' not in string: TypeError: argument of type 'WindowsPath' is not iterable

This error was caused by unquote and i removed it so it should work now for you.