From 26504c28b229a4ad7cc3a3dd780b3fc62829399b Mon Sep 17 00:00:00 2001 From: girst Date: Mon, 1 Apr 2024 13:42:25 +0000 Subject: [PATCH] bypass android rate limiting/ipban this may or may not affect which metadata keys are returned. invidious uses "CgIIAdgDAQ%3D%3D", ytdlp uses 'CgIIAQ=='. invidious' parameter doesn't show view count, yt-dlp's does. discovered here: https://github.com/LuanRT/YouTube.js/pull/624 invidious impl: https://github.com/iv-org/invidious/pull/4552 ytdlp commit: https://github.com/yt-dlp/yt-dlp/commit/e7b17fce14775bd2448695c8eb7379b8d31d3537 --- app/common/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/common.py b/app/common/common.py index a745727..7e6bc68 100644 --- a/app/common/common.py +++ b/app/common/common.py @@ -276,7 +276,7 @@ def get_video_info(video_id, *, metaOnly=False, _agegate_bypass=False): }, "racyCheckOk": True, # seems to do nothing, cargo-culted "contentCheckOk": True, # fix "This video may be inappropriate for some users." - "params": "CgIQBg%3D%3D", # otherwise googlevideo URLs become 403/Forbidden after a few accesses (breaks buffering/scrubbing) + "params": "CgIIAQ%3D%3D", # otherwise googlevideo URLs become 403/Forbidden after a few accesses (breaks buffering/scrubbing) and ANDROID client gets blocked }, cookies=cookies, headers={"User-Agent": "com.google.android.youtube/18.11.34 (Linux; U; Android 11) gzip"}) if not r or r.status_code == 429: -- 2.39.3