From 59cbba8cc8ae1a39094cac47e52d0163ad3680ed Mon Sep 17 00:00:00 2001 From: rhgndf <16336768+rhgndf@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:21:02 +0800 Subject: [PATCH] [duboku] Fix extracting m3u8 --- yt_dlp/extractor/duboku.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/duboku.py b/yt_dlp/extractor/duboku.py index 68c3f05731..43a5e5f2c2 100644 --- a/yt_dlp/extractor/duboku.py +++ b/yt_dlp/extractor/duboku.py @@ -136,6 +136,10 @@ class DubokuIE(InfoExtractor): elif player_encrypt == 2: data_url = urllib.parse.unquote(base64.b64decode(data_url).decode('ascii')) + sign_url = 'https://w.duboku.io/static/player/vidjs25.php' + sign_html = self._download_webpage(sign_url, video_id) + sign = re.search(r'encodeURIComponent\(\'(.*)\'\);', sign_html).group(1) + # if it is an embedded iframe, maybe it's an external source headers = {'Referer': webpage_url} if player_data.get('from') == 'iframe': @@ -153,7 +157,7 @@ class DubokuIE(InfoExtractor): 'episode_id': episode_id, } - formats = self._extract_m3u8_formats(data_url, video_id, 'mp4', headers=headers) + formats = self._extract_m3u8_formats(data_url, video_id, 'mp4', query={'sign': sign}, headers=headers) return { 'id': video_id,