Vidoza, detectar tb file:
This commit is contained in:
@@ -23,18 +23,19 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
video_urls = []
|
video_urls = []
|
||||||
|
|
||||||
s = scrapertools.find_single_match(data, 'sourcesCode\s*:\s*(\[\{.*?\}\])')
|
s = scrapertools.find_single_match(data, 'sourcesCode\s*:\s*(\[\{.*?\}\])')
|
||||||
s = s.replace('src:', '"src":').replace('type:', '"type":').replace('label:', '"label":').replace('res:', '"res":')
|
s = s.replace('src:', '"src":').replace('file:', '"file":').replace('type:', '"type":').replace('label:', '"label":').replace('res:', '"res":')
|
||||||
try:
|
try:
|
||||||
data = jsontools.load(s)
|
data = jsontools.load(s)
|
||||||
for enlace in data:
|
for enlace in data:
|
||||||
if 'src' in enlace:
|
if 'src' in enlace or 'file' in enlace:
|
||||||
|
url = enlace['src'] if 'src' in enlace else enlace['file']
|
||||||
tit = ''
|
tit = ''
|
||||||
if 'label' in enlace: tit += '[%s]' % enlace['label']
|
if 'label' in enlace: tit += '[%s]' % enlace['label']
|
||||||
if 'res' in enlace: tit += '[%s]' % enlace['res']
|
if 'res' in enlace: tit += '[%s]' % enlace['res']
|
||||||
if tit == '' and 'type' in enlace: tit = enlace['type']
|
if tit == '' and 'type' in enlace: tit = enlace['type']
|
||||||
if tit == '': tit = '.mp4'
|
if tit == '': tit = '.mp4'
|
||||||
|
|
||||||
video_urls.append(["%s [vidoza]" % tit, enlace['src']])
|
video_urls.append(["%s [vidoza]" % tit, url])
|
||||||
except:
|
except:
|
||||||
logger.debug('No se detecta json %s' % s)
|
logger.debug('No se detecta json %s' % s)
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user