1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-26 18:34:32 +01:00

[cbsnews] Handle iframes with src (closes #24790)

Currently only iframes with a data-src attribute are recognised by the
extractor, meaning no video is found for the URL in the linked bug
(extraction fails with RegexNotFoundError).

This fix removes "data-" from the regex pattern, meaning both data-src
and src will be matched. Technically something like xyzsrc would be
matched as well, but I do not think this is a problem.
This commit is contained in:
Will Beaufoy 2020-04-25 19:17:29 +01:00
parent 38db9a405a
commit a38b8a609b

View File

@ -95,7 +95,8 @@ class CBSNewsIE(CBSIE):
webpage = self._download_webpage(url, display_id) webpage = self._download_webpage(url, display_id)
entries = [] entries = []
for embed_url in re.findall(r'<iframe[^>]+data-src="(https?://(?:www\.)?cbsnews\.com/embed/video/[^#]*#[^"]+)"', webpage): # This regex is intended to match attributes src and data-src
for embed_url in re.findall(r'<iframe[^>]+src="(https?://(?:www\.)?cbsnews\.com/embed/video/[^#]*#[^"]+)"', webpage):
entries.append(self.url_result(embed_url, CBSNewsEmbedIE.ie_key())) entries.append(self.url_result(embed_url, CBSNewsEmbedIE.ie_key()))
if entries: if entries:
return self.playlist_result( return self.playlist_result(