From 32a2b397eefe675a545f232abcd07cce5584aade Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 8 Apr 2024 09:06:17 +0200 Subject: [PATCH] fix youtube ratelimit --- files/routes/chats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/chats.py b/files/routes/chats.py index 39c21e4cf..e31c0af0b 100644 --- a/files/routes/chats.py +++ b/files/routes/chats.py @@ -206,7 +206,7 @@ def schedule_orgy(v, chat_id): if bare_youtube_regex.match(normalized_link): orgy_type = 'youtube' data, _ = get_youtube_id_and_t(normalized_link) - if YOUTUBE_KEY != DEFAULT_CONFIG_VALUE: + if chat.id == 1 and YOUTUBE_KEY != DEFAULT_CONFIG_VALUE: req = requests.get(f"https://www.googleapis.com/youtube/v3/videos?id={data}&key={YOUTUBE_KEY}&part=contentDetails", headers=HEADERS, timeout=5).json() duration = req['items'][0]['contentDetails']['duration'] if duration != 'P0D':