@classmethod
def _extract_embed_urls(cls, url, webpage):
- return [
- f'https://video.foxnews.com/v/video-embed.html?video_id={mobj.group("video_id")}'
- for mobj in re.finditer(
+ for mobj in re.finditer(
r'''(?x)
<(?:script|(?:amp-)?iframe)[^>]+\bsrc=["\']
(?:https?:)?//video\.foxnews\.com/v/(?:video-embed\.html|embed\.js)\?
(?:[^>"\']+&)?(?: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):
host, video_id = self._match_valid_url(url).groups()
'http://video.foxnews.com/v/' + video_id, FoxNewsIE.ie_key())
return self.url_result(
- FoxNewsIE._extract_embed_urls(url, webpage)[0], FoxNewsIE.ie_key())
+ next(FoxNewsIE._extract_embed_urls(url, webpage)), FoxNewsIE.ie_key())