1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-03-09 12:50:23 -05:00
This commit is contained in:
rhgndf 2025-03-09 04:30:18 +05:30 committed by GitHub
commit 83f4b2575c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -136,6 +136,13 @@ def _real_extract(self, url):
elif player_encrypt == 2: elif player_encrypt == 2:
data_url = urllib.parse.unquote(base64.b64decode(data_url).decode('ascii')) 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)
if not sign:
raise ExtractorError('Cannot find sign in player')
sign = sign.group(1)
# if it is an embedded iframe, maybe it's an external source # if it is an embedded iframe, maybe it's an external source
headers = {'Referer': webpage_url} headers = {'Referer': webpage_url}
if player_data.get('from') == 'iframe': if player_data.get('from') == 'iframe':
@ -153,7 +160,7 @@ def _real_extract(self, url):
'episode_id': episode_id, '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 { return {
'id': video_id, 'id': video_id,