]> jfr.im git - yt-dlp.git/commitdiff
[generic] Extract m3u8 formats from JSON-LD
authorpukkandan <redacted>
Fri, 17 Dec 2021 22:46:40 +0000 (04:16 +0530)
committerpukkandan <redacted>
Sun, 19 Dec 2021 03:35:50 +0000 (09:05 +0530)
yt_dlp/extractor/generic.py

index 51557f0f1c5b905cd23915e69c15c58cab5b87bf..1ec0ce986441a36be785694c9930504b1d3393d9 100644 (file)
@@ -3653,6 +3653,10 @@ def _real_extract(self, url):
         json_ld = self._search_json_ld(webpage, video_id, default={})
         if json_ld.get('url'):
             self.report_detected('JSON LD')
+            if determine_ext(json_ld.get('url')) == 'm3u8':
+                json_ld['formats'], json_ld['subtitles'] = self._extract_m3u8_formats_and_subtitles(
+                    json_ld['url'], video_id, 'mp4')
+                json_ld.pop('url')
             return merge_dicts(json_ld, info_dict)
 
         def check_video(vurl):