diff options
-rw-r--r-- | youtube/util.py | 19 | ||||
-rw-r--r-- | youtube/watch.py | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/youtube/util.py b/youtube/util.py index 4c077f6..1dfdf7b 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -667,6 +667,25 @@ def to_valid_filename(name): # https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/extractor/youtube.py#L72 INNERTUBE_CLIENTS = { + 'android_music': { + 'INNERTUBE_API_KEY': 'AIzaSyAOghZGza2MQSZkY_zfZ370N-PUdXEo8AI', + 'INNERTUBE_CONTEXT': { + 'client': { + 'hl': 'en', + 'gl': 'US', + 'clientName': 'ANDROID_MUSIC', + 'clientVersion': '6.44.54', + 'osName': 'Android', + 'osVersion': '14', + 'androidSdkVersion': 34, + 'platform': 'MOBILE', + 'userAgent': 'com.google.android.apps.youtube.music/6.44.54 (Linux; U; Android 14; US) gzip' + } + }, + 'INNERTUBE_CONTEXT_CLIENT_NAME': 21, + 'REQUIRE_JS_PLAYER': False + }, + 'android': { 'INNERTUBE_API_KEY': 'AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w', 'INNERTUBE_CONTEXT': { diff --git a/youtube/watch.py b/youtube/watch.py index ceb66ea..cd0eb53 100644 --- a/youtube/watch.py +++ b/youtube/watch.py @@ -382,7 +382,7 @@ def extract_info(video_id, use_invidious, playlist_id=None, index=None): # Update 4/26/23, these URLs will randomly start returning 403 # mid-playback and I'm not sure why - gevent.spawn(fetch_player_response, 'android', video_id) + gevent.spawn(fetch_player_response, 'android_music', video_id) ) gevent.joinall(tasks) util.check_gevent_exceptions(*tasks) |