aboutsummaryrefslogtreecommitdiffstats
path: root/youtube
diff options
context:
space:
mode:
authorJesus <heckyel@hyperbola.info>2024-06-11 10:46:25 +0800
committerJesus <heckyel@hyperbola.info>2024-06-11 10:46:25 +0800
commit62418f8e953036434ed247c93c1a84d840b40a09 (patch)
treeeb1582eaa4055649a930d6454a0c4b032cbb4aab /youtube
parentbfd37609693f432b34d4f35353d22b5d2ed540b6 (diff)
downloadyt-local-62418f8e953036434ed247c93c1a84d840b40a09.tar.lz
yt-local-62418f8e953036434ed247c93c1a84d840b40a09.tar.xz
yt-local-62418f8e953036434ed247c93c1a84d840b40a09.zip
Switch to android test suite client by default
Invidious' solution to the destruction of the android client: https://github.com/iv-org/invidious/pull/4650 Fixes #207
Diffstat (limited to 'youtube')
-rw-r--r--youtube/util.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/youtube/util.py b/youtube/util.py
index 24824ac..b9225d2 100644
--- a/youtube/util.py
+++ b/youtube/util.py
@@ -662,6 +662,29 @@ def to_valid_filename(name):
# https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/extractor/youtube.py#L72
INNERTUBE_CLIENTS = {
+ 'android-test-suite': {
+ 'INNERTUBE_API_KEY': 'AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w',
+ 'INNERTUBE_CONTEXT': {
+ 'client': {
+ 'hl': 'en',
+ 'gl': 'US',
+ 'clientName': 'ANDROID_TESTSUITE',
+ 'clientVersion': '1.9',
+ 'osName': 'Android',
+ 'osVersion': '12',
+ 'androidSdkVersion': 31,
+ 'platform': 'MOBILE',
+ 'userAgent': 'com.google.android.youtube/1.9 (Linux; U; Android 12; US) gzip'
+ },
+ # https://github.com/yt-dlp/yt-dlp/pull/575#issuecomment-887739287
+ #'thirdParty': {
+ # 'embedUrl': 'https://google.com', # Can be any valid URL
+ #}
+ },
+ 'INNERTUBE_CONTEXT_CLIENT_NAME': 3,
+ 'REQUIRE_JS_PLAYER': False,
+ },
+
'ios': {
'INNERTUBE_API_KEY': 'AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc',
'INNERTUBE_CONTEXT': {