forked from rDrama/rDrama
fix
parent
63a7183f7e
commit
fc2758df50
|
@ -444,18 +444,25 @@ if SITE == 'pcmemes.net':
|
||||||
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)
|
||||||
offline_details_regex = re.compile('simpleText":"Gestreamd: ([0-9]*?) ([a-z]*?) geleden"\},"viewCountText":\{"simpleText":"([0-9.]*?) weergaven"', flags=re.A)
|
offline_details_regex = re.compile('simpleText":"Gestreamd: ([0-9]*?) ([a-z]*?) geleden"\},"viewCountText":\{"simpleText":"([0-9.]*?) weergaven"', flags=re.A)
|
||||||
|
|
||||||
def process_streamer(id):
|
def process_streamer(id, live='live'):
|
||||||
url = f'https://www.youtube.com/channel/{id}/live'
|
url = f'https://www.youtube.com/channel/{id}/{live}'
|
||||||
req = requests.get(url, cookies={'CONSENT': 'YES+1'}, timeout=5, proxies=proxies)
|
req = requests.get(url, cookies={'CONSENT': 'YES+1'}, timeout=5, proxies=proxies)
|
||||||
text = req.text
|
text = req.text
|
||||||
if '"videoDetails":{"videoId"' in text:
|
if '"videoDetails":{"videoId"' in text:
|
||||||
t = live_thumb_regex.search(text)
|
|
||||||
y = live_regex.search(text)
|
y = live_regex.search(text)
|
||||||
try:
|
count = y.group(3)
|
||||||
return_val = (True, (id, req.url, t.group(1), y.group(2), y.group(1), int(y.group(3))))
|
if 'wacht' in count:
|
||||||
except:
|
return process_streamer(id, '')
|
||||||
print(id, flush=True)
|
|
||||||
return_val = None
|
count = int(count)
|
||||||
|
|
||||||
|
t = live_thumb_regex.search(text)
|
||||||
|
|
||||||
|
thumb = t.group(1)
|
||||||
|
name = y.group(2)
|
||||||
|
title = y.group(1)
|
||||||
|
|
||||||
|
return (True, (id, req.url, thumb, name, title, count))
|
||||||
else:
|
else:
|
||||||
t = offline_regex.search(text)
|
t = offline_regex.search(text)
|
||||||
y = offline_details_regex.search(text)
|
y = offline_details_regex.search(text)
|
||||||
|
@ -495,12 +502,10 @@ if SITE == 'pcmemes.net':
|
||||||
actual = '???'
|
actual = '???'
|
||||||
views = 0
|
views = 0
|
||||||
|
|
||||||
try:
|
thumb = t.group(2)
|
||||||
return_val = (False, (id, req.url.rstrip('/live'), t.group(2), t.group(1), minutes, actual, views))
|
name = t.group(1)
|
||||||
except:
|
|
||||||
print(id, flush=True)
|
return (False, (id, req.url.rstrip('/live'), thumb, name, minutes, actual, views))
|
||||||
return_val = None
|
|
||||||
return return_val
|
|
||||||
|
|
||||||
|
|
||||||
def live_cached():
|
def live_cached():
|
||||||
|
|
Loading…
Reference in New Issue