From 66ff0bb2ffb170333f7e962dfd2b8a8832d93de5 Mon Sep 17 00:00:00 2001 From: girst Date: Sun, 23 Apr 2023 15:25:14 +0000 Subject: [PATCH] common/g_v_i: use parameters from yt-dlp previously, we used a mix of invidious, newpipe, ytdlp, zerodytrash/YouTube-Internal-Clients values for no particular reason. this should get us less distinct (we still are using the wrong api key). --- app/common/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/common/common.py b/app/common/common.py index b99a858..3087013 100644 --- a/app/common/common.py +++ b/app/common/common.py @@ -227,7 +227,7 @@ def get_video_info(video_id, *, metaOnly=False, _agegate_bypass=False): # TVHTML5* returns throttled and possibly ciphered streams, but bypasses age-gate. atm, we don't decipher them. # TODO: unscramble TVHTML5* streams (especially &n= throttling) client = { - (False, False): { 'clientName': 'ANDROID', 'clientVersion': '17.33.42', 'androidSdkVersion': 30}, + (False, False): { 'clientName': 'ANDROID', 'clientVersion': '17.31.35', 'androidSdkVersion': 30}, (False, True): { 'clientName': 'TVHTML5_SIMPLY_EMBEDDED_PLAYER', 'clientVersion': '2.0' }, (True, False): { 'clientName': 'WEB', 'clientVersion':f'2.{today}.01.01' }, }[(metaOnly, _agegate_bypass)] @@ -241,7 +241,7 @@ def get_video_info(video_id, *, metaOnly=False, _agegate_bypass=False): }, 'thirdParty': {'embedUrl': 'https://www.youtube.com/'} }, - }, cookies=cookies, headers={"User-Agent": "com.google.android.youtube/17.33.42 (Linux; U; Android 11; GB) gzip"}) + }, cookies=cookies, headers={"User-Agent": "com.google.android.youtube/17.31.35 (Linux; U; Android 11) gzip"}) if not r or r.status_code == 429: return None, None, None, 'banned', 'possible IP ban' -- 2.39.3