[wat] detect DRM protected videos(closes #27958)
authorRemita Amine <remitamine@gmail.com>
Tue, 23 Feb 2021 12:50:18 +0000 (13:50 +0100)
committerRemita Amine <remitamine@gmail.com>
Tue, 23 Feb 2021 12:50:18 +0000 (13:50 +0100)
youtube_dl/extractor/wat.py

index 147931d73e5a662cb582daef82317eeeffc9408d..f1bccc2d6b2ac79f93e53e3e67f3294bcf21a8e9 100644 (file)
@@ -64,7 +64,7 @@ class WatIE(InfoExtractor):
         if error_desc:
             if video_info.get('error_code') == 'GEOBLOCKED':
                 self.raise_geo_restricted(error_desc, video_info.get('geoList'))
-            raise ExtractorError(error_desc)
+            raise ExtractorError(error_desc, expected=True)
 
         title = video_info['title']
 
@@ -86,6 +86,8 @@ class WatIE(InfoExtractor):
         delivery = video_data.get('delivery') or {}
         extract_formats({delivery.get('format'): delivery.get('url')})
         if not formats:
+            if delivery.get('drm'):
+                raise ExtractorError('This video is DRM protected.', expected=True)
             manifest_urls = self._download_json(
                 'http://www.wat.tv/get/webhtml/' + video_id, video_id, fatal=False)
             if manifest_urls: