aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-01-14 21:50:36 +0600
committerSergey M․ <dstftw@gmail.com>2015-01-14 21:50:36 +0600
commitc9ef44ce296ded2d5ba4b36ad60b0a7add7944bd (patch)
tree8da7571d07906f4d971557dfec6167290fded93b
parente92d4a11f570abb47215b13f88020f52479766e3 (diff)
[smotri] Improve extraction (Closes #4698)
-rw-r--r--youtube_dl/extractor/smotri.py27
1 files changed, 22 insertions, 5 deletions
diff --git a/youtube_dl/extractor/smotri.py b/youtube_dl/extractor/smotri.py
index baef3daa0..26f361c93 100644
--- a/youtube_dl/extractor/smotri.py
+++ b/youtube_dl/extractor/smotri.py
@@ -90,6 +90,20 @@ class SmotriIE(InfoExtractor):
},
'skip': 'Video is not approved by moderator',
},
+ # not approved by moderator, but available
+ {
+ 'url': 'http://smotri.com/video/view/?id=v28888533b73',
+ 'md5': 'f44bc7adac90af518ef1ecf04893bb34',
+ 'info_dict': {
+ 'id': 'v28888533b73',
+ 'ext': 'mp4',
+ 'title': 'Russian Spies Killed By ISIL Child Soldier',
+ 'uploader': 'Mopeder',
+ 'uploader_id': 'mopeder',
+ 'duration': 71,
+ 'thumbnail': 'http://frame9.loadup.ru/d7/32/2888853.2.3.jpg',
+ },
+ },
# swf player
{
'url': 'http://pics.smotri.com/scrubber_custom8.swf?file=v9188090500',
@@ -146,13 +160,16 @@ class SmotriIE(InfoExtractor):
video = self._download_json(request, video_id, 'Downloading video JSON')
- if video.get('_moderate_no') or not video.get('moderated'):
- raise ExtractorError('Video %s has not been approved by moderator' % video_id, expected=True)
+ video_url = video.get('_vidURL') or video.get('_vidURL_mp4')
+
+ if not video_url:
+ if video.get('_moderate_no') or not video.get('moderated'):
+ raise ExtractorError(
+ 'Video %s has not been approved by moderator' % video_id, expected=True)
- if video.get('error'):
- raise ExtractorError('Video %s does not exist' % video_id, expected=True)
+ if video.get('error'):
+ raise ExtractorError('Video %s does not exist' % video_id, expected=True)
- video_url = video.get('_vidURL') or video.get('_vidURL_mp4')
title = video['title']
thumbnail = video['_imgURL']
upload_date = unified_strdate(video['added'])