From c79067f7f13fb58c562cd8ac9c786bfe6582fa8e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 25 Sep 2022 08:14:21 +0200 Subject: [PATCH] make it possible to add channels by name --- files/routes/static.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/routes/static.py b/files/routes/static.py index e0022723ae..322c31598c 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -544,6 +544,10 @@ if SITE == 'pcmemes.net': id = request.values.get('id').strip() + if not id.startswith('UC'): + req = requests.get(f'https://www.googleapis.com/youtube/v3/channels?key={YOUTUBE_KEY}&forUsername={id}&part=id', timeout=5, proxies=proxies).json() + id = req['items']['id'] + live = cache.get('live') or [] offline = cache.get('offline') or []