mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-04 23:43:20 +00:00
[ie/mediastream] Make embed extraction non-fatal
Authored by: bashonly
This commit is contained in:
parent
5367585219
commit
635ae31f68
|
@ -14,7 +14,7 @@ class MediaStreamBaseIE(InfoExtractor):
|
||||||
_BASE_URL_RE = r'https?://mdstrm\.com/(?:embed|live-stream)'
|
_BASE_URL_RE = r'https?://mdstrm\.com/(?:embed|live-stream)'
|
||||||
|
|
||||||
def _extract_mediastream_urls(self, webpage):
|
def _extract_mediastream_urls(self, webpage):
|
||||||
yield from traverse_obj(list(self._yield_json_ld(webpage, None)), (
|
yield from traverse_obj(list(self._yield_json_ld(webpage, None, fatal=False)), (
|
||||||
lambda _, v: v['@type'] == 'VideoObject', ('embedUrl', 'contentUrl'),
|
lambda _, v: v['@type'] == 'VideoObject', ('embedUrl', 'contentUrl'),
|
||||||
{lambda x: x if re.match(rf'{self._BASE_URL_RE}/\w+', x) else None}))
|
{lambda x: x if re.match(rf'{self._BASE_URL_RE}/\w+', x) else None}))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue