aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-07-08 20:34:50 +0600
committerSergey M․ <dstftw@gmail.com>2015-07-08 20:34:50 +0600
commit4647845679429739f72b0eba5b963e096ec5bf86 (patch)
treefd3960b64491c400db16e4105843378c79d761d7 /youtube_dl/extractor
parentcf9cf7dd04d8e15635084dcf9f7a76acff5ac218 (diff)
[vk] Fix youtube extraction
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/vk.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/youtube_dl/extractor/vk.py b/youtube_dl/extractor/vk.py
index 0f7ce45ca..697064175 100644
--- a/youtube_dl/extractor/vk.py
+++ b/youtube_dl/extractor/vk.py
@@ -195,10 +195,11 @@ class VKIE(InfoExtractor):
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:
- self.to_screen('Youtube video detected')
- return self.url_result(m_yt.group(1), 'Youtube')
+ youtube_url = self._search_regex(
+ r'<iframe[^>]+src="((?:https?:)?//www.youtube.com/embed/[^"]+)"',
+ info_page, 'youtube iframe', default=None)
+ if youtube_url:
+ return self.url_result(youtube_url, 'Youtube', video_id)
m_rutube = re.search(
r'\ssrc="((?:https?:)?//rutube\.ru\\?/video\\?/embed(?:.*?))\\?"', info_page)