diff options
author | James Taylor <user234683@users.noreply.github.com> | 2020-05-27 11:56:30 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2020-05-27 11:56:30 -0700 |
commit | 85db7e46ed42a74885f9bc6ff9d6bc519de8f98e (patch) | |
tree | a338bc107184819dd2ef5f9c11a76843dfb143a5 /youtube | |
parent | d7a4b03fdf100e87bd2efbf83b33165d68ba770e (diff) | |
download | yt-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.py | 3 |
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: |