2018-08-06, 18:17
Hi everybody,
I'm working on an addon for the F1TV official streaming service.
I think I got the business logic/parsing of the API right.
Now I started to create a simple addon that lets you browse the entire archive of the streaming service.
However:
The stream itself is provided using an m3u8 file that seems to be unique per user/session.
When I try to open the link to this file using xbmc.Playlist().load(url) it just fails with the error:
The M3U8 looks like the following:
Code to open:
Am I missing something?
Thanks for your help
I'm working on an addon for the F1TV official streaming service.
I think I got the business logic/parsing of the API right.
Now I started to create a simple addon that lets you browse the entire archive of the streaming service.
However:
The stream itself is provided using an m3u8 file that seems to be unique per user/session.
When I try to open the link to this file using xbmc.Playlist().load(url) it just fails with the error:
bash:17:59:26.370 T:123145319133184 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.RuntimeError'>
Error Contents: Not a valid playlist
Traceback (most recent call last):
File "/Users/bbsan/Library/Application Support/Kodi/addons/plugin.f1tv/main.py", line 249, in <module>
router(sys.argv[2][1:])
File "/Users/bbsan/Library/Application Support/Kodi/addons/plugin.f1tv/main.py", line 234, in router
playContent(params['content_url'], params['content_type'])
File "/Users/bbsan/Library/Application Support/Kodi/addons/plugin.f1tv/main.py", line 193, in playContent
play_video(stream_url)
File "/Users/bbsan/Library/Application Support/Kodi/addons/plugin.f1tv/main.py", line 207, in play_video
playlist.load(path)
RuntimeError: Not a valid playlist
-->End of Python script error report<--
The M3U8 looks like the following:
m3u:
#EXTM3U
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MEDIA:TYPE=CLOSED-CAPTIONS,GROUP-ID="cc",NAME="Closed Captions",DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="eng",INSTREAM-ID="CC1"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="Encoding_0",NAME="FX",DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="eng",URI="<<NAME_REMOVED>>.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="Encoding_0",NAME="English",AUTOSELECT=YES,LANGUAGE="eng",URI="<<NAME_REMOVED>>.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="Encoding_0",NAME="German",AUTOSELECT=YES,LANGUAGE="ger",URI="<<NAME_REMOVED>>.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="Encoding_0",NAME="French",AUTOSELECT=YES,LANGUAGE="fre",URI="<<NAME_REMOVED>>.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="Encoding_0",NAME="Spanish",AUTOSELECT=YES,LANGUAGE="spa",URI="<<NAME_REMOVED>>.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=7015190,AVERAGE-BANDWIDTH=5742536,CODECS="avc1.640028,mp4a.40.2",AUDIO="Encoding_0",RESOLUTION=1920x1080,FRAME-RATE=30,CLOSED-CAPTIONS="cc"
<<NAME_REMOVED>>.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=5190321,AVERAGE-BANDWIDTH=4209836,CODECS="avc1.4D4020,mp4a.40.2",AUDIO="Encoding_0",RESOLUTION=1280x720,FRAME-RATE=30,CLOSED-CAPTIONS="cc"
<<NAME_REMOVED>>.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2963291,AVERAGE-BANDWIDTH=2370596,CODECS="avc1.4D401F,mp4a.40.2",AUDIO="Encoding_0",RESOLUTION=1024x576,FRAME-RATE=30,CLOSED-CAPTIONS="cc"
<<NAME_REMOVED>>.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1952811,AVERAGE-BANDWIDTH=1553156,CODECS="avc1.4D401E,mp4a.40.2",AUDIO="Encoding_0",RESOLUTION=768x432,FRAME-RATE=30,CLOSED-CAPTIONS="cc"
<<NAME_REMOVED>>.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1310282,AVERAGE-BANDWIDTH=1042256,CODECS="avc1.4D401E,mp4a.40.2",AUDIO="Encoding_0",RESOLUTION=640x360,FRAME-RATE=30,CLOSED-CAPTIONS="cc"
<<NAME_REMOVED>>.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=918388,AVERAGE-BANDWIDTH=735716,CODECS="avc1.4D4015,mp4a.40.2",AUDIO="Encoding_0",RESOLUTION=512x288,FRAME-RATE=30,CLOSED-CAPTIONS="cc"
<<NAME_REMOVED>>.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=518511,AVERAGE-BANDWIDTH=429176,CODECS="avc1.4D400D,mp4a.40.2",AUDIO="Encoding_0",RESOLUTION=384x216,FRAME-RATE=30,CLOSED-CAPTIONS="cc"
<<NAME_REMOVED>>.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=191972,AVERAGE-BANDWIDTH=188031,CODECS="mp4a.40.2",AUDIO="Encoding_0"
<<NAME_REMOVED>>.m3u8
Code to open:
python:
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
playlist.load(path)
xbmc.Player().play(playlist)
Am I missing something?
Thanks for your help