aboutsummaryrefslogtreecommitdiffstats
path: root/youtube
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2020-05-27 11:56:30 -0700
committerJames Taylor <user234683@users.noreply.github.com>2020-05-27 11:56:30 -0700
commit85db7e46ed42a74885f9bc6ff9d6bc519de8f98e (patch)
treea338bc107184819dd2ef5f9c11a76843dfb143a5 /youtube
parentd7a4b03fdf100e87bd2efbf83b33165d68ba770e (diff)
downloadyt-local-85db7e46ed42a74885f9bc6ff9d6bc519de8f98e.tar.lz
yt-local-85db7e46ed42a74885f9bc6ff9d6bc519de8f98e.tar.xz
yt-local-85db7e46ed42a74885f9bc6ff9d6bc519de8f98e.zip
Fix urls sometimes not extracted due to youtube changes
The 'cipher' parameter which contains the url is sometimes called 'signatureCipher' instead now.
Diffstat (limited to 'youtube')
-rw-r--r--youtube/yt_data_extract/watch_extraction.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube/yt_data_extract/watch_extraction.py b/youtube/yt_data_extract/watch_extraction.py
index 2aeda83..7318a95 100644
--- a/youtube/yt_data_extract/watch_extraction.py
+++ b/youtube/yt_data_extract/watch_extraction.py
@@ -351,7 +351,8 @@ def _extract_formats(info, player_response):
fmt['audio_sample_rate'] = yt_fmt.get('audioSampleRate')
fmt['fps'] = yt_fmt.get('fps')
update_format_with_type_info(fmt, yt_fmt)
- cipher = dict(urllib.parse.parse_qsl(yt_fmt.get('cipher', '')))
+ cipher = dict(urllib.parse.parse_qsl(multi_get(yt_fmt,
+ 'cipher', 'signatureCipher', default='')))
if cipher:
fmt['url'] = cipher.get('url')
else: