mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-18 01:35:12 +00:00
[vk] Fix youtube extraction
This commit is contained in:
parent
cf9cf7dd04
commit
4647845679
1 changed files with 5 additions and 4 deletions
|
@ -195,10 +195,11 @@ def _real_extract(self, url):
|
||||||
if re.search(error_re, info_page):
|
if re.search(error_re, info_page):
|
||||||
raise ExtractorError(error_msg % video_id, expected=True)
|
raise ExtractorError(error_msg % video_id, expected=True)
|
||||||
|
|
||||||
m_yt = re.search(r'src="(http://www.youtube.com/.*?)"', info_page)
|
youtube_url = self._search_regex(
|
||||||
if m_yt is not None:
|
r'<iframe[^>]+src="((?:https?:)?//www.youtube.com/embed/[^"]+)"',
|
||||||
self.to_screen('Youtube video detected')
|
info_page, 'youtube iframe', default=None)
|
||||||
return self.url_result(m_yt.group(1), 'Youtube')
|
if youtube_url:
|
||||||
|
return self.url_result(youtube_url, 'Youtube', video_id)
|
||||||
|
|
||||||
m_rutube = re.search(
|
m_rutube = re.search(
|
||||||
r'\ssrc="((?:https?:)?//rutube\.ru\\?/video\\?/embed(?:.*?))\\?"', info_page)
|
r'\ssrc="((?:https?:)?//rutube\.ru\\?/video\\?/embed(?:.*?))\\?"', info_page)
|
||||||
|
|
Loading…
Reference in a new issue