aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-10-28 23:40:44 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-10-28 23:40:44 +0100
commit50c8266ef0b2b6d011257a909f47fd623dda8eb2 (patch)
tree6dc2358a50c57e0712d08643fea5dea4d9faeba0
parent00edd4f9bef7cf0708d1c4da128477d76115fdec (diff)
parente0c51cdadc838a67870f5c22c48bb0b9f1951afc (diff)
downloadyoutube-dl-50c8266ef0b2b6d011257a909f47fd623dda8eb2.tar.xz
Merge branch 'master' of github.com:rg3/youtube-dl
-rw-r--r--youtube_dl/extractor/vk.py16
-rw-r--r--youtube_dl/extractor/wimp.py2
2 files changed, 14 insertions, 4 deletions
diff --git a/youtube_dl/extractor/vk.py b/youtube_dl/extractor/vk.py
index 918bd1098..36cd7e52e 100644
--- a/youtube_dl/extractor/vk.py
+++ b/youtube_dl/extractor/vk.py
@@ -138,9 +138,19 @@ class VKIE(InfoExtractor):
info_url = 'http://vk.com/al_video.php?act=show&al=1&video=%s' % video_id
info_page = self._download_webpage(info_url, video_id)
- if re.search(r'<!>Please log in or <', info_page):
- raise ExtractorError('This video is only available for registered users, '
- 'use --username and --password options to provide account credentials.', expected=True)
+ ERRORS = {
+ r'>Видеозапись .*? была изъята из публичного доступа в связи с обращением правообладателя.<':
+ 'Video %s has been removed from public access due to rightholder complaint.',
+ r'<!>Please log in or <':
+ 'Video %s is only available for registered users, '
+ 'use --username and --password options to provide account credentials.',
+ '<!>Unknown error':
+ 'Video %s does not exist.'
+ }
+
+ for error_re, error_msg in ERRORS.items():
+ if re.search(error_re, info_page):
+ raise ExtractorError(error_msg % video_id, expected=True)
m_yt = re.search(r'src="(http://www.youtube.com/.*?)"', info_page)
if m_yt is not None:
diff --git a/youtube_dl/extractor/wimp.py b/youtube_dl/extractor/wimp.py
index c27dda944..3377a543e 100644
--- a/youtube_dl/extractor/wimp.py
+++ b/youtube_dl/extractor/wimp.py
@@ -37,7 +37,7 @@ class WimpIE(InfoExtractor):
video_id = mobj.group(1)
webpage = self._download_webpage(url, video_id)
video_url = self._search_regex(
- r's1\.addVariable\("file",\s*"([^"]+)"\);', webpage, 'video URL')
+ r"'file'\s*:\s*'([^']+)'", webpage, 'video URL')
if YoutubeIE.suitable(video_url):
self.to_screen('Found YouTube video')
return {