mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-11 05:09:08 +01:00
[generic] Detect Invidious' link element (Closes #195)
This commit is contained in:
parent
3f6a90eb63
commit
df0c81513e
@ -2659,6 +2659,15 @@ class GenericIE(InfoExtractor):
|
||||
if vid_me_embed_url is not None:
|
||||
return self.url_result(vid_me_embed_url, 'Vidme')
|
||||
|
||||
# Invidious Instances
|
||||
# https://github.com/yt-dlp/yt-dlp/issues/195
|
||||
# https://github.com/iv-org/invidious/pull/1730
|
||||
youtube_url = self._search_regex(
|
||||
r'<link rel="alternate" href="(https://www\.youtube\.com/watch\?v=[0-9A-Za-z_-]{11})"',
|
||||
webpage, 'youtube link', default=None)
|
||||
if youtube_url:
|
||||
return self.url_result(youtube_url, YoutubeIE.ie_key())
|
||||
|
||||
# Look for YouTube embeds
|
||||
youtube_urls = YoutubeIE._extract_urls(webpage)
|
||||
if youtube_urls:
|
||||
|
Loading…
Reference in New Issue
Block a user