diff options
author | coletdjnz <coletdjnz@protonmail.com> | 2022-08-08 12:01:57 +1200 |
---|---|---|
committer | coletdjnz <coletdjnz@protonmail.com> | 2022-08-08 12:03:10 +1200 |
commit | c7dcf0b31e57bb98472da7cf293f523caa81c4a7 (patch) | |
tree | 14259eee866d6e9bf0d4bf98c8316110b5c69036 | |
parent | 298d9c0e891b1a0fbc3ec6d3674ff6fbc550d6ec (diff) | |
download | hypervideo-pre-c7dcf0b31e57bb98472da7cf293f523caa81c4a7.tar.lz hypervideo-pre-c7dcf0b31e57bb98472da7cf293f523caa81c4a7.tar.xz hypervideo-pre-c7dcf0b31e57bb98472da7cf293f523caa81c4a7.zip |
[extractor/youtube] Add `androidSdkVersion` parameter to Android Innertube clients
Required to prevent YouTube returning a bad player response in some cases.
See: https://github.com/yt-dlp/yt-dlp/pull/4593, https://github.com/TeamNewPipe/NewPipe/issues/8713, https://github.com/iv-org/invidious/issues/3230, https://github.com/Tyrrrz/YoutubeExplode/issues/647
Authored by: coletdjnz
-rw-r--r-- | yt_dlp/extractor/youtube.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 325aa0a23..fc8825b19 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -109,7 +109,8 @@ INNERTUBE_CLIENTS = { 'INNERTUBE_CONTEXT': { 'client': { 'clientName': 'ANDROID', - 'clientVersion': '17.28.34', + 'clientVersion': '17.29.34', + 'androidSdkVersion': 30 } }, 'INNERTUBE_CONTEXT_CLIENT_NAME': 3, @@ -120,7 +121,8 @@ INNERTUBE_CLIENTS = { 'INNERTUBE_CONTEXT': { 'client': { 'clientName': 'ANDROID_EMBEDDED_PLAYER', - 'clientVersion': '17.28.34', + 'clientVersion': '17.29.34', + 'androidSdkVersion': 30 }, }, 'INNERTUBE_CONTEXT_CLIENT_NAME': 55, @@ -132,6 +134,7 @@ INNERTUBE_CLIENTS = { 'client': { 'clientName': 'ANDROID_MUSIC', 'clientVersion': '5.16.51', + 'androidSdkVersion': 30 } }, 'INNERTUBE_CONTEXT_CLIENT_NAME': 21, @@ -143,6 +146,7 @@ INNERTUBE_CLIENTS = { 'client': { 'clientName': 'ANDROID_CREATOR', 'clientVersion': '22.28.100', + 'androidSdkVersion': 30 }, }, 'INNERTUBE_CONTEXT_CLIENT_NAME': 14, @@ -3142,7 +3146,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): pr_video_id = traverse_obj(pr, ('videoDetails', 'videoId')) if pr_video_id and pr_video_id != video_id: self.report_warning( - f'{client} client returned a player response for "{pr_video_id}" instead of "{video_id}"' + bug_reports_message()) + f'Skipping player response from {client} client (got player response for video "{pr_video_id}" instead of "{video_id}")' + bug_reports_message()) else: prs.append(pr) |