mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 03:33:02 +00:00
[youtube] Detect DRM better
Authored by: shirt-dev
This commit is contained in:
parent
5c3895fff1
commit
727029c508
1 changed files with 2 additions and 1 deletions
|
@ -3023,7 +3023,7 @@ def _extract_formats(self, streaming_data, video_id, player_url, is_live, durati
|
||||||
streaming_formats = traverse_obj(streaming_data, (..., ('formats', 'adaptiveFormats'), ...), default=[])
|
streaming_formats = traverse_obj(streaming_data, (..., ('formats', 'adaptiveFormats'), ...), default=[])
|
||||||
|
|
||||||
for fmt in streaming_formats:
|
for fmt in streaming_formats:
|
||||||
if fmt.get('targetDurationSec') or fmt.get('drmFamilies'):
|
if fmt.get('targetDurationSec'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
itag = str_or_none(fmt.get('itag'))
|
itag = str_or_none(fmt.get('itag'))
|
||||||
|
@ -3105,6 +3105,7 @@ def _extract_formats(self, streaming_data, video_id, player_url, is_live, durati
|
||||||
'fps': int_or_none(fmt.get('fps')) or None,
|
'fps': int_or_none(fmt.get('fps')) or None,
|
||||||
'height': height,
|
'height': height,
|
||||||
'quality': q(quality),
|
'quality': q(quality),
|
||||||
|
'has_drm': bool(fmt.get('drmFamilies')),
|
||||||
'tbr': tbr,
|
'tbr': tbr,
|
||||||
'url': fmt_url,
|
'url': fmt_url,
|
||||||
'width': int_or_none(fmt.get('width')),
|
'width': int_or_none(fmt.get('width')),
|
||||||
|
|
Loading…
Reference in a new issue