]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[ruutu] Detect DRM videos
authorSergey M․ <dstftw@gmail.com>
Tue, 29 Nov 2016 21:19:38 +0000 (04:19 +0700)
committerSergey M․ <dstftw@gmail.com>
Tue, 29 Nov 2016 21:19:38 +0000 (04:19 +0700)
youtube_dl/extractor/ruutu.py

index 2fce4e81b7f44c4c70ff5e6e775a4743032a231b..6db3e3e9328b754f4a1f0ef149b33489857a3cd5 100644 (file)
@@ -5,6 +5,7 @@ from .common import InfoExtractor
 from ..compat import compat_urllib_parse_urlparse
 from ..utils import (
     determine_ext,
+    ExtractorError,
     int_or_none,
     xpath_attr,
     xpath_text,
@@ -101,6 +102,11 @@ class RuutuIE(InfoExtractor):
                         })
 
         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 {