bebo-dot-dev / m3u-epg-editor

a python m3u / epg optimizer
120 stars 27 forks source link

IndexError: list index out of range #28

Closed specsnow closed 5 years ago

specsnow commented 5 years ago

Getting an error when running the script against my M3U. I am able to run it against several other M3U's successfully so it is something with this particular M3U but I can't see anything that sticks out.

Stats:

OS: FreeBSD 11.2-STABLE Python: 2.7.16 Script: Latest as of 8/26/19 IPTV: Stargate (pretty sure this is being resold from a bigger provider but don't know who)

Log with error:

root@emby_1:~ # /media/IPTV/script/stargate.sh 2019-08-27T08:19:00.909095 process started 2019-08-27T08:19:00.909210 performing HTTP GET request to http://www.XXX.com:8080/get.php?username=XXX&password=XXX&type=m3u&output=ts 2019-08-27T08:19:01.777821 saving retrieved m3u file: /media/IPTV/stargate/original.m3u8 2019-08-27T08:19:01.778474 parsing m3u into a list of objects 2019-08-27T08:19:01.779556 Traceback (most recent call last): File "/media/IPTV/script/m3u-epg-editor.py", line 730, in main() File "/media/IPTV/script/m3u-epg-editor.py", line 156, in main m3u_entries = load_m3u(args) File "/media/IPTV/script/m3u-epg-editor.py", line 378, in load_m3u m3u_entries = parse_m3u(m3u_filename, args.no_tvg_id) File "/media/IPTV/script/m3u-epg-editor.py", line 424, in parse_m3u m3u_fields = line.split('#EXTINF:-1 ')[1] IndexError: list index out of range

specsnow commented 5 years ago

Still not sure exactly what was causing this issue but changing the type=m3u to type=m3u_plus fixed the issue for me. Feel free to close this issue if you think it's a non-issue now.

bebo-dot-dev commented 5 years ago

It blowing up here: https://github.com/jjssoftware/m3u-epg-editor/blob/master/m3u-epg-editor.py#L424 suggests that the pulled m3u file was in some way mangled to the point where one or more #EXTINF:-1 lines in the file were not correctly formed.

I can't debug it further without seeing what that file looked like.

It works on my computer for my use-case and also now appears to work for you too ;)

On that basis, closed.