]> jfr.im git - yt-dlp.git/commitdiff
[extractor/dropbox] Extract the correct `mountComponent`
authorpukkandan <redacted>
Sun, 19 Jun 2022 01:15:35 +0000 (06:45 +0530)
committerpukkandan <redacted>
Sun, 19 Jun 2022 01:16:46 +0000 (06:46 +0530)
yt_dlp/extractor/dropbox.py

index 6ac0c713a6915d4e7ada18044a6ad732f89e297c..0d12513b2957338fcf8c26484b313d911b42c578 100644 (file)
@@ -53,8 +53,8 @@ def _real_extract(self, url):
             else:
                 raise ExtractorError('Password protected video, use --video-password <password>', expected=True)
 
-        json_string = self._html_search_regex(r'InitReact\.mountComponent\(.*?,\s*(\{.+\})\s*?\)', webpage, 'Info JSON')
-        info_json = self._parse_json(json_string, video_id).get('props')
+        info_json = self._search_json(r'InitReact\.mountComponent\(.*?,', webpage, 'mountComponent', video_id,
+                                      contains_pattern=r'.+?"preview".+?', end_pattern=r'\)')['props']
         transcode_url = traverse_obj(info_json, ((None, 'preview'), 'file', 'preview', 'content', 'transcode_url'), get_all=False)
         formats, subtitles = self._extract_m3u8_formats_and_subtitles(transcode_url, video_id)