[generic] Detect Invidious' link element (Closes #195)

pull/209/head
pukkandan 2021-04-01 17:13:35 +05:30
rodzic 3f6a90eb63
commit df0c81513e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0F00D95A001F4698
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -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: