Vidoza, detectar tb file:

This commit is contained in:
pipcat
2018-07-22 12:45:35 +02:00
parent 2f973a75eb
commit 31bbe6aa48

View File

@@ -23,18 +23,19 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
video_urls = []
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:
data = jsontools.load(s)
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 = ''
if 'label' in enlace: tit += '[%s]' % enlace['label']
if 'res' in enlace: tit += '[%s]' % enlace['res']
if tit == '' and 'type' in enlace: tit = enlace['type']
if tit == '': tit = '.mp4'
video_urls.append(["%s [vidoza]" % tit, enlace['src']])
video_urls.append(["%s [vidoza]" % tit, url])
except:
logger.debug('No se detecta json %s' % s)
pass