1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-06-27 17:08:32 +00:00

A simpler and more compact way to get embed_url and embed_page at yt_dlp/extractor/thehighwire.py

Co-authored-by: doe1080 <98906116+doe1080@users.noreply.github.com>
This commit is contained in:
Nikolay Fedorov 2025-06-20 23:02:43 +03:00 committed by GitHub
parent f9f0c63fbc
commit 4ffba17e1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,15 +17,10 @@ def _real_extract(self, url):
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
iframe_url = self._search_regex(
r'<iframe[^>]+src=["\'](https?://app\.arkengine\.com/embed/[^"\']+)',
webpage, 'iframe URL')
video_id = self._search_regex(
r'embed/([a-zA-Z0-9]+)', iframe_url, 'video ID')
player_page = self._download_webpage(
self._EMBED_URL.format(id=video_id), video_id,
note='Downloading player page')
embed_url = traverse_obj(webpage, (
{find_element(cls='ark-video-embed', html=True)},
{extract_attributes}, 'src', {url_or_none}, {require('embed URL')}))
embed_page = self._download_webpage(embed_url, display_id)
m3u8_url = self._search_regex(
r'<source[^>]+src=["\']([^"\']+\.m3u8)',