seriespapaya corregido
This commit is contained in:
40
plugin.video.alfa/channels/newpct1.py
Executable file → Normal file
40
plugin.video.alfa/channels/newpct1.py
Executable file → Normal file
@@ -57,7 +57,7 @@ def submenu(item):
|
||||
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")
|
||||
|
||||
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)
|
||||
|
||||
patron = '<a href="([^"]+)".*?>([^>]+)</a>'
|
||||
@@ -126,7 +126,6 @@ def listado(item):
|
||||
if "1.com/series" in url:
|
||||
action = "completo"
|
||||
extra = "serie"
|
||||
context = "tvshow"
|
||||
|
||||
title = scrapertools.find_single_match(title, '([^-]+)')
|
||||
title = title.replace("Ver online", "", 1).replace("Descarga Serie HD", "", 1).replace("Ver en linea", "",
|
||||
@@ -137,7 +136,7 @@ def listado(item):
|
||||
url_i = 'http://www.newpct1.com/index.php?page=buscar&url=&letter=&q=%22' + title.replace(" ","%20") + '%22'
|
||||
else:
|
||||
url_i = 'http://www.newpct1.com/index.php?page=buscar&url=&letter=&q=' + title
|
||||
|
||||
|
||||
if "1.com/series-hd" in url:
|
||||
extra="serie-hd"
|
||||
url = url_i + '&categoryID=&categoryIDR=1469&calidad=' + calidad.replace(" ","+") #DTV+720p+AC3+5.1
|
||||
@@ -147,29 +146,30 @@ def listado(item):
|
||||
elif "1.com/series/" in url:
|
||||
extra="serie-tv"
|
||||
url = url_i + '&categoryID=&categoryIDR=767&calidad=' + calidad.replace(" ","+")
|
||||
|
||||
|
||||
url += '&idioma=&ordenar=Nombre&inon=Descendente'
|
||||
'''
|
||||
show = title
|
||||
else:
|
||||
title = title.replace("Descargar", "", 1).strip()
|
||||
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/(.*?)/(.*?)/")
|
||||
if context_title:
|
||||
try:
|
||||
context = context_title[0].replace("pelicula", "movie").replace("descargar", "movie").replace("series",
|
||||
"tvshow")
|
||||
context_title = context_title[1].replace("-", " ")
|
||||
if re.search('\d{4}', context_title[-4:]):
|
||||
context_title = context_title[:-4]
|
||||
elif re.search('\(\d{4}\)', context_title[-6:]):
|
||||
context_title = context_title[:-6]
|
||||
except:
|
||||
context_title = title
|
||||
|
||||
if item.extra != "buscar-list":
|
||||
title = title + ' ' + calidad
|
||||
context_title = show
|
||||
|
||||
itemlist.append(
|
||||
Item(channel=item.channel, action=action, title=title, url=url, thumbnail=thumbnail, extra=extra, show=show,
|
||||
@@ -212,7 +212,7 @@ def completo(item):
|
||||
categoryID=buscar_en_subcategoria(item.show,'767')
|
||||
if categoryID !="":
|
||||
item.url=item.url.replace("categoryID=","categoryID="+categoryID)
|
||||
|
||||
|
||||
#Fanart
|
||||
oTvdb= TvDb()
|
||||
serieID=oTvdb.get_serieId_by_title(item.show)
|
||||
@@ -241,12 +241,12 @@ def completo(item):
|
||||
salir = False
|
||||
while not salir:
|
||||
|
||||
# Saca la URL de la siguiente página
|
||||
# Saca la URL de la siguiente página
|
||||
ultimo_item = items_programas[len(items_programas) - 1]
|
||||
|
||||
# Páginas intermedias
|
||||
if ultimo_item.action == ultimo_action:
|
||||
# Quita el elemento de "Página siguiente"
|
||||
# Quita el elemento de "Página siguiente"
|
||||
ultimo_item = items_programas.pop()
|
||||
|
||||
# Añade las entradas de la página a la lista completa
|
||||
@@ -269,7 +269,7 @@ def completo(item):
|
||||
salir = True
|
||||
|
||||
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))
|
||||
logger.debug("items=" + str(len(itemlist)))
|
||||
return itemlist
|
||||
@@ -447,7 +447,10 @@ def findvideos(item):
|
||||
for logo, servidor, idioma, calidad, enlace, titulo in enlaces_ver:
|
||||
servidor = servidor.replace("streamin", "streaminto")
|
||||
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:
|
||||
servers_module = __import__("servers." + servidor)
|
||||
server_module = getattr(servers_module, servidor)
|
||||
@@ -467,7 +470,10 @@ def findvideos(item):
|
||||
for enlace in partes:
|
||||
parte_titulo = titulo + " (%s/%s)" % (p, len(partes)) + " [" + servidor + "]"
|
||||
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:
|
||||
servers_module = __import__("servers." + servidor)
|
||||
server_module = getattr(servers_module, servidor)
|
||||
|
||||
47
plugin.video.alfa/channels/seriespapaya.py
Executable file → Normal file
47
plugin.video.alfa/channels/seriespapaya.py
Executable file → Normal file
@@ -6,7 +6,6 @@ import urllib
|
||||
import urlparse
|
||||
|
||||
from channels import filtertools
|
||||
from channelselector import get_thumb
|
||||
from core import config
|
||||
from core import httptools
|
||||
from core import jsontools
|
||||
@@ -25,9 +24,9 @@ CALIDADES = ['360p', '480p', '720p HD', '1080p HD']
|
||||
def mainlist(item):
|
||||
logger.info()
|
||||
|
||||
thumb_series = get_thumb("thumb_channels_tvshow.png")
|
||||
thumb_series_az = get_thumb("thumb_channels_tvshow_az.png")
|
||||
thumb_buscar = get_thumb("thumb_search.png")
|
||||
thumb_series = config.get_thumb("thumb_channels_tvshow.png")
|
||||
thumb_series_az = config.get_thumb("thumb_channels_tvshow_az.png")
|
||||
thumb_buscar = config.get_thumb("thumb_search.png")
|
||||
|
||||
itemlist = []
|
||||
itemlist.append(
|
||||
@@ -52,22 +51,22 @@ def listado_alfabetico(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.extra = 0
|
||||
return 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 = []
|
||||
url = urlparse.urljoin(HOST, "autoload_process.php")
|
||||
|
||||
postRequest = {
|
||||
post_request = {
|
||||
"group_no": item.extra,
|
||||
"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(
|
||||
'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):
|
||||
logger.info("categoria: {0}".format(categoria))
|
||||
logger.info("categoria: %s" % categoria)
|
||||
|
||||
if categoria != 'series':
|
||||
return []
|
||||
@@ -119,13 +118,13 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("{0}".format(line))
|
||||
logger.error("%s" % line)
|
||||
|
||||
return []
|
||||
|
||||
|
||||
def episodios(item):
|
||||
logger.info("url: {0}".format(item.url))
|
||||
logger.info("url: %s" % item.url)
|
||||
|
||||
data = httptools.downloadpage(item.url).data
|
||||
|
||||
@@ -136,15 +135,15 @@ def episodios(item):
|
||||
for url, title, langs in episodes:
|
||||
logger.debug("langs %s" % langs)
|
||||
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(" ")
|
||||
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),
|
||||
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"
|
||||
if config.get_videolibrary_support() and len(itemlist) > 0:
|
||||
@@ -155,10 +154,10 @@ def episodios(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
logger.info("texto: {0}".format(texto))
|
||||
data = httptools.downloadpage(urlparse.urljoin(HOST, "/buscar.php?term={0}".format(texto))).data
|
||||
jsonResult = jsontools.load(data)
|
||||
tvShows = jsonResult["myData"]
|
||||
logger.info("texto: %s" % texto)
|
||||
data = httptools.downloadpage(urlparse.urljoin(HOST, "/buscar.php?term=%s" % texto)).data
|
||||
data_dict = jsontools.load(data)
|
||||
tvshows = data_dict["myData"]
|
||||
|
||||
return [item.clone(action="episodios",
|
||||
title=show["titulo"],
|
||||
@@ -166,11 +165,11 @@ def search(item, texto):
|
||||
url=urlparse.urljoin(HOST, show["urla"]),
|
||||
thumbnail=urlparse.urljoin(HOST, show["img"]),
|
||||
context=filtertools.context(item, list_idiomas, CALIDADES)
|
||||
) for show in tvShows]
|
||||
) for show in tvshows]
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
logger.info("url: {0}".format(item.url))
|
||||
logger.info("url: %s" % item.url)
|
||||
|
||||
data = httptools.downloadpage(item.url).data
|
||||
|
||||
@@ -204,9 +203,9 @@ def findvideos(item):
|
||||
|
||||
|
||||
def play(item):
|
||||
logger.info("play: {0}".format(item.url))
|
||||
logger.info("play: %s" % item.url)
|
||||
data = httptools.downloadpage(item.url).data
|
||||
videoURL = scrapertools.find_single_match(data, "location.href='([^']+)")
|
||||
logger.debug("Video URL = {0}".format(videoURL))
|
||||
itemlist = servertools.find_video_items(data=videoURL)
|
||||
video_url = scrapertools.find_single_match(data, "location.href='([^']+)")
|
||||
logger.debug("Video URL = %s" % video_url)
|
||||
itemlist = servertools.find_video_items(data=video_url)
|
||||
return itemlist
|
||||
|
||||
59
plugin.video.alfa/videolibrary_service.py
Executable file → Normal file
59
plugin.video.alfa/videolibrary_service.py
Executable file → Normal file
@@ -24,41 +24,48 @@ def update(path, p_dialog, i, t, serie, overwrite):
|
||||
serie.channel = channel
|
||||
serie.url = url
|
||||
|
||||
heading = 'Actualizando videoteca....'
|
||||
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)
|
||||
channel_active = config.get_setting("active", channel=channel, default=False)
|
||||
|
||||
if serie.library_filter_show:
|
||||
serie.show = serie.library_filter_show.get(channel, serie.contentSerieName)
|
||||
|
||||
obj = imp.load_source(serie.channel, pathchannels)
|
||||
itemlist = obj.episodios(serie)
|
||||
if channel_active:
|
||||
|
||||
heading = 'Actualizando videoteca....'
|
||||
p_dialog.update(int(math.ceil((i + 1) * t)), heading, "%s: %s" % (serie.contentSerieName,
|
||||
serie.channel.capitalize()))
|
||||
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
|
||||
pathchannels = filetools.join(config.get_runtime_path(), "channels", serie.channel + '.py')
|
||||
logger.info("Cargando canal: " + pathchannels + " " +
|
||||
serie.channel)
|
||||
|
||||
if serie.library_filter_show:
|
||||
serie.show = serie.library_filter_show.get(channel, serie.contentSerieName)
|
||||
|
||||
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:
|
||||
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"
|
||||
message = template % (type(ex).__name__, ex.args)
|
||||
logger.error(message)
|
||||
|
||||
except Exception, ex:
|
||||
logger.error("Error al obtener los episodios de: %s" % serie.show)
|
||||
template = "An exception of type %s occured. Arguments:\n%r"
|
||||
message = template % (type(ex).__name__, ex.args)
|
||||
logger.error(message)
|
||||
else:
|
||||
logger.debug("Canal %s no activo no se actualiza" % serie.channel)
|
||||
|
||||
return insertados_total > 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user