mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-04 23:35:04 +00:00
[ruutu] Detect DRM videos
This commit is contained in:
parent
8b0d3ee64e
commit
db75f14d8a
1 changed files with 6 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
from ..compat import compat_urllib_parse_urlparse
|
||||
from ..utils import (
|
||||
determine_ext,
|
||||
ExtractorError,
|
||||
int_or_none,
|
||||
xpath_attr,
|
||||
xpath_text,
|
||||
|
@ -101,6 +102,11 @@ def extract_formats(node):
|
|||
})
|
||||
|
||||
extract_formats(video_xml.find('./Clip'))
|
||||
|
||||
drm = xpath_text(video_xml, './Clip/DRM', default=None)
|
||||
if not formats and drm:
|
||||
raise ExtractorError('This video is DRM protected.', expected=True)
|
||||
|
||||
self._sort_formats(formats)
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue