From 85db7e46ed42a74885f9bc6ff9d6bc519de8f98e Mon Sep 17 00:00:00 2001 From: James Taylor Date: Wed, 27 May 2020 11:56:30 -0700 Subject: Fix urls sometimes not extracted due to youtube changes The 'cipher' parameter which contains the url is sometimes called 'signatureCipher' instead now. --- youtube/yt_data_extract/watch_extraction.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- cgit v1.2.3