testing on devrama

remotes/1693176582716663532/tmp_refs/heads/watchparty
Aevann1 2022-09-25 05:34:28 +02:00
parent 18a5bc6108
commit 8ce942dcc0
1 changed files with 13 additions and 10 deletions

View File

@ -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)