`_extract_embed_urls` is not a list

Closes #4581
This commit is contained in:
pukkandan 2022-08-07 03:29:19 +05:30
parent 061a17abd3
commit 43aebb7db4
No known key found for this signature in database
GPG Key ID: 7EEE9E1E817D0A39
4 changed files with 12 additions and 13 deletions

View File

@ -58,14 +58,13 @@ class FoxNewsIE(AMPIE):
@classmethod @classmethod
def _extract_embed_urls(cls, url, webpage): def _extract_embed_urls(cls, url, webpage):
return [ for mobj in re.finditer(
f'https://video.foxnews.com/v/video-embed.html?video_id={mobj.group("video_id")}'
for mobj in re.finditer(
r'''(?x) r'''(?x)
<(?:script|(?:amp-)?iframe)[^>]+\bsrc=["\'] <(?:script|(?:amp-)?iframe)[^>]+\bsrc=["\']
(?:https?:)?//video\.foxnews\.com/v/(?:video-embed\.html|embed\.js)\? (?:https?:)?//video\.foxnews\.com/v/(?:video-embed\.html|embed\.js)\?
(?:[^>"\']+&)?(?:video_)?id=(?P<video_id>\d+) (?:[^>"\']+&)?(?:video_)?id=(?P<video_id>\d+)
''', webpage)] ''', webpage):
yield f'https://video.foxnews.com/v/video-embed.html?video_id={mobj.group("video_id")}'
def _real_extract(self, url): def _real_extract(self, url):
host, video_id = self._match_valid_url(url).groups() host, video_id = self._match_valid_url(url).groups()
@ -125,4 +124,4 @@ class FoxNewsArticleIE(InfoExtractor):
'http://video.foxnews.com/v/' + video_id, FoxNewsIE.ie_key()) 'http://video.foxnews.com/v/' + video_id, FoxNewsIE.ie_key())
return self.url_result( return self.url_result(
FoxNewsIE._extract_embed_urls(url, webpage)[0], FoxNewsIE.ie_key()) next(FoxNewsIE._extract_embed_urls(url, webpage)), FoxNewsIE.ie_key())

View File

@ -371,7 +371,7 @@ class FranceTVInfoIE(FranceTVBaseInfoExtractor):
webpage = self._download_webpage(url, display_id) webpage = self._download_webpage(url, display_id)
dailymotion_urls = DailymotionIE._extract_embed_urls(url, webpage) dailymotion_urls = tuple(DailymotionIE._extract_embed_urls(url, webpage))
if dailymotion_urls: if dailymotion_urls:
return self.playlist_result([ return self.playlist_result([
self.url_result(dailymotion_url, DailymotionIE.ie_key()) self.url_result(dailymotion_url, DailymotionIE.ie_key())

View File

@ -121,7 +121,7 @@ class HeiseIE(InfoExtractor):
if kaltura_id: if kaltura_id:
return _make_kaltura_result('kaltura:2238431:%s' % kaltura_id) return _make_kaltura_result('kaltura:2238431:%s' % kaltura_id)
yt_urls = YoutubeIE._extract_embed_urls(url, webpage) yt_urls = tuple(YoutubeIE._extract_embed_urls(url, webpage))
if yt_urls: if yt_urls:
return self.playlist_from_matches( return self.playlist_from_matches(
yt_urls, video_id, title, ie=YoutubeIE.ie_key()) yt_urls, video_id, title, ie=YoutubeIE.ie_key())

View File

@ -447,17 +447,17 @@ class VKIE(VKBaseIE):
m_rutube.group(1).replace('\\', '')) m_rutube.group(1).replace('\\', ''))
return self.url_result(rutube_url) return self.url_result(rutube_url)
dailymotion_urls = DailymotionIE._extract_embed_urls(url, info_page) dailymotion_url = next(DailymotionIE._extract_embed_urls(url, info_page), None)
if dailymotion_urls: if dailymotion_url:
return self.url_result(dailymotion_urls[0], DailymotionIE.ie_key()) return self.url_result(dailymotion_url, DailymotionIE.ie_key())
odnoklassniki_url = OdnoklassnikiIE._extract_url(info_page) odnoklassniki_url = OdnoklassnikiIE._extract_url(info_page)
if odnoklassniki_url: if odnoklassniki_url:
return self.url_result(odnoklassniki_url, OdnoklassnikiIE.ie_key()) return self.url_result(odnoklassniki_url, OdnoklassnikiIE.ie_key())
sibnet_urls = self._extract_embed_urls(url, info_page) sibnet_url = next(self._extract_embed_urls(url, info_page), None)
if sibnet_urls: if sibnet_url:
return self.url_result(sibnet_urls[0]) return self.url_result(sibnet_url)
m_opts = re.search(r'(?s)var\s+opts\s*=\s*({.+?});', info_page) m_opts = re.search(r'(?s)var\s+opts\s*=\s*({.+?});', info_page)
if m_opts: if m_opts: