]> jfr.im git - yt-dlp.git/commitdiff
[common] Fix FourCC fallback when parsing ISM (#372)
authorfelix <redacted>
Sun, 2 May 2021 09:10:35 +0000 (11:10 +0200)
committerpukkandan <redacted>
Sat, 5 Jun 2021 19:29:04 +0000 (00:59 +0530)
In some DASH manifests, the FourCC attribute is actually present,
but empty.  We thus apply the same fallback to 'AACL' that we do
when the attribute is entirely absent.

Authored by: fstirlitz

yt_dlp/extractor/common.py

index 2e4f3559a1c1ca8c53e942e483238c9659f6e4f1..64ab8f7062f5e144451c06f8bee2f4137c224182 100644 (file)
@@ -2876,7 +2876,7 @@ def _parse_ism_formats_and_subtitles(self, ism_doc, ism_url, ism_id=None):
             stream_name = stream.get('Name')
             stream_language = stream.get('Language', 'und')
             for track in stream.findall('QualityLevel'):
-                fourcc = track.get('FourCC''AACL' if track.get('AudioTag') == '255' else None)
+                fourcc = track.get('FourCC') or ('AACL' if track.get('AudioTag') == '255' else None)
                 # TODO: add support for WVC1 and WMAP
                 if fourcc not in ('H264', 'AVC1', 'AACL', 'TTML'):
                     self.report_warning('%s is not a supported codec' % fourcc)