Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NL character cause AttributeError: 'NoneType' object has no attribute 'groupdict' #24

Open
FrancYescO opened this issue Jul 30, 2022 · 0 comments

Comments

@FrancYescO
Copy link
Contributor

FrancYescO commented Jul 30, 2022

Hello, i need to manage an m3u list that have a \n in channel title.. this breaks the regex/perline parsing and make the tool unusable

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/bin/iptv-filter", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/iptvtools/iptv_filter.py", line 73, in main
    playlist.parse()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/iptvtools/models.py", line 68, in parse
    self._parse(self.args.inputs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/iptvtools/models.py", line 95, in _parse
    current_item = parsers.parse_tag_inf(line)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/iptvtools/parsers.py", line 35, in parse_tag_inf
    res = match.groupdict()
AttributeError: 'NoneType' object has no attribute 'groupdict'

Here a test case, put it in an m3u file and try to use the tool on it

#EXTM3U
#EXTINF:-1 tvg-id="" tvg-name="broken channel
name" tvg-logo="" group-title="US",broken channel
name
http://blabla.com/11111
#EXTINF:-1 tvg-id="" tvg-name="
" tvg-logo="" group-title="US",

http://blabla.com/2222
#EXTINF:-1 tvg-id="" tvg-name="good channel name" tvg-logo="https://logo.com/logo.png" group-title="USA",good channel name
http://blabla.com/3333

can we fix this somehow?
this is a similar issue as #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant