1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-07-10 07:18:33 +00:00

fix: grab all matched urls

This commit is contained in:
JChris246 2025-03-16 00:21:59 -04:00
parent e67d786c7c
commit 8b76538b27

View File

@ -2282,11 +2282,12 @@ def _extract_from_webpage(cls, url, webpage):
# Invidious Instances
# https://github.com/yt-dlp/yt-dlp/issues/195
# https://github.com/iv-org/invidious/pull/1730
mobj = re.search(
matches = re.findall(
r'<link rel="alternate" href="(?P<url>https://www\.youtube\.com/watch\?v=[0-9A-Za-z_-]{11})"',
webpage)
if mobj:
yield cls.url_result(mobj.group('url'), cls)
if matches:
for match_url in matches:
yield cls.url_result(match_url, cls)
raise cls.StopExtraction
yield from super()._extract_from_webpage(url, webpage)