From 8ce942dcc0c86c84a617363b1ce8d837b768a065 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 25 Sep 2022 05:34:28 +0200 Subject: [PATCH] testing on devrama --- files/routes/static.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/files/routes/static.py b/files/routes/static.py index 253d77194..d0a9c8a24 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -452,17 +452,17 @@ if SITE == 'pcmemes.net': for x in streamers: url = f'https://www.youtube.com/channel/{x}/live' req = requests.get(url, cookies={'CONSENT': 'YES+1'}, timeout=5, proxies=proxies) - txt = req.text - if '"videoDetails":{"videoId"' in txt: - t = live_thumb_regex.search(txt) - y = live_regex.search(txt) + text = req.text + if '"videoDetails":{"videoId"' in text: + t = live_thumb_regex.search(text) + y = live_regex.search(text) try: count = int(y.group(3)) live.append((x, req.url, t.group(1), y.group(2), y.group(1), count)) except: print(x) else: - y = offline_regex.search(txt) + y = offline_regex.search(text) try: offline.append((x, req.url.rstrip('/live'), y.group(2), y.group(1))) except: print(x) @@ -500,10 +500,10 @@ if SITE == 'pcmemes.net': url = f'https://www.youtube.com/channel/{id}/live' req = requests.get(url, cookies={'CONSENT': 'YES+1'}, timeout=5, proxies=proxies) - txt = req.text - if '"videoDetails":{"videoId"' in txt: - t = live_thumb_regex.search(txt) - y = live_regex.search(txt) + text = req.text + if '"videoDetails":{"videoId"' in text: + t = live_thumb_regex.search(text) + y = live_regex.search(text) try: count = int(y.group(3)) live.append((id, req.url, t.group(1), y.group(2), y.group(1), count)) @@ -511,7 +511,10 @@ if SITE == 'pcmemes.net': except: print(id, flush=True) else: - y = offline_regex.search(txt) + with open("files/assets/txt8.txt", "w", encoding='utf_8') as f: + f.write(text) + 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))) cache.set('offline', offline)