Closed Baa14453 closed 2 months ago
load
returns M3U8
objects but add_playlist
expects Playlist
objects.
You could argue this could fail more gracefully, but what you are trying to do isn't correct.
I don't think this is something you can really do, because the media playlists don't contain the information you need to assemble a multivariant playlist.
Let's take this stream for example.
Its media playlists look like this (shortened for clarity):
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:5849701
#EXTINF:6.000000,
segment_4_20240417_1713385074.ts
#EXTINF:6.000000,
segment_4_20240417_1713385081.ts
#EXTINF:6.000000,
segment_4_20240417_1713385086.ts
#EXTINF:6.000000,
segment_4_20240417_1713385092.ts
#EXTINF:6.000000,
segment_4_20240417_1713385099.ts
#EXTINF:6.000000,
segment_4_20240417_1713385104.ts
Its multivariant playlist looks like this (shortened for clarity):
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=550172,RESOLUTION=256x106
level_0.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1650064,RESOLUTION=640x266
level_1.m3u8
There's not any information about bandwidth or resolution in the media playlists that would allow you to construct the multivariant playlist. That would need to come from another source.
Ah that's a pain, oh well thank you both :heart: I'll construct the rest of the info manually and call add_playlist based on that.
Essentially I am building a variant playlist by combining normal playlists:
This seemed logical to me, but the result produced a text file with object references in it: