From 62418f8e953036434ed247c93c1a84d840b40a09 Mon Sep 17 00:00:00 2001 From: Jesus Date: Tue, 11 Jun 2024 10:46:25 +0800 Subject: 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 --- youtube/util.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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': { -- cgit v1.2.3