fix youtube ratelimit

master
Aevann 2024-04-08 09:06:17 +02:00
parent 266036cd32
commit 32a2b397ee
1 changed files with 1 additions and 1 deletions

View File

@ -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':