[extractor/motorsport] Support native embeds

Closes #4749
This commit is contained in:
pukkandan 2022-09-02 01:51:04 +05:30
parent 2c475e48b5
commit 5469a4ab11
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39

View file

@ -31,8 +31,13 @@ class MotorsportIE(InfoExtractor):
webpage = self._download_webpage(url, display_id)
iframe_path = self._html_search_regex(
r'<iframe id="player_iframe"[^>]+src="([^"]+)"', webpage,
'iframe path')
r'<iframe id="player_iframe"[^>]+src="([^"]+)"', webpage, 'iframe path', default=None)
if iframe_path is None:
iframe_path = self._html_search_regex(
r'<iframe [^>]*\bsrc="(https://motorsport\.tv/embed/[^"]+)', webpage, 'embed iframe path')
return self.url_result(iframe_path)
iframe = self._download_webpage(
compat_urlparse.urljoin(url, iframe_path), display_id,
'Downloading iframe')