mirror of
https://github.com/yt-dlp/yt-dlp
synced 2024-12-27 21:59:17 +01:00
[ie/duboku] Fix m3u8 formats extraction (#9161)
Closes #9159 Authored by: DmitryScaletta
This commit is contained in:
parent
c8c9039e64
commit
d3d4187da9
1 changed files with 8 additions and 2 deletions
|
@ -1,4 +1,6 @@
|
||||||
|
import base64
|
||||||
import re
|
import re
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import compat_urlparse
|
from ..compat import compat_urlparse
|
||||||
|
@ -129,11 +131,15 @@ class DubokuIE(InfoExtractor):
|
||||||
data_url = player_data.get('url')
|
data_url = player_data.get('url')
|
||||||
if not data_url:
|
if not data_url:
|
||||||
raise ExtractorError('Cannot find url in player_data')
|
raise ExtractorError('Cannot find url in player_data')
|
||||||
data_from = player_data.get('from')
|
player_encrypt = player_data.get('encrypt')
|
||||||
|
if player_encrypt == 1:
|
||||||
|
data_url = urllib.parse.unquote(data_url)
|
||||||
|
elif player_encrypt == 2:
|
||||||
|
data_url = urllib.parse.unquote(base64.b64decode(data_url).decode('ascii'))
|
||||||
|
|
||||||
# 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 data_from == 'iframe':
|
if player_data.get('from') == 'iframe':
|
||||||
# use _type url_transparent to retain the meaningful details
|
# use _type url_transparent to retain the meaningful details
|
||||||
# of the video.
|
# of the video.
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue