0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-23 02:25:11 +00:00

Merge branch 'master' of github.com:rg3/youtube-dl

This commit is contained in:
Philipp Hagemeister 2014-10-28 23:40:44 +01:00
commit 50c8266ef0
2 changed files with 14 additions and 4 deletions

View file

@ -138,9 +138,19 @@ def _real_extract(self, url):
info_url = 'http://vk.com/al_video.php?act=show&al=1&video=%s' % video_id 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) info_page = self._download_webpage(info_url, video_id)
if re.search(r'<!>Please log in or <', info_page): ERRORS = {
raise ExtractorError('This video is only available for registered users, ' r'>Видеозапись .*? была изъята из публичного доступа в связи с обращением правообладателя.<':
'use --username and --password options to provide account credentials.', expected=True) '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) m_yt = re.search(r'src="(http://www.youtube.com/.*?)"', info_page)
if m_yt is not None: if m_yt is not None:

View file

@ -37,7 +37,7 @@ def _real_extract(self, url):
video_id = mobj.group(1) video_id = mobj.group(1)
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, video_id)
video_url = self._search_regex( 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): if YoutubeIE.suitable(video_url):
self.to_screen('Found YouTube video') self.to_screen('Found YouTube video')
return { return {