mirror of
https://codeberg.org/polarisfm/youtube-dl.git
synced 2024-12-27 01:56:52 +00:00
[youtube] Parse player_url if format URLs are encrypted or DASH MPDs are requested
Fixes #13211
This commit is contained in:
parent
a846173d93
commit
a49eccdfa7
2 changed files with 8 additions and 5 deletions
|
@ -1,6 +1,8 @@
|
|||
version <unreleased>
|
||||
|
||||
Extractors
|
||||
* [youtube] Fix DASH MPD extraction for videos with non-encrypted format URLs
|
||||
(#13211)
|
||||
+ [youku] Extract more metadata (#10433)
|
||||
|
||||
|
||||
|
|
|
@ -1715,12 +1715,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||
format_id = url_data['itag'][0]
|
||||
url = url_data['url'][0]
|
||||
|
||||
if 'sig' in url_data:
|
||||
url += '&signature=' + url_data['sig'][0]
|
||||
elif 's' in url_data:
|
||||
encrypted_sig = url_data['s'][0]
|
||||
if 's' in url_data or self._downloader.params.get('youtube_include_dash_manifest', True):
|
||||
ASSETS_RE = r'"assets":.+?"js":\s*("[^"]+")'
|
||||
|
||||
jsplayer_url_json = self._search_regex(
|
||||
ASSETS_RE,
|
||||
embed_webpage if age_gate else video_webpage,
|
||||
|
@ -1741,6 +1737,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||
video_webpage, 'age gate player URL')
|
||||
player_url = json.loads(player_url_json)
|
||||
|
||||
if 'sig' in url_data:
|
||||
url += '&signature=' + url_data['sig'][0]
|
||||
elif 's' in url_data:
|
||||
encrypted_sig = url_data['s'][0]
|
||||
|
||||
if self._downloader.params.get('verbose'):
|
||||
if player_url is None:
|
||||
player_version = 'unknown'
|
||||
|
|
Loading…
Reference in a new issue