Merge remote-tracking branch 'upstream/master' into bliptv
[youtube-dl] / youtube_dl / extractor / vidme.py
index 393970a12dde862e56d269c3f5ea98f483b9d918..3d63ed4f08930275ee725c68a520368721e1ed10 100644 (file)
@@ -14,7 +14,7 @@ class VidmeIE(InfoExtractor):
     _VALID_URL = r'https?://vid\.me/(?:e/)?(?P<id>[\da-zA-Z]+)'
     _TESTS = [{
         'url': 'https://vid.me/QNB',
-        'md5': 'c62f1156138dc3323902188c5b5a8bd6',
+        'md5': 'f42d05e7149aeaec5c037b17e5d3dc82',
         'info_dict': {
             'id': 'QNB',
             'ext': 'mp4',
@@ -101,13 +101,17 @@ 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',
         'info_dict': {
             'id': 'e5g',
             'ext': 'mp4',
-            'title': 'e5g',
+            'title': 'Video upload (e5g)',
             'thumbnail': 're:^https?://.*\.jpg',
             'timestamp': 1401480195,
             'upload_date': '20140530',
@@ -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, '
@@ -180,7 +189,7 @@ class VidmeIE(InfoExtractor):
 
         return {
             'id': video_id,
-            'title': title or video_id,
+            'title': title or 'Video upload (%s)' % video_id,
             'description': description,
             'thumbnail': thumbnail,
             'uploader': uploader,