get it ready for pcm

remotes/1693176582716663532/tmp_refs/heads/watchparty
Aevann1 2022-09-25 05:29:38 +02:00
parent 1f6d3341fc
commit 8319aefe1c
3 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
from files.helpers.const import SITE
if SITE == 'pcmemes.net' or True:
if SITE == 'pcmemes.net':
from sqlalchemy import *
from files.__main__ import Base

View File

@ -31,7 +31,7 @@ def cron(every_5m, every_1h, every_1d, every_1mo):
lottery.check_if_end_lottery_task()
spin_roulette_wheel()
offsitementions.offsite_mentions_task()
if SITE == 'pcmemes.net' or True:
if SITE == 'pcmemes.net':
x = route_static.live_cached()
cache.set('live', x[0])
cache.set('offline', x[1])

View File

@ -436,7 +436,7 @@ def donate(v):
return render_template(f'donate_{SITE_NAME}.html', v=v)
if SITE == 'pcmemes.net' or True:
if SITE == 'pcmemes.net':
from files.classes.streamers import *
live_regex = re.compile('playerOverlayVideoDetailsRenderer":\{"title":\{"simpleText":"(.*?)"\},"subtitle":\{"runs":\[\{"text":"(.*?)"\},\{"text":""\},\{"text":"(.*?)"\}', flags=re.A)
@ -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'})
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)
@ -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'})
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)