Sfoglia il codice sorgente

[vidme] Check for deleted videos

Lukáš Lalinský 10 anni fa
parent
commit
5f9f87c06f
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9 0
      youtube_dl/extractor/vidme.py

+ 9 - 0
youtube_dl/extractor/vidme.py

@@ -101,6 +101,10 @@ class VidmeIE(InfoExtractor):
         # suspended
         'url': 'https://vid.me/Ox3G',
         'only_matching': True,
+    }, {
+        # deleted
+        'url': 'https://vid.me/KTPm',
+        'only_matching': True,
     }, {
         # no formats in the API response
         'url': 'https://vid.me/e5g',
@@ -143,6 +147,11 @@ class VidmeIE(InfoExtractor):
 
         video = response['video']
 
+        if video.get('state') == 'deleted':
+            raise ExtractorError(
+                'Vidme said: Sorry, this video has been deleted.',
+                expected=True)
+
         if video.get('state') in ('user-disabled', 'suspended'):
             raise ExtractorError(
                 'Vidme said: This video has been suspended either due to a copyright claim, '