Corrección vidoza y platformtools
This commit is contained in:
@@ -127,13 +127,12 @@ def render_items(itemlist, parent_item):
|
||||
if 'anime' in channeltools.get_channel_parameters(parent_item.channel)['categories']:
|
||||
anime = True
|
||||
|
||||
# Recorremos el itemlist
|
||||
|
||||
unify_enabled = config.get_setting('unify')
|
||||
#logger.debug('unify_enabled: %s' % unify_enabled)
|
||||
|
||||
# Recorremos el itemlist
|
||||
for item in itemlist:
|
||||
try:
|
||||
channel_parameters = channeltools.get_channel_parameters(item.channel)
|
||||
except:
|
||||
pass
|
||||
#logger.debug(item)
|
||||
# Si el item no contiene categoria, le ponemos la del item padre
|
||||
if item.category == "":
|
||||
@@ -143,9 +142,7 @@ def render_items(itemlist, parent_item):
|
||||
if item.fanart == "":
|
||||
item.fanart = parent_item.fanart
|
||||
|
||||
|
||||
if genre:
|
||||
|
||||
valid_genre = True
|
||||
thumb = get_thumb(item.title, auto=True)
|
||||
if thumb != '':
|
||||
@@ -155,12 +152,7 @@ def render_items(itemlist, parent_item):
|
||||
valid_genre = True
|
||||
|
||||
|
||||
unify_enabled = config.get_setting('unify')
|
||||
|
||||
#logger.debug('unify_enabled: %s' % unify_enabled)
|
||||
|
||||
|
||||
if unify_enabled and not channel_parameters['adult'] and 'skip_unify' not in channel_parameters:
|
||||
if unify_enabled:
|
||||
# Formatear titulo con unify
|
||||
item = unify.title_format(item)
|
||||
else:
|
||||
|
||||
@@ -20,13 +20,24 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
data = httptools.downloadpage(page_url).data
|
||||
video_urls = []
|
||||
matches = scrapertools.find_multiple_matches(data, 'src\s*:\s*"([^"]+)".*?label:\'([^\']+)\'')
|
||||
for media_url, calidad in matches:
|
||||
ext = media_url[-4:]
|
||||
video_urls.append(["%s %s [vidoza]" % (ext, calidad), media_url])
|
||||
|
||||
s = scrapertools.find_single_match(data, 'sourcesCode\s*:\s*(\[\{.*?\}\])')
|
||||
s = s.replace('src:', '"src":').replace('type:', '"type":').replace('label:', '"label":').replace('res:', '"res":')
|
||||
try:
|
||||
data = json.loads(str(s))
|
||||
for enlace in data:
|
||||
if 'src' in enlace:
|
||||
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']])
|
||||
except:
|
||||
logger.debug('No se detecta json %s' % s)
|
||||
pass
|
||||
|
||||
video_urls.reverse()
|
||||
for video_url in video_urls:
|
||||
logger.info("%s - %s" % (video_url[0], video_url[1]))
|
||||
|
||||
return video_urls
|
||||
|
||||
Reference in New Issue
Block a user