Closed MrChick closed 10 months ago
I think PR #327 will fix this.
In [1]: from m3u8 import loads
In [2]: playlist_text = """#EXTM3U
...: #EXTINF:0,Channel 1
...: #EXTVLCOPT:network-caching=1000
...: rtsp://192.168.[...]
...: #EXTINF:0,Channel 2
...: #EXTVLCOPT:network-caching=1000
...: rtsp://192.168.[...]
...: #EXTINF:0,Channel 3
...: #EXTVLCOPT:network-caching=1000
...: rtsp://192.168.[...]"""
In [3]:
In [3]: parsed_playlist = loads(playlist_text, uri="https://localhost:24601/hls/playlist.m3u8")
In [4]: parsed_playlist.data
Out[4]:
{'media_sequence': 0,
'is_variant': False,
'is_endlist': False,
'is_i_frames_only': False,
'is_independent_segments': False,
'is_images_only': False,
'playlist_type': None,
'playlists': [],
'segments': [{'duration': 0.0,
'title': 'Channel 1',
'uri': 'rtsp://192.168.[...]',
'cue_in': False,
'cue_out': False,
'cue_out_start': False,
'scte35': None,
'oatcls_scte35': None,
'scte35_duration': None,
'scte35_elapsedtime': None,
'asset_metadata': None,
'discontinuity': False,
'dateranges': None,
'gap_tag': None},
{'duration': 0.0,
'title': 'Channel 2',
'uri': 'rtsp://192.168.[...]',
'cue_in': False,
'cue_out': False,
'cue_out_start': False,
'scte35': None,
'oatcls_scte35': None,
'scte35_duration': None,
'scte35_elapsedtime': None,
'asset_metadata': None,
'discontinuity': False,
'dateranges': None,
'gap_tag': None},
{'duration': 0.0,
'title': 'Channel 3',
'uri': 'rtsp://192.168.[...]',
'cue_in': False,
'cue_out': False,
'cue_out_start': False,
'scte35': None,
'oatcls_scte35': None,
'scte35_duration': None,
'scte35_elapsedtime': None,
'asset_metadata': None,
'discontinuity': False,
'dateranges': None,
'gap_tag': None}],
'iframe_playlists': [],
'image_playlists': [],
'tiles': [],
'media': [],
'keys': [None],
'rendition_reports': [],
'skip': {},
'part_inf': {},
'session_data': [],
'session_keys': [],
'segment_map': []}
@MrChick could you test using the master version while we don't release a new version?
@mauricioabreu can confirm, it now works as expected and I get the actual URI of the stream instead of the EXTVLCOPTS tag.
New release has just launched
The readme states the following:
I have a m3u file from my cable router (DVBC streaming) using the following format:
It looks like parser.py expects any line following an EXTINF that is not a handled tag to be the actual URI no matter what.
I was expecting the EXTVLCOPT tags to simply be ignored, but instead after parsing the m3u file I get the channels correctly as titles, but instead of the rtsp URIs i get the EXTVLCOPT lines returned as URI.
I managed to easily remedy this by using a custom tag parser, but it sounds to me like the EXTVLCOPT tag should have been ignored out of the box?