[extractor/foxnews] Update embed extraction (#4043)

Authored by: elyse0
This commit is contained in:
Elyse 2022-06-19 08:13:47 -05:00 committed by pukkandan
parent 697ebe4d31
commit 40268a7974
No known key found for this signature in database
GPG Key ID: 7EEE9E1E817D0A39

View File

@ -59,10 +59,13 @@ class FoxNewsIE(AMPIE):
@staticmethod
def _extract_urls(webpage):
return [
mobj.group('url')
f'https://video.foxnews.com/v/video-embed.html?video_id={mobj.group("video_id")}'
for mobj in re.finditer(
r'<(?:amp-)?iframe[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//video\.foxnews\.com/v/video-embed\.html?.*?\bvideo_id=\d+.*?)\1',
webpage)]
r'''(?x)
<(?:script|(?:amp-)?iframe)[^>]+\bsrc=["\']
(?:https?:)?//video\.foxnews\.com/v/(?:video-embed\.html|embed\.js)\?
(?:[^>"\']+&)?(?:video_)?id=(?P<video_id>\d+)
''', webpage)]
def _real_extract(self, url):
host, video_id = self._match_valid_url(url).groups()