1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-06-06 00:49:20 +02:00

[Duboku] Decrypt m3u8 url link

This commit is contained in:
DmitryScaletta
2024-02-07 21:26:50 +03:00
parent 05420227aa
commit 0216d0a566

View File

@@ -1,4 +1,6 @@
import base64
import re
import urllib.parse
from .common import InfoExtractor
from ..compat import compat_urlparse
@@ -129,11 +131,14 @@ class DubokuIE(InfoExtractor):
data_url = player_data.get('url')
if not data_url:
raise ExtractorError('Cannot find url in player_data')
data_from = player_data.get('from')
if player_data.get('encrypt') == 1:
data_url = urllib.parse.unquote(data_url)
if player_data.get('encrypt') == 2:
data_url = urllib.parse.unquote(base64.b64decode(data_url))
# if it is an embedded iframe, maybe it's an external source
headers = {'Referer': webpage_url}
if data_from == 'iframe':
if player_data.get('from') == 'iframe':
# use _type url_transparent to retain the meaningful details
# of the video.
return {