fixes
This commit is contained in:
Executable → Regular
+5
-3
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
from channelselector import get_thumb
|
||||||
from core import channeltools
|
from core import channeltools
|
||||||
from core import httptools
|
from core import httptools
|
||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
@@ -166,7 +166,8 @@ def findvideos(item):
|
|||||||
title="Ver %s en %s%s" % (
|
title="Ver %s en %s%s" % (
|
||||||
capitulo.strip(), s[0][2].capitalize(), idioma),
|
capitulo.strip(), s[0][2].capitalize(), idioma),
|
||||||
thumbnail2=item.thumbnail,
|
thumbnail2=item.thumbnail,
|
||||||
thumbnail=config.get_thumb("server_" + s[0][2] + ".png")))
|
thumbnail=get_thumb("server_" + s[0][2] + ".png"),
|
||||||
|
language = idioma))
|
||||||
else:
|
else:
|
||||||
import os
|
import os
|
||||||
for s in servertools.findvideos(data):
|
for s in servertools.findvideos(data):
|
||||||
@@ -174,7 +175,8 @@ def findvideos(item):
|
|||||||
title="Ver en %s%s" % (s[2].capitalize(), idioma),
|
title="Ver en %s%s" % (s[2].capitalize(), idioma),
|
||||||
thumbnail2=item.thumbnail,
|
thumbnail2=item.thumbnail,
|
||||||
thumbnail=os.path.join(config.get_runtime_path(), "resources", "media",
|
thumbnail=os.path.join(config.get_runtime_path(), "resources", "media",
|
||||||
"servers", "server_" + s[2] + ".png")))
|
"servers", "server_" + s[2] + ".png"),
|
||||||
|
language = idioma))
|
||||||
|
|
||||||
# Insertar items "Buscar trailer" y "Añadir a la videoteca"
|
# Insertar items "Buscar trailer" y "Añadir a la videoteca"
|
||||||
if itemlist and item.extra == "movie":
|
if itemlist and item.extra == "movie":
|
||||||
|
|||||||
Executable → Regular
+2
-2
@@ -348,7 +348,8 @@ def fichas(item):
|
|||||||
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
Item(channel=item.channel, action=action, title=title, url=url, fulltitle=title, thumbnail=thumbnail,
|
Item(channel=item.channel, action=action, title=title, url=url, fulltitle=title, thumbnail=thumbnail,
|
||||||
show=show, folder=True, contentType=contentType, contentTitle=contentTitle))
|
show=show, folder=True, contentType=contentType, contentTitle=contentTitle,
|
||||||
|
language =textoidiomas+'x'))
|
||||||
|
|
||||||
## Paginación
|
## Paginación
|
||||||
next_page_url = scrapertools.find_single_match(data, '<a href="([^"]+)">.raquo;</a>')
|
next_page_url = scrapertools.find_single_match(data, '<a href="([^"]+)">.raquo;</a>')
|
||||||
@@ -610,7 +611,6 @@ def findvideos(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
## Carga estados
|
## Carga estados
|
||||||
status = jsontools.load(httptools.downloadpage(host + '/a/status/all').data)
|
status = jsontools.load(httptools.downloadpage(host + '/a/status/all').data)
|
||||||
|
|
||||||
url_targets = item.url
|
url_targets = item.url
|
||||||
|
|
||||||
## Vídeos
|
## Vídeos
|
||||||
|
|||||||
Executable → Regular
+4
-2
@@ -352,7 +352,8 @@ def findvideos(item):
|
|||||||
if server == "Ul":
|
if server == "Ul":
|
||||||
server = "Uploaded"
|
server = "Uploaded"
|
||||||
title = "%s [%s][%s]" % (server, idioma, calidad)
|
title = "%s [%s][%s]" % (server, idioma, calidad)
|
||||||
itemlist.append(item.clone(action="play", title=title, url=url))
|
itemlist.append(item.clone(action="play", title=title, url=url, language = idioma, quality = calidad,
|
||||||
|
server = server))
|
||||||
|
|
||||||
patron = 'id="(embed[0-9]*)".*?<div class="calishow">(.*?)<.*?src="([^"]+)"'
|
patron = 'id="(embed[0-9]*)".*?<div class="calishow">(.*?)<.*?src="([^"]+)"'
|
||||||
matches = scrapertools.find_multiple_matches(data, patron)
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
@@ -362,7 +363,8 @@ def findvideos(item):
|
|||||||
title = "Directo"
|
title = "Directo"
|
||||||
idioma = scrapertools.find_single_match(data, 'href="#%s".*?>([^<]+)<' % id_embed)
|
idioma = scrapertools.find_single_match(data, 'href="#%s".*?>([^<]+)<' % id_embed)
|
||||||
title = "%s [%s][%s]" % (title.capitalize(), idioma, calidad)
|
title = "%s [%s][%s]" % (title.capitalize(), idioma, calidad)
|
||||||
itemlist.append(item.clone(action="play", title=title, url=url))
|
itemlist.append(item.clone(action="play", title=title, url=url, language = idioma, quality = calidad,
|
||||||
|
server = server))
|
||||||
|
|
||||||
if itemlist:
|
if itemlist:
|
||||||
if not config.get_setting('menu_trailer', item.channel):
|
if not config.get_setting('menu_trailer', item.channel):
|
||||||
|
|||||||
Executable → Regular
+4
-2
@@ -103,7 +103,8 @@ def entradas(item):
|
|||||||
filtro = {"poster_path": filtro_thumb}.items()
|
filtro = {"poster_path": filtro_thumb}.items()
|
||||||
itemlist.append(Item(channel=item.channel, action="findvideos", url=scrapedurl, title=titulo,
|
itemlist.append(Item(channel=item.channel, action="findvideos", url=scrapedurl, title=titulo,
|
||||||
contentTitle=scrapedtitle, infoLabels={'filtro': filtro}, text_color=color2,
|
contentTitle=scrapedtitle, infoLabels={'filtro': filtro}, text_color=color2,
|
||||||
thumbnail=scrapedthumbnail, contentType="movie", fulltitle=scrapedtitle))
|
thumbnail=scrapedthumbnail, contentType="movie", fulltitle=scrapedtitle, language =
|
||||||
|
idiomas))
|
||||||
|
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
||||||
if len(matches) > item.page + 20:
|
if len(matches) > item.page + 20:
|
||||||
@@ -233,7 +234,8 @@ def findvideos(item):
|
|||||||
if detalle:
|
if detalle:
|
||||||
title += " (%s)" % detalle
|
title += " (%s)" % detalle
|
||||||
|
|
||||||
itemlist.append(item.clone(action="play", url=url, title=title, server=servidor, text_color=color3))
|
itemlist.append(item.clone(action="play", url=url, title=title, server=servidor, text_color=color3,
|
||||||
|
language = idioma, quality = calidad))
|
||||||
|
|
||||||
if item.extra != "findvideos" and config.get_videolibrary_support():
|
if item.extra != "findvideos" and config.get_videolibrary_support():
|
||||||
itemlist.append(item.clone(title="Añadir película a la videoteca", action="add_pelicula_to_library",
|
itemlist.append(item.clone(title="Añadir película a la videoteca", action="add_pelicula_to_library",
|
||||||
|
|||||||
@@ -127,9 +127,12 @@ def findvideos(item):
|
|||||||
patron = '<tr><td> <a class="link_a" href="([^"]+)".*?<td> (.*?)</td><td> (.*?)</td><td> (.*?)</td>'
|
patron = '<tr><td> <a class="link_a" href="([^"]+)".*?<td> (.*?)</td><td> (.*?)</td><td> (.*?)</td>'
|
||||||
matches = scrapertools.find_multiple_matches(data, patron)
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
|
|
||||||
for url, server, idioma, calidad in matches:
|
for url, server, calidad, idioma in matches:
|
||||||
title = server + " [" + idioma + "] [" + calidad + "]"
|
title = item.contentTitle
|
||||||
itemlist.append(item.clone(action="play", title=title, fulltitle = item.title, url=url))
|
server = servertools.get_server_from_url(url)
|
||||||
|
|
||||||
|
itemlist.append(item.clone(action="play", title=title, fulltitle = item.title, url=url, language = idioma,
|
||||||
|
contentTitle = item.contentTitle, quality = calidad, server = server))
|
||||||
|
|
||||||
if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra !='findvideos' :
|
if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra !='findvideos' :
|
||||||
itemlist.append(Item(channel=item.channel, title='[COLOR yellow]Agregar esta pelicula a la Videoteca[/COLOR]',
|
itemlist.append(Item(channel=item.channel, title='[COLOR yellow]Agregar esta pelicula a la Videoteca[/COLOR]',
|
||||||
@@ -137,13 +140,14 @@ def findvideos(item):
|
|||||||
contentTitle = item.contentTitle))
|
contentTitle = item.contentTitle))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def play(item):
|
# def play(item):
|
||||||
logger.info()
|
# logger.info()
|
||||||
itemlist = servertools.find_video_items(data=item.url)
|
# itemlist = servertools.find_video_items(data=item.url)
|
||||||
|
#
|
||||||
for videoitem in itemlist:
|
# for videoitem in itemlist:
|
||||||
videoitem.title = item.title
|
# videoitem.title = item.title
|
||||||
videoitem.fulltitle = item.fulltitle
|
# videoitem.fulltitle = item.fulltitle
|
||||||
videoitem.thumbnail = item.thumbnail
|
# videoitem.thumbnail = item.thumbnail
|
||||||
videoitem.channel = item.channel
|
# videoitem.channel = item.channel
|
||||||
return itemlist
|
# videoitem.
|
||||||
|
# return itemlist
|
||||||
|
|||||||
Executable → Regular
+3
-3
@@ -153,10 +153,10 @@ def findvideos(item):
|
|||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
for servidor, idioma, calidad, scrapedurl in matches:
|
for servidor, idioma, calidad, scrapedurl in matches:
|
||||||
url = scrapedurl
|
url = scrapedurl
|
||||||
title = "Ver en " + servidor + " [" + idioma + "][" + calidad + "]"
|
server = servertools.get_server_name(servidor)
|
||||||
|
title = item.title
|
||||||
itemlist.append(Item(channel=item.channel, action="play", title=title, fulltitle=item.fulltitle, url=url,
|
itemlist.append(Item(channel=item.channel, action="play", title=title, fulltitle=item.fulltitle, url=url,
|
||||||
thumbnail=scrapedthumbnail, folder=False))
|
thumbnail=scrapedthumbnail, language=idioma, quality=calidad, server=server))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Executable → Regular
+26
-21
@@ -6,7 +6,9 @@ from core import scrapertools
|
|||||||
from core import servertools
|
from core import servertools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from core.scrapertools import decodeHtmlentities as dhe
|
from core.scrapertools import decodeHtmlentities as dhe
|
||||||
from platformcode import config, logger
|
from platformcode import logger
|
||||||
|
from platformcode import config
|
||||||
|
from core import tmdb
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import xbmc
|
import xbmc
|
||||||
@@ -172,7 +174,6 @@ def peliculas(item):
|
|||||||
patron += 'Calidad:(.*?)</br>.*?'
|
patron += 'Calidad:(.*?)</br>.*?'
|
||||||
patron += 'Género:.*?tag">(.*?)</a>'
|
patron += 'Género:.*?tag">(.*?)</a>'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
scrapertools.printMatches(matches)
|
|
||||||
|
|
||||||
for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedlenguaje, scrapedcalidad, scrapedgenero in matches:
|
for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedlenguaje, scrapedcalidad, scrapedgenero in matches:
|
||||||
|
|
||||||
@@ -184,20 +185,22 @@ def peliculas(item):
|
|||||||
scrapedtitle = re.sub(r"\(\d+\)", "", scrapedtitle).strip()
|
scrapedtitle = re.sub(r"\(\d+\)", "", scrapedtitle).strip()
|
||||||
scrapedcalidad = re.sub(r"<a href.*?>|</a>", "", scrapedcalidad).strip()
|
scrapedcalidad = re.sub(r"<a href.*?>|</a>", "", scrapedcalidad).strip()
|
||||||
scrapedlenguaje = re.sub(r"<a href.*?>|</a>", "", scrapedlenguaje).strip()
|
scrapedlenguaje = re.sub(r"<a href.*?>|</a>", "", scrapedlenguaje).strip()
|
||||||
scrapedcalidad = scrapedcalidad.replace(scrapedcalidad,
|
scrapedlenguaje = scrapedlenguaje.split(',')
|
||||||
bbcode_kodi2html("[COLOR orange]" + scrapedcalidad + "[/COLOR]"))
|
|
||||||
|
|
||||||
if not "Adultos" in scrapedgenero and not "Adultos" in scrapedlenguaje and not "Adultos" in scrapedcalidad:
|
if not "Adultos" in scrapedgenero and not "Adultos" in scrapedlenguaje and not "Adultos" in scrapedcalidad:
|
||||||
scrapedlenguaje = scrapedlenguaje.replace(scrapedlenguaje,
|
|
||||||
bbcode_kodi2html("[COLOR orange]" + scrapedlenguaje + "[/COLOR]"))
|
|
||||||
|
|
||||||
scrapedtitle = scrapedtitle + "-(Idioma: " + scrapedlenguaje + ")" + "-(Calidad: " + scrapedcalidad + ")"
|
scrapedtitle = scrapedtitle
|
||||||
scrapedtitle = scrapedtitle.replace(scrapedtitle,
|
|
||||||
bbcode_kodi2html("[COLOR white]" + scrapedtitle + "[/COLOR]"))
|
|
||||||
extra = year + "|" + title_fan
|
extra = year + "|" + title_fan
|
||||||
itemlist.append(Item(channel=item.channel, title=scrapedtitle, url=scrapedurl, action="fanart",
|
new_item = Item(channel=item.channel, title=scrapedtitle, url=scrapedurl, action="fanart",
|
||||||
thumbnail=scrapedthumbnail, extra=extra,
|
thumbnail=scrapedthumbnail, extra=extra,
|
||||||
fanart="http://s18.postimg.org/h9kb22mnt/pdkfanart.jpg", library=True, folder=True))
|
fanart="http://s18.postimg.org/h9kb22mnt/pdkfanart.jpg", library=True, folder=True,
|
||||||
|
language=scrapedlenguaje, quality=scrapedcalidad, contentTitle= scrapedtitle, infoLabels={
|
||||||
|
'year':year})
|
||||||
|
#TODO Dividir los resultados antes
|
||||||
|
#if year:
|
||||||
|
# tmdb.set_infoLabels_item(new_item)
|
||||||
|
itemlist.append(new_item)
|
||||||
|
|
||||||
## Paginación
|
## Paginación
|
||||||
|
|
||||||
next_page = scrapertools.get_match(data, '<span class="current">.*?<a href="(.*?)".*?>Siguiente »</a></div>')
|
next_page = scrapertools.get_match(data, '<span class="current">.*?<a href="(.*?)".*?>Siguiente »</a></div>')
|
||||||
@@ -453,7 +456,7 @@ def fanart(item):
|
|||||||
else:
|
else:
|
||||||
category = item.extra
|
category = item.extra
|
||||||
itemlist.append(Item(channel=item.channel, title=item.title, action="findvideos", url=item.url,
|
itemlist.append(Item(channel=item.channel, title=item.title, action="findvideos", url=item.url,
|
||||||
server="torrent", thumbnail=logo, fanart=item.extra, extra=extra, show=show,
|
thumbnail=logo, fanart=item.extra, extra=extra, show=show,
|
||||||
category=category, library=item.library, fulltitle=fulltitle, folder=True))
|
category=category, library=item.library, fulltitle=fulltitle, folder=True))
|
||||||
|
|
||||||
title_info = "Info"
|
title_info = "Info"
|
||||||
@@ -540,17 +543,19 @@ def findvideos(item):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
servertitle = scrapertools.get_match(video_url, 'http.*?://(.*?)/')
|
servertitle = scrapertools.get_match(video_url, 'http.*?://(.*?)/')
|
||||||
servertitle = servertitle.replace(servertitle,
|
|
||||||
bbcode_kodi2html("[COLOR red]" + servertitle + "[/COLOR]"))
|
|
||||||
servertitle = servertitle.replace("embed.", "")
|
servertitle = servertitle.replace("embed.", "")
|
||||||
servertitle = servertitle.replace("player.", "")
|
servertitle = servertitle.replace("player.", "")
|
||||||
servertitle = servertitle.replace("api.video.", "")
|
servertitle = servertitle.replace("api.video.", "")
|
||||||
servertitle = re.sub(r"hqq.tv|hqq.watch", "netu.tv", servertitle)
|
servertitle = re.sub(r"hqq.tv|hqq.watch", "netutv", servertitle)
|
||||||
servertitle = servertitle.replace("anonymouse.org", "netu.tv")
|
servertitle = servertitle.replace("anonymouse.org", "netu")
|
||||||
title = bbcode_kodi2html("[COLOR orange]Ver en --[/COLOR]") + servertitle + " " + idioma + " " + calidad
|
title = servertitle
|
||||||
|
logger.debug('servertitle: %s' % servertitle)
|
||||||
|
server = servertools.get_server_name(servertitle)
|
||||||
|
logger.debug('server: %s'%server)
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
Item(channel=item.channel, title=title, url=video_url, action="play", thumbnail=item.category,
|
Item(channel=item.channel, title=title, url=video_url, action="play",
|
||||||
plot=scrapedplot, fanart=item.show))
|
thumbnail=item.category,
|
||||||
|
plot=scrapedplot, fanart=item.show, server=server, language=idioma, quality=calidad))
|
||||||
if item.library and config.get_videolibrary_support() and len(itemlist) > 0:
|
if item.library and config.get_videolibrary_support() and len(itemlist) > 0:
|
||||||
infoLabels = {'tmdb_id': item.infoLabels['tmdb_id'],
|
infoLabels = {'tmdb_id': item.infoLabels['tmdb_id'],
|
||||||
'title': item.fulltitle}
|
'title': item.fulltitle}
|
||||||
|
|||||||
Executable → Regular
+14
-40
@@ -34,7 +34,7 @@ CALIDADES = {"micro1080p": "[COLOR plum]Micro1080p[/COLOR]", "dvds": "[COLOR lim
|
|||||||
"hdtv-rip": "[COLOR black]Hdtv-rip[/COLOR]", "micro720p": "[COLOR yellow]Micro720p[/COLOR]",
|
"hdtv-rip": "[COLOR black]Hdtv-rip[/COLOR]", "micro720p": "[COLOR yellow]Micro720p[/COLOR]",
|
||||||
"ts-hq": "[COLOR mediumspringgreen]Ts-Hq[/COLOR]", "camrip": "[COLOR royalblue]Camp-Rip[/COLOR]",
|
"ts-hq": "[COLOR mediumspringgreen]Ts-Hq[/COLOR]", "camrip": "[COLOR royalblue]Camp-Rip[/COLOR]",
|
||||||
"webs": "[COLOR lightsalmon]Webs[/COLOR]", "hd": "[COLOR mediumseagreen]HD[/COLOR]"}
|
"webs": "[COLOR lightsalmon]Webs[/COLOR]", "hd": "[COLOR mediumseagreen]HD[/COLOR]"}
|
||||||
IDIOMAS = {"castellano": "[COLOR yellow]Castelllano[/COLOR]", "latino": "[COLOR orange]Latino[/COLOR]",
|
IDIOMAS = {"castellano": "[COLOR yellow]Castellano[/COLOR]", "latino": "[COLOR orange]Latino[/COLOR]",
|
||||||
"vose": "[COLOR lightsalmon]Subtitulada[/COLOR]", "vo": "[COLOR crimson]Ingles[/COLOR]",
|
"vose": "[COLOR lightsalmon]Subtitulada[/COLOR]", "vo": "[COLOR crimson]Ingles[/COLOR]",
|
||||||
"en": "[COLOR crimson]Ingles[/COLOR]"}
|
"en": "[COLOR crimson]Ingles[/COLOR]"}
|
||||||
IDIOMASP = {"es": "[COLOR yellow]CAST[/COLOR]", "la": "[COLOR orange]LAT[/COLOR]",
|
IDIOMASP = {"es": "[COLOR yellow]CAST[/COLOR]", "la": "[COLOR orange]LAT[/COLOR]",
|
||||||
@@ -147,10 +147,13 @@ def scraper(item):
|
|||||||
matches = scrapertools.find_multiple_matches(bloque_enlaces,
|
matches = scrapertools.find_multiple_matches(bloque_enlaces,
|
||||||
'<a class="i" href="([^"]+)".*?src="([^"]+)".*?">([^<]+)<.*?<div class="l">(.*?)<\/a><h3>.*?title[^<]+>([^<]+)<\/a><\/h3> <span>(.*?)<')
|
'<a class="i" href="([^"]+)".*?src="([^"]+)".*?">([^<]+)<.*?<div class="l">(.*?)<\/a><h3>.*?title[^<]+>([^<]+)<\/a><\/h3> <span>(.*?)<')
|
||||||
for url, thumb, quality, check_idioma, title, check_year in matches:
|
for url, thumb, quality, check_idioma, title, check_year in matches:
|
||||||
|
|
||||||
|
logger.debug('check_idioma: %s' % check_idioma)
|
||||||
title_fan = title
|
title_fan = title
|
||||||
title_item = "[COLOR cornflowerblue][B]" + title + "[/B][/COLOR]"
|
title_item = "[COLOR cornflowerblue][B]" + title + "[/B][/COLOR]"
|
||||||
if item.contentType != "movie":
|
if item.contentType != "movie":
|
||||||
title = "[COLOR cornflowerblue][B]" + title + "[/B][/COLOR]"
|
title = title
|
||||||
|
idiomas = ''
|
||||||
else:
|
else:
|
||||||
if quality == "ts":
|
if quality == "ts":
|
||||||
quality = re.sub(r'ts', 'ts-hq', quality)
|
quality = re.sub(r'ts', 'ts-hq', quality)
|
||||||
@@ -158,37 +161,14 @@ def scraper(item):
|
|||||||
quality = CALIDADES.get(quality)
|
quality = CALIDADES.get(quality)
|
||||||
else:
|
else:
|
||||||
quality = quality
|
quality = quality
|
||||||
idiomas = scrapertools.find_multiple_matches(check_idioma, '<div class="id (.*?)">')
|
|
||||||
if len(idiomas) == 1:
|
|
||||||
idioma1 = idiomas[0].strip()
|
|
||||||
if IDIOMASP.get(idioma1):
|
|
||||||
idiomas = "-" + IDIOMASP.get(idioma1)
|
|
||||||
elif len(idiomas) == 2:
|
|
||||||
idioma1, idioma2 = idiomas[0], idiomas[1]
|
|
||||||
if IDIOMASP.get(idioma1, idioma2):
|
|
||||||
idioma1 = IDIOMASP.get(idioma1)
|
|
||||||
idioma2 = IDIOMASP.get(idioma2)
|
|
||||||
idiomas = "-" + idioma1 + "|" + idioma2
|
|
||||||
elif len(idiomas) == 3:
|
|
||||||
idioma1, idioma2, idioma3 = idiomas[0], idiomas[1], idiomas[2]
|
|
||||||
idioma1 = IDIOMASP.get(idioma1)
|
|
||||||
idioma2 = IDIOMASP.get(idioma2)
|
|
||||||
idioma3 = IDIOMASP.get(idioma3)
|
|
||||||
idiomas = "-" + idioma1 + "|" + idioma2 + "|" + idioma3
|
|
||||||
elif len(idiomas) >= 4:
|
|
||||||
idioma1, idioma2, idioma3, idioma4 = idiomas[0], idiomas[1], idiomas[2], idiomas[3]
|
|
||||||
idioma1 = IDIOMASP.get(idioma1)
|
|
||||||
idioma2 = IDIOMASP.get(idioma2)
|
|
||||||
idioma3 = IDIOMASP.get(idioma3)
|
|
||||||
idioma4 = IDIOMASP.get(idioma4)
|
|
||||||
idiomas = "-" + idioma1 + "|" + idioma2 + "|" + idioma3 + "|" + idioma4
|
|
||||||
|
|
||||||
title = "[COLOR cornflowerblue][B]" + title + "[/B][/COLOR]" + " " + quality + " " + idiomas
|
idiomas = scrapertools.find_multiple_matches(check_idioma, '<div class="id (.*?)">')
|
||||||
|
title = title
|
||||||
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
Item(channel=item.channel, title=title, url=urlparse.urljoin(host, url), action="fanart", thumbnail=thumb,
|
Item(channel=item.channel, title=title, url=urlparse.urljoin(host, url), action="fanart", thumbnail=thumb,
|
||||||
fanart="http://imgur.com/nqmJozd.jpg", extra=title_fan + "|" + title_item + "|" + check_year.strip(),
|
fanart="http://imgur.com/nqmJozd.jpg", extra=title_fan + "|" + title_item + "|" + check_year.strip(),
|
||||||
contentType=item.contentType, folder=True))
|
contentType=item.contentType, folder=True, language = idiomas))
|
||||||
## Paginación
|
## Paginación
|
||||||
if check_year:
|
if check_year:
|
||||||
next = scrapertools.find_single_match(data, 'href="([^"]+)" title="Siguiente página">')
|
next = scrapertools.find_single_match(data, 'href="([^"]+)" title="Siguiente página">')
|
||||||
@@ -631,20 +611,14 @@ def findvideos(item):
|
|||||||
icon_server = icon_server.replace('streamin', 'streaminto')
|
icon_server = icon_server.replace('streamin', 'streaminto')
|
||||||
if not os.path.exists(icon_server):
|
if not os.path.exists(icon_server):
|
||||||
icon_server = thumb
|
icon_server = thumb
|
||||||
if CALIDADES.get(calidad):
|
#calidad = calidad
|
||||||
calidad = CALIDADES.get(calidad)
|
#idioma = idioma
|
||||||
else:
|
server = servertools.get_server_name(server_name)
|
||||||
calidad = "[COLOR brown]" + calidad + "[/COLOR]"
|
|
||||||
if IDIOMAS.get(idioma):
|
|
||||||
idioma = IDIOMAS.get(idioma)
|
|
||||||
else:
|
|
||||||
idioma = "[COLOR brown]" + idioma + "[/COLOR]"
|
|
||||||
|
|
||||||
extra = "online"
|
extra = "online"
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
title="[COLOR lightcyan][B]" + server + "[/B][/COLOR] " + calidad + " " + idioma,
|
title="server", url=url, action="play", fanart="",
|
||||||
url=url, action="play", thumbnail=icon_server, fanart="", contentType=item.contentType,
|
contentType=item.contentType, folder=True, id=url_post, language=idioma,
|
||||||
folder=True, id=url_post))
|
quality=calidad, server = server))
|
||||||
else:
|
else:
|
||||||
bloque_dd = scrapertools.find_single_match(data, '<\/i>Descargar(.*?)<div class="enlaces">')
|
bloque_dd = scrapertools.find_single_match(data, '<\/i>Descargar(.*?)<div class="enlaces">')
|
||||||
links_dd = scrapertools.find_multiple_matches(bloque_dd,
|
links_dd = scrapertools.find_multiple_matches(bloque_dd,
|
||||||
|
|||||||
Executable → Regular
+17
-11
@@ -4,10 +4,14 @@ import re
|
|||||||
import urlparse
|
import urlparse
|
||||||
|
|
||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
|
from core import httptools
|
||||||
|
from core import tmdb
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
|
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
@@ -25,8 +29,8 @@ def generos(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
# Descarga la página
|
# Descarga la página
|
||||||
data = scrapertools.cachePage(item.url)
|
data = httptools.downloadpage(item.url).data
|
||||||
|
logger.debug(data)
|
||||||
# <li class="cat-item cat-item-3"><a href="http://peliculasmx.net/category/accion/" >Accion</a> <span>246</span>
|
# <li class="cat-item cat-item-3"><a href="http://peliculasmx.net/category/accion/" >Accion</a> <span>246</span>
|
||||||
patron = '<li class="cat-item cat-item-.*?'
|
patron = '<li class="cat-item cat-item-.*?'
|
||||||
patron += '<a href="([^"]+)".*?'
|
patron += '<a href="([^"]+)".*?'
|
||||||
@@ -51,24 +55,26 @@ def peliculas(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
# Descarga la página
|
# Descarga la página
|
||||||
data = scrapertools.cachePage(item.url)
|
data = httptools.downloadpage(item.url).data
|
||||||
|
|
||||||
patron = '<div id="mt-.*?'
|
patron = '<div id="mt-.*?'
|
||||||
patron += '<a href="([^"]+)".*?'
|
patron += '<a href="([^"]+)".*?'
|
||||||
patron += '<img src="([^"]+)".*?'
|
patron += '<img src="([^"]+)".*?'
|
||||||
patron += '<span class="tt">([^<]+).*?'
|
patron += '<span class="tt">([^<]+).*?'
|
||||||
|
patron += '<span class="year">(\d{4})</span>.*?'
|
||||||
patron += '<span class="calidad2">([^<]+)'
|
patron += '<span class="calidad2">([^<]+)'
|
||||||
|
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
for match in matches:
|
for scrapedurl, scrapedthumbnail, scrapedtitle, year, quality in matches:
|
||||||
scrapedurl = match[0] # urlparse.urljoin("",match[0])
|
url =scrapedurl
|
||||||
scrapedtitle = match[2] + ' [' + match[3] + ']'
|
title = scrapedtitle
|
||||||
scrapedthumbnail = match[1]
|
thumbnail = scrapedthumbnail
|
||||||
itemlist.append(
|
|
||||||
Item(channel=item.channel, action="findvideos", title=scrapedtitle, fulltitle=scrapedtitle, url=scrapedurl,
|
|
||||||
thumbnail=scrapedthumbnail, folder=True))
|
|
||||||
|
|
||||||
|
itemlist.append(
|
||||||
|
Item(channel=item.channel, action="findvideos", title=title, contentTitle=title, url=url,
|
||||||
|
thumbnail=thumbnail, quality=quality, infoLabels={'year':year}))
|
||||||
|
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
# Extrae la marca de siguiente página
|
# Extrae la marca de siguiente página
|
||||||
paginador = scrapertools.find_single_match(data, "<div class='paginado'>.*?lateral")
|
paginador = scrapertools.find_single_match(data, "<div class='paginado'>.*?lateral")
|
||||||
|
|
||||||
|
|||||||
Executable → Regular
+5
-3
@@ -124,7 +124,8 @@ def entradas(item):
|
|||||||
infolabels = {'year': year}
|
infolabels = {'year': year}
|
||||||
itemlist.append(Item(channel=item.channel, action="findvideos", url=scrapedurl, title=titulo,
|
itemlist.append(Item(channel=item.channel, action="findvideos", url=scrapedurl, title=titulo,
|
||||||
contentTitle=scrapedtitle, infoLabels=infolabels, text_color=color2,
|
contentTitle=scrapedtitle, infoLabels=infolabels, text_color=color2,
|
||||||
thumbnail=scrapedthumbnail, contentType="movie", fulltitle=scrapedtitle))
|
thumbnail=scrapedthumbnail, contentType="movie", fulltitle=scrapedtitle,
|
||||||
|
language=idiomas, quality=calidad))
|
||||||
|
|
||||||
if not item.from_newest:
|
if not item.from_newest:
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
||||||
@@ -214,12 +215,13 @@ def findvideos(item):
|
|||||||
url = url + '|' + item.url
|
url = url + '|' + item.url
|
||||||
|
|
||||||
title = "%s - %s" % ('%s', title)
|
title = "%s - %s" % ('%s', title)
|
||||||
itemlist.append(item.clone(action="play", url=url, title=title, text_color=color3))
|
itemlist.append(Item (channel=item.channel, action="play", url=url, title=title, text_color=color3))
|
||||||
|
|
||||||
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
||||||
|
|
||||||
if item.extra != "findvideos" and config.get_videolibrary_support():
|
if item.extra != "findvideos" and config.get_videolibrary_support():
|
||||||
itemlist.append(item.clone(title="Añadir película a la videoteca", action="add_pelicula_to_library",
|
itemlist.append(Item (channel=item.channel, title="Añadir película a la videoteca", \
|
||||||
|
action="add_pelicula_to_library",
|
||||||
extra="findvideos", text_color="green"))
|
extra="findvideos", text_color="green"))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
Reference in New Issue
Block a user