diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-09-02 01:51:04 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-09-02 02:01:58 +0530 |
commit | 5469a4ab117448c77ebd660cedd012ec2975d289 (patch) | |
tree | bdaccd37e7a220671d4e797cd9f6793a9605b526 | |
parent | 2c475e48b54b071a3e59441829b6dec7d5b3c0ac (diff) | |
download | hypervideo-pre-5469a4ab117448c77ebd660cedd012ec2975d289.tar.lz hypervideo-pre-5469a4ab117448c77ebd660cedd012ec2975d289.tar.xz hypervideo-pre-5469a4ab117448c77ebd660cedd012ec2975d289.zip |
[extractor/motorsport] Support native embeds
Closes #4749
-rw-r--r-- | yt_dlp/extractor/motorsport.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/yt_dlp/extractor/motorsport.py b/yt_dlp/extractor/motorsport.py index b292aeb9a..efb087d03 100644 --- a/yt_dlp/extractor/motorsport.py +++ b/yt_dlp/extractor/motorsport.py @@ -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') |