From ea7803ef448b6ff629988d9ad1e725a3c9236da1 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 25 Sep 2022 05:43:57 +0200 Subject: [PATCH] testing --- files/routes/static.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/files/routes/static.py b/files/routes/static.py index 1052de06a..503a360cc 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -451,7 +451,7 @@ if SITE == 'pcmemes.net' or True: db.close() for x in streamers: url = f'https://www.youtube.com/channel/{x}/live' - req = requests.get(url, cookies={'CONSENT': 'YES+1'}, timeout=5) + req = requests.get(url, cookies={'CONSENT': 'YES+1'}, timeout=5, proxies=proxies) text = req.text if '"videoDetails":{"videoId"' in text: t = live_thumb_regex.search(text) @@ -499,7 +499,7 @@ if SITE == 'pcmemes.net' or True: send_repeatable_notification(KIPPY_ID, f"@{v.username} has added a [new YouTube channel](https://www.youtube.com/channel/{streamer.id})") url = f'https://www.youtube.com/channel/{id}/live' - req = requests.get(url, cookies={'CONSENT': 'YES+1'}, timeout=5) + req = requests.get(url, cookies={'CONSENT': 'YES+1'}, timeout=5, proxies=proxies) text = req.text if '"videoDetails":{"videoId"' in text: t = live_thumb_regex.search(text) @@ -511,9 +511,8 @@ if SITE == 'pcmemes.net' or True: except: print(id, flush=True) else: - with open("files/assets/txt8.txt", "w", encoding='utf_8') as f: + with open("files/assets/txt9.txt", "w", encoding='utf_8') as f: f.write(text) - return make_response(send_from_directory('assets', 'txt8.txt')) y = offline_regex.search(text) try: offline.append((id, req.url.rstrip('/live'), y.group(2), y.group(1)))