[RedBull] Use og_search_url function

This commit is contained in:
DmitryScaletta 2024-02-14 14:19:24 +03:00
parent e64fd831b1
commit 0d74df84af
No known key found for this signature in database
GPG Key ID: 167A65222EDD4C2A

View File

@ -98,13 +98,13 @@ class RedBullTVIE(InfoExtractor):
'only_matching': True,
}]
_PAGE_URL_REGEX = r'<meta property="og:url"\s*content="(?P<url>[^"]+)"'
def _real_extract(self, url):
video_id = self._match_id(url)
html = self._download_webpage(url, video_id)
return self.url_result(
re.findall(self._PAGE_URL_REGEX, html)[0], RedBullIE, video_id)
try:
return self.url_result(self._og_search_url(html), RedBullIE, video_id)
except Exception:
raise ExtractorError('Failed to extract video URL', expected=True)
class RedBullEmbedIE(RedBullBaseIE):