Pārlūkot izejas kodu

[vidme] Better error message for suspended vidme videos

Lukáš Lalinský 10 gadi atpakaļ
vecāks
revīzija
59fe4824f8
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 6 0
      youtube_dl/extractor/vidme.py

+ 6 - 0
youtube_dl/extractor/vidme.py

@@ -114,6 +114,12 @@ class VidmeIE(InfoExtractor):
 
 
         video = response['video']
         video = response['video']
 
 
+        if video.get('state') == 'user-disabled':
+            raise ExtractorError(
+                'Vidme said: This video has been suspended either due to a copyright claim, '
+                'or for violating the terms of use.',
+                expected=True)
+
         formats = [{
         formats = [{
             'format_id': f.get('type'),
             'format_id': f.get('type'),
             'url': f['uri'],
             'url': f['uri'],