summary refs log tree commit diff
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2018-12-26 09:30:48 +0100
committerRemita Amine <remitamine@gmail.com>2018-12-26 10:56:10 +0100
commit825cd268a3a02e80a9c36dada664d25074243d26 (patch)
treefc0998863c4ac10e0a03a27dbacd5f59a7e98dda
parent63529e935cf5f87e6080607ef9d9196fe435e092 (diff)
downloadyoutube-dl-825cd268a3a02e80a9c36dada664d25074243d26.tar.gz
youtube-dl-825cd268a3a02e80a9c36dada664d25074243d26.tar.xz
youtube-dl-825cd268a3a02e80a9c36dada664d25074243d26.zip
[youtube] detect DRM protected videos(#1774)
-rw-r--r--youtube_dl/extractor/youtube.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 954853e00..4b06cb597 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -1077,6 +1077,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             'url': 'https://invidio.us/watch?v=BaW_jenozKc',
             'only_matching': True,
         },
+        {
+            # DRM protected
+            'url': 'https://www.youtube.com/watch?v=s7_qI6_mIXc',
+            'only_matching': True,
+        }
     ]
 
     def __init__(self, *args, **kwargs):
@@ -1673,6 +1678,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                     '"token" parameter not in video info for unknown reason',
                     video_id=video_id)
 
+        if video_info.get('license_info'):
+            raise ExtractorError('This video is DRM protected.', expected=True)
+
         video_details = try_get(
             player_response, lambda x: x['videoDetails'], dict) or {}