]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/generic.py
[extractor/generic] Fix JSON LD manifest extraction (#5577)
[yt-dlp.git] / yt_dlp / extractor / generic.py
index 51a6cbf06a922acac20caeea06dde940faa9d145..5da77273d804886f5ad3f73979112b895f6628ef 100644 (file)
@@ -10,6 +10,7 @@
 from ..compat import compat_etree_fromstring
 from ..utils import (
     KNOWN_EXTENSIONS,
+    MEDIA_EXTENSIONS,
     ExtractorError,
     UnsupportedError,
     determine_ext,
@@ -2572,8 +2573,9 @@ def _extract_embeds(self, url, webpage, *, urlh=None, info_dict={}):
         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,