aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbashonly <88596187+bashonly@users.noreply.github.com>2022-11-18 02:04:03 +0000
committerGitHub <noreply@github.com>2022-11-18 02:04:03 +0000
commited027fd9d8c0832d6186b3591ca51622e34a072d (patch)
treed42fb55bf366818bf8b614af2a7f10082722a99d
parent352e7d987323e9df9205ee117a604ee4123231c2 (diff)
downloadhypervideo-pre-ed027fd9d8c0832d6186b3591ca51622e34a072d.tar.lz
hypervideo-pre-ed027fd9d8c0832d6186b3591ca51622e34a072d.tar.xz
hypervideo-pre-ed027fd9d8c0832d6186b3591ca51622e34a072d.zip
[extractor/generic] Fix JSON LD manifest extraction (#5577)
Closes #5572 Authored by: bashonly, pukkandan
-rw-r--r--yt_dlp/extractor/generic.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/yt_dlp/extractor/generic.py b/yt_dlp/extractor/generic.py
index 51a6cbf06..5da77273d 100644
--- a/yt_dlp/extractor/generic.py
+++ b/yt_dlp/extractor/generic.py
@@ -10,6 +10,7 @@ from .youtube import YoutubeIE
from ..compat import compat_etree_fromstring
from ..utils import (
KNOWN_EXTENSIONS,
+ MEDIA_EXTENSIONS,
ExtractorError,
UnsupportedError,
determine_ext,
@@ -2572,8 +2573,9 @@ class GenericIE(InfoExtractor):
json_ld = self._search_json_ld(webpage, video_id, default={})
if json_ld.get('url') not in (url, None):
self.report_detected('JSON LD')
+ is_direct = json_ld.get('ext') not in (None, *MEDIA_EXTENSIONS.manifests)
return [merge_dicts({
- '_type': 'video' if json_ld.get('ext') else 'url_transparent',
+ '_type': 'video' if is_direct else 'url_transparent',
'url': smuggle_url(json_ld['url'], {
'force_videoid': video_id,
'to_generic': True,