make it possible to add channels by name

master
Aevann1 2022-09-25 08:14:21 +02:00
parent 164b583e7c
commit c79067f7f1
1 changed files with 4 additions and 0 deletions

View File

@ -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 []