seriespapaya corregido
This commit is contained in:
Executable → Regular
+18
-12
@@ -57,7 +57,7 @@ def submenu(item):
|
|||||||
data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url).data)
|
data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url).data)
|
||||||
data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8")
|
data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8")
|
||||||
|
|
||||||
patron = '<li><a href="http://www.newpct1.com/' + item.extra + '/">.*?<ul>(.*?)</ul>'
|
patron = '<li><a href="http://(?:www.)?newpct1.com/' + item.extra + '/">.*?<ul>(.*?)</ul>'
|
||||||
data = scrapertools.get_match(data, patron)
|
data = scrapertools.get_match(data, patron)
|
||||||
|
|
||||||
patron = '<a href="([^"]+)".*?>([^>]+)</a>'
|
patron = '<a href="([^"]+)".*?>([^>]+)</a>'
|
||||||
@@ -126,7 +126,6 @@ def listado(item):
|
|||||||
if "1.com/series" in url:
|
if "1.com/series" in url:
|
||||||
action = "completo"
|
action = "completo"
|
||||||
extra = "serie"
|
extra = "serie"
|
||||||
context = "tvshow"
|
|
||||||
|
|
||||||
title = scrapertools.find_single_match(title, '([^-]+)')
|
title = scrapertools.find_single_match(title, '([^-]+)')
|
||||||
title = title.replace("Ver online", "", 1).replace("Descarga Serie HD", "", 1).replace("Ver en linea", "",
|
title = title.replace("Ver online", "", 1).replace("Descarga Serie HD", "", 1).replace("Ver en linea", "",
|
||||||
@@ -150,26 +149,27 @@ def listado(item):
|
|||||||
|
|
||||||
url += '&idioma=&ordenar=Nombre&inon=Descendente'
|
url += '&idioma=&ordenar=Nombre&inon=Descendente'
|
||||||
'''
|
'''
|
||||||
show = title
|
|
||||||
else:
|
else:
|
||||||
title = title.replace("Descargar", "", 1).strip()
|
title = title.replace("Descargar", "", 1).strip()
|
||||||
if title.endswith("gratis"): title = title[:-7]
|
if title.endswith("gratis"): title = title[:-7]
|
||||||
show = ""
|
|
||||||
context = "movie"
|
|
||||||
|
|
||||||
|
show = title
|
||||||
|
if item.extra != "buscar-list":
|
||||||
|
title = title + ' ' + calidad
|
||||||
|
|
||||||
|
context = ""
|
||||||
context_title = scrapertools.find_single_match(url, "http://www.newpct1.com/(.*?)/(.*?)/")
|
context_title = scrapertools.find_single_match(url, "http://www.newpct1.com/(.*?)/(.*?)/")
|
||||||
if context_title:
|
if context_title:
|
||||||
try:
|
try:
|
||||||
|
context = context_title[0].replace("pelicula", "movie").replace("descargar", "movie").replace("series",
|
||||||
|
"tvshow")
|
||||||
context_title = context_title[1].replace("-", " ")
|
context_title = context_title[1].replace("-", " ")
|
||||||
if re.search('\d{4}', context_title[-4:]):
|
if re.search('\d{4}', context_title[-4:]):
|
||||||
context_title = context_title[:-4]
|
context_title = context_title[:-4]
|
||||||
elif re.search('\(\d{4}\)', context_title[-6:]):
|
elif re.search('\(\d{4}\)', context_title[-6:]):
|
||||||
context_title = context_title[:-6]
|
context_title = context_title[:-6]
|
||||||
except:
|
except:
|
||||||
context_title = title
|
context_title = show
|
||||||
|
|
||||||
if item.extra != "buscar-list":
|
|
||||||
title = title + ' ' + calidad
|
|
||||||
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
Item(channel=item.channel, action=action, title=title, url=url, thumbnail=thumbnail, extra=extra, show=show,
|
Item(channel=item.channel, action=action, title=title, url=url, thumbnail=thumbnail, extra=extra, show=show,
|
||||||
@@ -269,7 +269,7 @@ def completo(item):
|
|||||||
salir = True
|
salir = True
|
||||||
|
|
||||||
if (config.get_videolibrary_support() and len(itemlist) > 0 and item.extra.startswith("serie")):
|
if (config.get_videolibrary_support() and len(itemlist) > 0 and item.extra.startswith("serie")):
|
||||||
itemlist.append(Item(channel=item.channel, title="Añadir esta serie a la videoteca", url=item.url,
|
itemlist.append(Item(channel=item.channel, title="Añadir esta serie a la biblioteca", url=item.url,
|
||||||
action="add_serie_to_library", extra="completo###serie_add", show=item.show))
|
action="add_serie_to_library", extra="completo###serie_add", show=item.show))
|
||||||
logger.debug("items=" + str(len(itemlist)))
|
logger.debug("items=" + str(len(itemlist)))
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -447,7 +447,10 @@ def findvideos(item):
|
|||||||
for logo, servidor, idioma, calidad, enlace, titulo in enlaces_ver:
|
for logo, servidor, idioma, calidad, enlace, titulo in enlaces_ver:
|
||||||
servidor = servidor.replace("streamin", "streaminto")
|
servidor = servidor.replace("streamin", "streaminto")
|
||||||
titulo = titulo + " [" + servidor + "]"
|
titulo = titulo + " [" + servidor + "]"
|
||||||
if servertools.is_server_enabled(servidor):
|
mostrar_server = True
|
||||||
|
if config.get_setting("hidepremium") == "true":
|
||||||
|
mostrar_server = servertools.is_server_enabled(servidor)
|
||||||
|
if mostrar_server:
|
||||||
try:
|
try:
|
||||||
servers_module = __import__("servers." + servidor)
|
servers_module = __import__("servers." + servidor)
|
||||||
server_module = getattr(servers_module, servidor)
|
server_module = getattr(servers_module, servidor)
|
||||||
@@ -467,7 +470,10 @@ def findvideos(item):
|
|||||||
for enlace in partes:
|
for enlace in partes:
|
||||||
parte_titulo = titulo + " (%s/%s)" % (p, len(partes)) + " [" + servidor + "]"
|
parte_titulo = titulo + " (%s/%s)" % (p, len(partes)) + " [" + servidor + "]"
|
||||||
p += 1
|
p += 1
|
||||||
if servertools.is_server_enabled(servidor):
|
mostrar_server = True
|
||||||
|
if config.get_setting("hidepremium") == "true":
|
||||||
|
mostrar_server = servertools.is_server_enabled(servidor)
|
||||||
|
if mostrar_server:
|
||||||
try:
|
try:
|
||||||
servers_module = __import__("servers." + servidor)
|
servers_module = __import__("servers." + servidor)
|
||||||
server_module = getattr(servers_module, servidor)
|
server_module = getattr(servers_module, servidor)
|
||||||
|
|||||||
Executable → Regular
+23
-24
@@ -6,7 +6,6 @@ import urllib
|
|||||||
import urlparse
|
import urlparse
|
||||||
|
|
||||||
from channels import filtertools
|
from channels import filtertools
|
||||||
from channelselector import get_thumb
|
|
||||||
from core import config
|
from core import config
|
||||||
from core import httptools
|
from core import httptools
|
||||||
from core import jsontools
|
from core import jsontools
|
||||||
@@ -25,9 +24,9 @@ CALIDADES = ['360p', '480p', '720p HD', '1080p HD']
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
thumb_series = get_thumb("thumb_channels_tvshow.png")
|
thumb_series = config.get_thumb("thumb_channels_tvshow.png")
|
||||||
thumb_series_az = get_thumb("thumb_channels_tvshow_az.png")
|
thumb_series_az = config.get_thumb("thumb_channels_tvshow_az.png")
|
||||||
thumb_buscar = get_thumb("thumb_search.png")
|
thumb_buscar = config.get_thumb("thumb_search.png")
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
@@ -52,22 +51,22 @@ def listado_alfabetico(item):
|
|||||||
|
|
||||||
|
|
||||||
def series_por_letra(item):
|
def series_por_letra(item):
|
||||||
logger.info("letra: {0}".format(item.title))
|
logger.info("letra: %s" % item.title)
|
||||||
item.letter = item.title.lower()
|
item.letter = item.title.lower()
|
||||||
item.extra = 0
|
item.extra = 0
|
||||||
return series_por_letra_y_grupo(item)
|
return series_por_letra_y_grupo(item)
|
||||||
|
|
||||||
|
|
||||||
def series_por_letra_y_grupo(item):
|
def series_por_letra_y_grupo(item):
|
||||||
logger.info("letra: {0} - grupo: {1}".format(item.letter, item.extra))
|
logger.info("letra: %s - grupo: %s" % (item.letter, item.extra))
|
||||||
itemlist = []
|
itemlist = []
|
||||||
url = urlparse.urljoin(HOST, "autoload_process.php")
|
url = urlparse.urljoin(HOST, "autoload_process.php")
|
||||||
|
|
||||||
postRequest = {
|
post_request = {
|
||||||
"group_no": item.extra,
|
"group_no": item.extra,
|
||||||
"letra": item.letter.lower()
|
"letra": item.letter.lower()
|
||||||
}
|
}
|
||||||
data = httptools.downloadpage(url, post=urllib.urlencode(postRequest)).data
|
data = httptools.downloadpage(url, post=urllib.urlencode(post_request)).data
|
||||||
|
|
||||||
series = re.findall(
|
series = re.findall(
|
||||||
'list_imagen.+?src="(?P<img>[^"]+).+?<div class="list_titulo"><a[^>]+href="(?P<url>[^"]+)[^>]+>(.*?)</a>', data,
|
'list_imagen.+?src="(?P<img>[^"]+).+?<div class="list_titulo"><a[^>]+href="(?P<url>[^"]+)[^>]+>(.*?)</a>', data,
|
||||||
@@ -107,7 +106,7 @@ def novedades(item):
|
|||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(categoria):
|
||||||
logger.info("categoria: {0}".format(categoria))
|
logger.info("categoria: %s" % categoria)
|
||||||
|
|
||||||
if categoria != 'series':
|
if categoria != 'series':
|
||||||
return []
|
return []
|
||||||
@@ -119,13 +118,13 @@ def newest(categoria):
|
|||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
logger.error("{0}".format(line))
|
logger.error("%s" % line)
|
||||||
|
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
logger.info("url: {0}".format(item.url))
|
logger.info("url: %s" % item.url)
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
|
|
||||||
@@ -136,15 +135,15 @@ def episodios(item):
|
|||||||
for url, title, langs in episodes:
|
for url, title, langs in episodes:
|
||||||
logger.debug("langs %s" % langs)
|
logger.debug("langs %s" % langs)
|
||||||
languages = " ".join(
|
languages = " ".join(
|
||||||
["[{0}]".format(IDIOMAS.get(lang, lang)) for lang in re.findall('images/s-([^\.]+)', langs)])
|
["[%s]" % IDIOMAS.get(lang, lang) for lang in re.findall('images/s-([^\.]+)', langs)])
|
||||||
filter_lang = languages.replace("[", "").replace("]", "").split(" ")
|
filter_lang = languages.replace("[", "").replace("]", "").split(" ")
|
||||||
itemlist.append(item.clone(action="findvideos",
|
itemlist.append(item.clone(action="findvideos",
|
||||||
title="{0} {1} {2}".format(item.title, title, languages),
|
title="%s %s %s" % (item.title, title, languages),
|
||||||
url=urlparse.urljoin(HOST, url),
|
url=urlparse.urljoin(HOST, url),
|
||||||
language=filter_lang
|
language=filter_lang
|
||||||
))
|
))
|
||||||
|
|
||||||
itemlist = filtertools.get_links(itemlist, item.channel, list_idiomas, CALIDADES)
|
itemlist = filtertools.get_links(itemlist, item, list_idiomas, CALIDADES)
|
||||||
|
|
||||||
# Opción "Añadir esta serie a la videoteca de XBMC"
|
# Opción "Añadir esta serie a la videoteca de XBMC"
|
||||||
if config.get_videolibrary_support() and len(itemlist) > 0:
|
if config.get_videolibrary_support() and len(itemlist) > 0:
|
||||||
@@ -155,10 +154,10 @@ def episodios(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
logger.info("texto: {0}".format(texto))
|
logger.info("texto: %s" % texto)
|
||||||
data = httptools.downloadpage(urlparse.urljoin(HOST, "/buscar.php?term={0}".format(texto))).data
|
data = httptools.downloadpage(urlparse.urljoin(HOST, "/buscar.php?term=%s" % texto)).data
|
||||||
jsonResult = jsontools.load(data)
|
data_dict = jsontools.load(data)
|
||||||
tvShows = jsonResult["myData"]
|
tvshows = data_dict["myData"]
|
||||||
|
|
||||||
return [item.clone(action="episodios",
|
return [item.clone(action="episodios",
|
||||||
title=show["titulo"],
|
title=show["titulo"],
|
||||||
@@ -166,11 +165,11 @@ def search(item, texto):
|
|||||||
url=urlparse.urljoin(HOST, show["urla"]),
|
url=urlparse.urljoin(HOST, show["urla"]),
|
||||||
thumbnail=urlparse.urljoin(HOST, show["img"]),
|
thumbnail=urlparse.urljoin(HOST, show["img"]),
|
||||||
context=filtertools.context(item, list_idiomas, CALIDADES)
|
context=filtertools.context(item, list_idiomas, CALIDADES)
|
||||||
) for show in tvShows]
|
) for show in tvshows]
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
logger.info("url: {0}".format(item.url))
|
logger.info("url: %s" % item.url)
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
|
|
||||||
@@ -204,9 +203,9 @@ def findvideos(item):
|
|||||||
|
|
||||||
|
|
||||||
def play(item):
|
def play(item):
|
||||||
logger.info("play: {0}".format(item.url))
|
logger.info("play: %s" % item.url)
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
videoURL = scrapertools.find_single_match(data, "location.href='([^']+)")
|
video_url = scrapertools.find_single_match(data, "location.href='([^']+)")
|
||||||
logger.debug("Video URL = {0}".format(videoURL))
|
logger.debug("Video URL = %s" % video_url)
|
||||||
itemlist = servertools.find_video_items(data=videoURL)
|
itemlist = servertools.find_video_items(data=video_url)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
Executable → Regular
+33
-26
@@ -24,41 +24,48 @@ def update(path, p_dialog, i, t, serie, overwrite):
|
|||||||
serie.channel = channel
|
serie.channel = channel
|
||||||
serie.url = url
|
serie.url = url
|
||||||
|
|
||||||
heading = 'Actualizando videoteca....'
|
channel_active = config.get_setting("active", channel=channel, default=False)
|
||||||
p_dialog.update(int(math.ceil((i + 1) * t)), heading, "%s: %s" % (serie.contentSerieName,
|
|
||||||
serie.channel.capitalize()))
|
|
||||||
try:
|
|
||||||
pathchannels = filetools.join(config.get_runtime_path(), "channels", serie.channel + '.py')
|
|
||||||
logger.info("Cargando canal: " + pathchannels + " " +
|
|
||||||
serie.channel)
|
|
||||||
|
|
||||||
if serie.library_filter_show:
|
if channel_active:
|
||||||
serie.show = serie.library_filter_show.get(channel, serie.contentSerieName)
|
|
||||||
|
|
||||||
obj = imp.load_source(serie.channel, pathchannels)
|
|
||||||
itemlist = obj.episodios(serie)
|
|
||||||
|
|
||||||
|
heading = 'Actualizando videoteca....'
|
||||||
|
p_dialog.update(int(math.ceil((i + 1) * t)), heading, "%s: %s" % (serie.contentSerieName,
|
||||||
|
serie.channel.capitalize()))
|
||||||
try:
|
try:
|
||||||
if int(overwrite) == 3:
|
pathchannels = filetools.join(config.get_runtime_path(), "channels", serie.channel + '.py')
|
||||||
# Sobrescribir todos los archivos (tvshow.nfo, 1x01.nfo, 1x01 [canal].json, 1x01.strm, etc...)
|
logger.info("Cargando canal: " + pathchannels + " " +
|
||||||
insertados, sobreescritos, fallidos = videolibrarytools.save_tvshow(serie, itemlist)
|
serie.channel)
|
||||||
else:
|
|
||||||
insertados, sobreescritos, fallidos = videolibrarytools.save_episodes(path, itemlist, serie,
|
if serie.library_filter_show:
|
||||||
silent=True,
|
serie.show = serie.library_filter_show.get(channel, serie.contentSerieName)
|
||||||
overwrite=overwrite)
|
|
||||||
insertados_total += insertados
|
obj = imp.load_source(serie.channel, pathchannels)
|
||||||
|
itemlist = obj.episodios(serie)
|
||||||
|
|
||||||
|
try:
|
||||||
|
if int(overwrite) == 3:
|
||||||
|
# Sobrescribir todos los archivos (tvshow.nfo, 1x01.nfo, 1x01 [canal].json, 1x01.strm, etc...)
|
||||||
|
insertados, sobreescritos, fallidos = videolibrarytools.save_tvshow(serie, itemlist)
|
||||||
|
else:
|
||||||
|
insertados, sobreescritos, fallidos = videolibrarytools.save_episodes(path, itemlist, serie,
|
||||||
|
silent=True,
|
||||||
|
overwrite=overwrite)
|
||||||
|
insertados_total += insertados
|
||||||
|
|
||||||
|
except Exception, ex:
|
||||||
|
logger.error("Error al guardar los capitulos de la serie")
|
||||||
|
template = "An exception of type %s occured. Arguments:\n%r"
|
||||||
|
message = template % (type(ex).__name__, ex.args)
|
||||||
|
logger.error(message)
|
||||||
|
|
||||||
except Exception, ex:
|
except Exception, ex:
|
||||||
logger.error("Error al guardar los capitulos de la serie")
|
logger.error("Error al obtener los episodios de: %s" % serie.show)
|
||||||
template = "An exception of type %s occured. Arguments:\n%r"
|
template = "An exception of type %s occured. Arguments:\n%r"
|
||||||
message = template % (type(ex).__name__, ex.args)
|
message = template % (type(ex).__name__, ex.args)
|
||||||
logger.error(message)
|
logger.error(message)
|
||||||
|
|
||||||
except Exception, ex:
|
else:
|
||||||
logger.error("Error al obtener los episodios de: %s" % serie.show)
|
logger.debug("Canal %s no activo no se actualiza" % serie.channel)
|
||||||
template = "An exception of type %s occured. Arguments:\n%r"
|
|
||||||
message = template % (type(ex).__name__, ex.args)
|
|
||||||
logger.error(message)
|
|
||||||
|
|
||||||
return insertados_total > 0
|
return insertados_total > 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user