[youtube] Detect DRM better

Authored by: shirt-dev
This commit is contained in:
shirt 2022-03-27 01:28:26 -04:00 committed by pukkandan
parent 5c3895fff1
commit 727029c508
No known key found for this signature in database
GPG Key ID: 7EEE9E1E817D0A39

View File

@ -3023,7 +3023,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
streaming_formats = traverse_obj(streaming_data, (..., ('formats', 'adaptiveFormats'), ...), default=[])
for fmt in streaming_formats:
if fmt.get('targetDurationSec') or fmt.get('drmFamilies'):
if fmt.get('targetDurationSec'):
continue
itag = str_or_none(fmt.get('itag'))
@ -3105,6 +3105,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
'fps': int_or_none(fmt.get('fps')) or None,
'height': height,
'quality': q(quality),
'has_drm': bool(fmt.get('drmFamilies')),
'tbr': tbr,
'url': fmt_url,
'width': int_or_none(fmt.get('width')),