forked from MarseyWorld/MarseyWorld
convert /live code from greek to englsh
parent
1977d2e180
commit
f687d0e1ee
|
@ -424,7 +424,7 @@ if SITE == 'pcmemes.net':
|
||||||
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)
|
||||||
offline_details_regex = re.compile('simpleText":"Μεταδόθηκε πριν από ([0-9]*?) ([^"]*?)"\},"viewCountText":\{"simpleText":"([0-9.]*?) προβολές"', flags=re.A)
|
offline_details_regex = re.compile('simpleText":"Streamed ([0-9]*?) ([^"]*?)"\},"viewCountText":\{"simpleText":"([0-9.]*?) views"', flags=re.A)
|
||||||
|
|
||||||
def process_streamer(id, live='live'):
|
def process_streamer(id, live='live'):
|
||||||
url = f'https://www.youtube.com/channel/{id}/{live}'
|
url = f'https://www.youtube.com/channel/{id}/{live}'
|
||||||
|
@ -463,30 +463,23 @@ if SITE == 'pcmemes.net':
|
||||||
y = offline_details_regex.search(text)
|
y = offline_details_regex.search(text)
|
||||||
|
|
||||||
if y:
|
if y:
|
||||||
views = y.group(3).replace('.', '')
|
views = y.group(3).replace(',', '')
|
||||||
quantity = int(y.group(1))
|
quantity = int(y.group(1))
|
||||||
unit = y.group(2)
|
unit = y.group(2)
|
||||||
|
|
||||||
if unit.startswith('δε'):
|
if unit.startswith('second'):
|
||||||
unit = 'second'
|
|
||||||
modifier = 1/60
|
modifier = 1/60
|
||||||
elif unit.startswith('λεπτ'):
|
elif unit.startswith('minute'):
|
||||||
unit = 'minute'
|
|
||||||
modifier = 1
|
modifier = 1
|
||||||
elif unit.startswith('ώρ'):
|
elif unit.startswith('hour'):
|
||||||
unit = 'hour'
|
|
||||||
modifier = 60
|
modifier = 60
|
||||||
elif unit.startswith('ημέρ'):
|
elif unit.startswith('day'):
|
||||||
unit = 'day'
|
|
||||||
modifier = 1440
|
modifier = 1440
|
||||||
elif unit.startswith('εβδομάδ'):
|
elif unit.startswith('week'):
|
||||||
unit = 'week'
|
|
||||||
modifier = 10080
|
modifier = 10080
|
||||||
elif unit.startswith('μήν'):
|
elif unit.startswith('month'):
|
||||||
unit = 'month'
|
|
||||||
modifier = 43800
|
modifier = 43800
|
||||||
elif unit.startswith('έτ'):
|
elif unit.startswith('year'):
|
||||||
unit = 'year'
|
|
||||||
modifier = 525600
|
modifier = 525600
|
||||||
|
|
||||||
minutes = quantity * modifier
|
minutes = quantity * modifier
|
||||||
|
|
Loading…
Reference in New Issue