1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 13:44:14 +01:00

dash: dont crash on None codec

fixes: #1340
This commit is contained in:
Johan Andersson 2021-03-14 00:02:21 +01:00
parent c1bfd0fc11
commit 70d83d44eb

View File

@ -144,10 +144,12 @@ def adaptionset(attributes, elements, url, baseurl=None):
codec = None
if codecs is None and "codecs" in i.attrib:
codecs = i.attrib["codecs"]
if codecs[:3] == "avc":
if codecs and codecs[:3] == "avc":
codec = "h264"
if codecs[:3] == "hvc":
elif codecs and codecs[:3] == "hvc":
codec = "hevc"
else:
codec = codecs
if i.find("{urn:mpeg:dash:schema:mpd:2011}AudioChannelConfiguration") is not None:
chan = i.find("{urn:mpeg:dash:schema:mpd:2011}AudioChannelConfiguration").attrib["value"]
if chan == "6":