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