mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-30 15:14:14 +01:00
hls.parse: fix an issue when audio info is at the end of the file
This commit is contained in:
parent
e2e0678bb9
commit
c05a7364af
@ -58,6 +58,7 @@ def _hlsparse(config, text, url, output, **kwargs):
|
|||||||
codec = kwargs.pop("codec", "h264")
|
codec = kwargs.pop("codec", "h264")
|
||||||
media = {}
|
media = {}
|
||||||
subtitles = {}
|
subtitles = {}
|
||||||
|
videos = {}
|
||||||
segments = None
|
segments = None
|
||||||
|
|
||||||
if m3u8.master_playlist:
|
if m3u8.master_playlist:
|
||||||
@ -111,12 +112,15 @@ def _hlsparse(config, text, url, output, **kwargs):
|
|||||||
vcodec = "hevc"
|
vcodec = "hevc"
|
||||||
if i["CODECS"][:3] == "avc":
|
if i["CODECS"][:3] == "avc":
|
||||||
vcodec = "h264"
|
vcodec = "h264"
|
||||||
if "AUDIO" in i and (i["AUDIO"] in media):
|
if "AUDIO" in i:
|
||||||
audio_group = i["AUDIO"]
|
audio_group = i["AUDIO"]
|
||||||
urls = get_full_url(i["URI"], url)
|
urls = get_full_url(i["URI"], url)
|
||||||
|
videos[bit_rate] = [urls, resolution, vcodec, audio_group]
|
||||||
else:
|
else:
|
||||||
continue # Needs to be changed to utilise other tags.
|
continue # Needs to be changed to utilise other tags.
|
||||||
|
|
||||||
|
for bit_rate in list(videos.keys()):
|
||||||
|
urls, resolution, vcodec, audio_group = videos[bit_rate]
|
||||||
if audio_group:
|
if audio_group:
|
||||||
for group in media[audio_group]:
|
for group in media[audio_group]:
|
||||||
audio_url = get_full_url(group[0], url)
|
audio_url = get_full_url(group[0], url)
|
||||||
|
Loading…
Reference in New Issue
Block a user