forked from MarseyWorld/MarseyWorld
fix
parent
10d09f076c
commit
9d9783fe0e
|
@ -439,6 +439,7 @@ def donate(v):
|
||||||
if SITE == 'pcmemes.net':
|
if SITE == 'pcmemes.net':
|
||||||
from files.classes.streamers import *
|
from files.classes.streamers import *
|
||||||
|
|
||||||
|
id_regex = re.compile('"externalId":"([^"]*?)"', flags=re.A)
|
||||||
live_regex = re.compile('playerOverlayVideoDetailsRenderer":\{"title":\{"simpleText":"(.*?)"\},"subtitle":\{"runs":\[\{"text":"(.*?)"\},\{"text":" • "\},\{"text":"(.*?)"\}', flags=re.A)
|
live_regex = re.compile('playerOverlayVideoDetailsRenderer":\{"title":\{"simpleText":"(.*?)"\},"subtitle":\{"runs":\[\{"text":"(.*?)"\},\{"text":" • "\},\{"text":"(.*?)"\}', flags=re.A)
|
||||||
live_thumb_regex = re.compile('\{"thumbnail":\{"thumbnails":\[\{"url":"(.*?)"', flags=re.A)
|
live_thumb_regex = re.compile('\{"thumbnail":\{"thumbnails":\[\{"url":"(.*?)"', flags=re.A)
|
||||||
offline_regex = re.compile('","title":"(.*?)".*?"width":48,"height":48\},\{"url":"(.*?)"', flags=re.A)
|
offline_regex = re.compile('","title":"(.*?)".*?"width":48,"height":48\},\{"url":"(.*?)"', flags=re.A)
|
||||||
|
@ -491,6 +492,7 @@ if SITE == 'pcmemes.net':
|
||||||
unit = 'year'
|
unit = 'year'
|
||||||
modifier = 525600
|
modifier = 525600
|
||||||
|
|
||||||
|
print(unit, flush=True)
|
||||||
minutes = quantity * modifier
|
minutes = quantity * modifier
|
||||||
|
|
||||||
actual = f'{quantity} {unit}'
|
actual = f'{quantity} {unit}'
|
||||||
|
@ -545,9 +547,9 @@ if SITE == 'pcmemes.net':
|
||||||
id = request.values.get('id').strip()
|
id = request.values.get('id').strip()
|
||||||
|
|
||||||
if not id.startswith('UC'):
|
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()
|
text = requests.get(f'https://www.youtube.com/c/{id}', timeout=5, proxies=proxies).text
|
||||||
print(req, flush=True)
|
try: id = id_regex.search(text).group(1)
|
||||||
id = req['items']['id']
|
except: return render_template('live.html', v=v, live=live, offline=offline, error="Invalid ID")
|
||||||
|
|
||||||
live = cache.get('live') or []
|
live = cache.get('live') or []
|
||||||
offline = cache.get('offline') or []
|
offline = cache.get('offline') or []
|
||||||
|
|
Loading…
Reference in New Issue