Merge remote-tracking branch 'alfa-addon/master'
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<addon id="plugin.video.alfa" name="Alfa" version="2.4.18" provider-name="Alfa Addon">
|
<addon id="plugin.video.alfa" name="Alfa" version="2.5.0" provider-name="Alfa Addon">
|
||||||
<requires>
|
<requires>
|
||||||
<import addon="xbmc.python" version="2.1.0"/>
|
<import addon="xbmc.python" version="2.1.0"/>
|
||||||
<import addon="script.module.libtorrent" optional="true"/>
|
<import addon="script.module.libtorrent" optional="true"/>
|
||||||
@@ -19,10 +19,14 @@
|
|||||||
</assets>
|
</assets>
|
||||||
<news>[B]Estos son los cambios para esta versión:[/B]
|
<news>[B]Estos son los cambios para esta versión:[/B]
|
||||||
[COLOR green][B]Canales agregados y arreglos[/B][/COLOR]
|
[COLOR green][B]Canales agregados y arreglos[/B][/COLOR]
|
||||||
» seriesblanco » rapidvideo
|
» newpct » newpct1
|
||||||
» kbagi » bitertv
|
» youtube » flashx
|
||||||
» doomtv » miltorrents
|
» kbagi » pelismagnet
|
||||||
|
» gnula » animemovil
|
||||||
|
» cinecalidad » cuelgame
|
||||||
|
» divxtotal » cinemahd
|
||||||
¤ arreglos internos
|
¤ arreglos internos
|
||||||
|
¤ Agradecimientos a @Paquito Porras por PelisUltra.
|
||||||
</news>
|
</news>
|
||||||
<description lang="es">Navega con Kodi por páginas web para ver sus videos de manera fácil.</description>
|
<description lang="es">Navega con Kodi por páginas web para ver sus videos de manera fácil.</description>
|
||||||
<summary lang="en">Browse web pages using Kodi</summary>
|
<summary lang="en">Browse web pages using Kodi</summary>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from core import scrapertools
|
|||||||
from core import servertools
|
from core import servertools
|
||||||
from core import tmdb
|
from core import tmdb
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
|
from channelselector import get_thumb
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
|
||||||
__modo_grafico__ = config.get_setting('modo_grafico', "allpeliculas")
|
__modo_grafico__ = config.get_setting('modo_grafico', "allpeliculas")
|
||||||
@@ -30,13 +31,14 @@ def mainlist(item):
|
|||||||
item.text_color = color1
|
item.text_color = color1
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Películas", action="lista", fanart="http://i.imgur.com/c3HS8kj.png",
|
itemlist.append(item.clone(title="Películas", action="lista", fanart="http://i.imgur.com/c3HS8kj.png",
|
||||||
url= host + "movies/newmovies?page=1", extra1 = 0))
|
url= host + "movies/newmovies?page=1", extra1 = 0,
|
||||||
|
thumbnail=get_thumb('movies', auto=True)))
|
||||||
itemlist.append(item.clone(title="Por genero", action="generos", fanart="http://i.imgur.com/c3HS8kj.png",
|
itemlist.append(item.clone(title="Por genero", action="generos", fanart="http://i.imgur.com/c3HS8kj.png",
|
||||||
url= host + "movies/getGanres"))
|
url= host + "movies/getGanres", thumbnail=get_thumb('genres', auto=True)))
|
||||||
itemlist.append(item.clone(title="Colecciones", action="colecciones", fanart="http://i.imgur.com/c3HS8kj.png",
|
itemlist.append(item.clone(title="Colecciones", action="colecciones", fanart="http://i.imgur.com/c3HS8kj.png",
|
||||||
url= host))
|
url= host, thumbnail=get_thumb('colections', auto=True)))
|
||||||
itemlist.append(item.clone(title="", action=""))
|
itemlist.append(item.clone(title="", action=""))
|
||||||
itemlist.append(item.clone(title="Buscar...", action="search"))
|
itemlist.append(item.clone(title="Buscar...", action="search", thumbnail=get_thumb('search', auto=True)))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import re
|
|||||||
|
|
||||||
from channels import renumbertools
|
from channels import renumbertools
|
||||||
from core import httptools
|
from core import httptools
|
||||||
|
from core import servertools
|
||||||
from core import jsontools
|
from core import jsontools
|
||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
@@ -11,7 +12,7 @@ from platformcode import platformtools, config, logger
|
|||||||
|
|
||||||
|
|
||||||
__modo_grafico__ = config.get_setting('modo_grafico', 'animemovil')
|
__modo_grafico__ = config.get_setting('modo_grafico', 'animemovil')
|
||||||
__perfil__ = int(config.get_setting('perfil', "animemovil"))
|
__perfil__ = ''
|
||||||
|
|
||||||
# Fijar perfil de color
|
# Fijar perfil de color
|
||||||
perfil = [['0xFFFFE6CC', '0xFFFFCE9C', '0xFF994D00', '0xFFFE2E2E', '0xFFFFD700'],
|
perfil = [['0xFFFFE6CC', '0xFFFFCE9C', '0xFF994D00', '0xFFFE2E2E', '0xFFFFD700'],
|
||||||
@@ -31,10 +32,12 @@ def mainlist(item):
|
|||||||
|
|
||||||
itemlist.append(Item(channel=item.channel, action="recientes", title="Episodios Recientes", thumbnail=item.thumbnail,
|
itemlist.append(Item(channel=item.channel, action="recientes", title="Episodios Recientes", thumbnail=item.thumbnail,
|
||||||
url=host, text_color=color1, contentType="tvshow", extra="recientes"))
|
url=host, text_color=color1, contentType="tvshow", extra="recientes"))
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title="Animes", thumbnail=item.thumbnail,
|
|
||||||
url="%s/_API/?src=animesRecientes&offset=0" % host, text_color=color1))
|
itemlist.append(Item(channel=item.channel, action="listado", title="Anime", thumbnail=item.thumbnail,
|
||||||
itemlist.append(Item(channel=item.channel, action="emision", title="En emisión", thumbnail=item.thumbnail,
|
url=host+'/api/buscador?q=&letra=ALL&genero=ALL&estado=2&offset=0&limit=20', text_color=color1, contentType="tvshow", extra="recientes"))
|
||||||
url="%s/anime/emision" % host, text_color=color2, contentType="tvshow"))
|
|
||||||
|
itemlist.append(Item(channel=item.channel, action="list_by_json", title="En emisión", thumbnail=item.thumbnail,
|
||||||
|
text_color=color2, contentType="tvshow"))
|
||||||
itemlist.append(Item(channel=item.channel, action="indices", title="Índices", thumbnail=item.thumbnail,
|
itemlist.append(Item(channel=item.channel, action="indices", title="Índices", thumbnail=item.thumbnail,
|
||||||
text_color=color2))
|
text_color=color2))
|
||||||
|
|
||||||
@@ -55,14 +58,8 @@ def openconfig(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
item.url = "%s/?s=%s" % (host, texto.replace(" ", "+"))
|
item.url = "%s/api/buscador?q=%s&letra=ALL&genero=ALL&estado=2&offset=0&limit=30" % (host, texto.replace(" ", "+"))
|
||||||
try:
|
return list_by_json(item)
|
||||||
return recientes(item)
|
|
||||||
except:
|
|
||||||
import sys
|
|
||||||
for line in sys.exc_info():
|
|
||||||
logger.error("%s" % line)
|
|
||||||
return []
|
|
||||||
|
|
||||||
|
|
||||||
def recientes(item):
|
def recientes(item):
|
||||||
@@ -71,7 +68,9 @@ def recientes(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
bloque = scrapertools.find_single_match(data, '<ul class="emision"(.*?)</ul>')
|
data = re.sub(r'\n|\s{2,}','', data)
|
||||||
|
|
||||||
|
bloque = scrapertools.find_single_match(data, '<ul class="hover">(.*?)</ul>')
|
||||||
patron = '<li><a href="([^"]+)" title="([^"]+)".*?src="([^"]+)"'
|
patron = '<li><a href="([^"]+)" title="([^"]+)".*?src="([^"]+)"'
|
||||||
matches = scrapertools.find_multiple_matches(bloque, patron)
|
matches = scrapertools.find_multiple_matches(bloque, patron)
|
||||||
for url, title, thumb in matches:
|
for url, title, thumb in matches:
|
||||||
@@ -116,13 +115,13 @@ def recientes(item):
|
|||||||
def listado(item):
|
def listado(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
data = jsontools.load(httptools.downloadpage(item.url).data)
|
data = jsontools.load(httptools.downloadpage(item.url).data)
|
||||||
|
status = data.get('status')
|
||||||
|
data= data.get('result')
|
||||||
for it in data.get("items", []):
|
for it in data.get("items", []):
|
||||||
scrapedtitle = it["title"]
|
scrapedtitle = it["title"]
|
||||||
url = "%s/%s" % (host, it["url"])
|
url = "%s/%s/" % (host, it["slug"])
|
||||||
thumb = "http://img.animemovil.com/w440-h250-c/%s" % it["img"]
|
thumb = 'http://media.animemovil.com/animes/%s/wallpaper_small.jpg' % it['id']
|
||||||
title = re.sub(r"(?i) Ova| Especiales| \(Pelicula[s]*\)| \(Película[s]*\)| Sub| Español| Peliculas| Audio| Latino", "", scrapedtitle)
|
title = re.sub(r"(?i) Ova| Especiales| \(Pelicula[s]*\)| \(Película[s]*\)| Sub| Español| Peliculas| Audio| Latino", "", scrapedtitle)
|
||||||
|
|
||||||
tipo = "tvshow"
|
tipo = "tvshow"
|
||||||
@@ -132,22 +131,22 @@ def listado(item):
|
|||||||
tipo = "movie"
|
tipo = "movie"
|
||||||
show = ""
|
show = ""
|
||||||
action = "peliculas"
|
action = "peliculas"
|
||||||
|
|
||||||
infoLabels = {'filtro': {"original_language": "ja"}.items()}
|
infoLabels = {'filtro': {"original_language": "ja"}.items()}
|
||||||
|
|
||||||
itemlist.append(item.clone(action=action, title=scrapedtitle, url=url, thumbnail=thumb, text_color=color3,
|
itemlist.append(item.clone(action=action, title=scrapedtitle, url=url, thumbnail=thumb, text_color=color3,
|
||||||
contentTitle=title, contentSerieName=show, infoLabels=infoLabels,
|
contentTitle=title, contentSerieName=show, infoLabels=infoLabels,
|
||||||
context=renumbertools.context(item), contentType=tipo))
|
context=renumbertools.context(item), contentType=tipo))
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from core import tmdb
|
from core import tmdb
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if data["buttom"] and itemlist:
|
if status and itemlist:
|
||||||
offset = int(scrapertools.find_single_match(item.url, 'offset=(\d+)')) + 1
|
offset = scrapertools.find_single_match(item.url, 'offset=(\d+)')
|
||||||
|
if offset:
|
||||||
|
offset = int(offset) + 2
|
||||||
|
else:
|
||||||
|
offset = 0
|
||||||
url = re.sub(r'offset=\d+', 'offset=%s' % offset, item.url)
|
url = re.sub(r'offset=\d+', 'offset=%s' % offset, item.url)
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", url=url, title=">> Página Siguiente",
|
itemlist.append(Item(channel=item.channel, action="listado", url=url, title=">> Página Siguiente",
|
||||||
thumbnail=item.thumbnail, text_color=color2))
|
thumbnail=item.thumbnail, text_color=color2))
|
||||||
@@ -160,68 +159,48 @@ def indices(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
if "Índices" in item.title:
|
if "Índices" in item.title:
|
||||||
itemlist.append(item.clone(title="Por Género", url="%s/anime/generos/" % host))
|
itemlist.append(item.clone(title="Por Género", url="%s/anime" % host))
|
||||||
itemlist.append(item.clone(title="Por Letra", url="%s/anime/" % host))
|
itemlist.append(item.clone(title="Por Letra", url="%s/anime" % host))
|
||||||
itemlist.append(item.clone(action="completo", title="Lista completa de Animes",
|
itemlist.append(item.clone(action="list_by_json", title="Lista completa de Animes",
|
||||||
url="%s/anime/lista/" % host))
|
url="%s/api/buscador?q=&letra=ALL&genero=ALL&estado=2&offset=0&limit=20" % host))
|
||||||
else:
|
else:
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
bloque = scrapertools.find_single_match(data, '<div class="letras">(.*?)</div>')
|
data = re.sub('\n|\s{2,}', '', data)
|
||||||
|
if 'Letra' in item.title:
|
||||||
|
bloque = scrapertools.find_single_match(data, '<select name="letra"(.*?)</select>')
|
||||||
|
patron = '<option value="(\w)"'
|
||||||
|
elif 'Género' in item.title:
|
||||||
|
bloque = scrapertools.find_single_match(data, '<select name="genero"(.*?)</select>')
|
||||||
|
patron = '<option value="(\d+.*?)/'
|
||||||
|
|
||||||
patron = '<a title="([^"]+)"'
|
|
||||||
matches = scrapertools.find_multiple_matches(bloque, patron)
|
matches = scrapertools.find_multiple_matches(bloque, patron)
|
||||||
|
|
||||||
for title in matches:
|
for title in matches:
|
||||||
if "Letra" in item.title:
|
if "Letra" in item.title:
|
||||||
url = "%s/_API/?src=animesLetra&offset=0&letra=%s" % (host, title)
|
url = '%s/api/buscador?q=&letra=%s&genero=ALL&estado=2&offset=0&limit=20' % (host, title)
|
||||||
else:
|
else:
|
||||||
url = "%s/_API/?src=animesGenero&offset=0&genero=%s" % (host, title)
|
value = scrapertools.find_single_match(title, '(\d+)"')
|
||||||
itemlist.append(item.clone(action="listado", url=url, title=title))
|
title = scrapertools.find_single_match(title, '\d+">(.*?)<')
|
||||||
|
url = '%s/api/buscador?q=&letra=ALL&genero=%s&estado=2&offset=0&limit=20' % (host, value)
|
||||||
|
|
||||||
|
itemlist.append(item.clone(action="list_by_json", url=url, title=title))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def completo(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
|
||||||
bloque = scrapertools.find_single_match(data, '<ul class="listadoAnime">(.*?)</ul>')
|
|
||||||
patron = '<li><a href="([^"]+)" title="([^"]+)".*?src="([^"]+)"'
|
|
||||||
matches = scrapertools.find_multiple_matches(bloque, patron)
|
|
||||||
for url, title, thumb in matches:
|
|
||||||
url = host + url
|
|
||||||
scrapedtitle = title
|
|
||||||
thumb = thumb.replace("s90-c", "w440-h250-c")
|
|
||||||
title = re.sub(r"(?i) Ova| Especiales| \(Pelicula[s]*\)| \(Película[s]*\)| Sub Español| Peliculas", "", scrapedtitle)
|
|
||||||
|
|
||||||
tipo = "tvshow"
|
|
||||||
show = title
|
|
||||||
action = "episodios"
|
|
||||||
if url.endswith("-pelicula/") or url.endswith("-pelicula"):
|
|
||||||
tipo = "movie"
|
|
||||||
show = ""
|
|
||||||
action = "peliculas"
|
|
||||||
infoLabels = {'filtro': {"original_language": "ja"}.items()}
|
|
||||||
itemlist.append(Item(channel=item.channel, action=action, title=scrapedtitle, url=url, thumbnail=thumb,
|
|
||||||
text_color=color3, contentTitle=title, contentSerieName=show, extra="completo",
|
|
||||||
context=renumbertools.context(item), contentType=tipo, infoLabels=infoLabels))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
|
data = re.sub('\n|\s{2,}', '', data)
|
||||||
show = scrapertools.find_single_match(data, '<title>\s*([^<]+)\s*</title>')
|
show = scrapertools.find_single_match(data, '<div class="x-title">(.*?)</div>')
|
||||||
show = re.sub(r"(?i) Ova| Especiales| \(Pelicula[s]*\)| \(Película[s]*\)| Sub| Español| Peliculas| Audio| Latino", "", show)
|
show = re.sub(r"(?i) Ova| Especiales| \(Pelicula[s]*\)| \(Película[s]*\)| Sub| Español| Peliculas| Audio| Latino", "", show)
|
||||||
|
|
||||||
if not item.infoLabels["plot"]:
|
if not item.infoLabels["plot"]:
|
||||||
item.infoLabels["plot"] = scrapertools.find_single_match(data, '<div class="InfoSipnosis">.*?<p>(.*?)</p>')
|
item.infoLabels["plot"] = scrapertools.find_single_match(data, '<div class="x-sinopsis">\s*(.*?)</div>')
|
||||||
|
|
||||||
bloque = scrapertools.find_single_match(data, 'ul class="lista"(.*?)</ul>')
|
bloque = scrapertools.find_single_match(data, '<ul class="list"(.*?)</ul>')
|
||||||
matches = scrapertools.find_multiple_matches(bloque, '<li><a href="([^"]+)" title="([^"]+)"')
|
matches = scrapertools.find_multiple_matches(bloque, '<li><a href="([^"]+)" title="([^"]+)"')
|
||||||
for url, title in matches:
|
for url, title in matches:
|
||||||
url = host + url
|
url = host + url
|
||||||
@@ -252,56 +231,44 @@ def episodios(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def list_by_json(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
repeat = 1
|
||||||
|
status = False
|
||||||
|
if item.url =='':
|
||||||
|
item.url = host+"/api/buscador?limit=30&estado=1&dia=%s"
|
||||||
|
repeat = 6
|
||||||
|
for element in range(0,repeat):
|
||||||
|
if repeat != 1:
|
||||||
|
data = jsontools.load(httptools.downloadpage(item.url % element).data)
|
||||||
|
else:
|
||||||
|
data = jsontools.load(httptools.downloadpage(item.url).data)
|
||||||
|
|
||||||
if item.extra == "completo":
|
status = data.get('status')
|
||||||
try:
|
json_data = data.get('result')
|
||||||
from core import tmdb
|
elem_data = json_data['items']
|
||||||
tmdb.set_infoLabels_item(item, __modo_grafico__)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
|
||||||
if not item.infoLabels["plot"]:
|
|
||||||
item.infoLabels["plot"] = scrapertools.find_single_match(data, '<div class="InfoSipnosis">.*?<p>(.*?)</p>')
|
|
||||||
|
|
||||||
bloque = scrapertools.find_single_match(data, 'ul class="lista"(.*?)</ul>')
|
|
||||||
matches = scrapertools.find_multiple_matches(bloque, '<li><a href="([^"]+)" title="([^"]+)"')
|
|
||||||
if len(matches) == 1:
|
|
||||||
item.url = host + matches[0][0]
|
|
||||||
itemlist = findvideos(item)
|
|
||||||
else:
|
|
||||||
for url, title in matches:
|
|
||||||
itemlist.append(item.clone(action="findvideos", title=title, url=url, extra=""))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def emision(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
|
||||||
bloques = scrapertools.find_multiple_matches(data, '<div class="horario">.*?</i>\s*(.*?)</span>(.*?)</ul>')
|
|
||||||
patron = '<li><a href="([^"]+)" title="([^"]+)".*?src="([^"]+)"'
|
|
||||||
for dia, b in bloques:
|
|
||||||
matches = scrapertools.find_multiple_matches(b, patron)
|
|
||||||
if matches:
|
|
||||||
itemlist.append(item.clone(action="", title=dia, text_color=color1))
|
|
||||||
for url, title, thumb in matches:
|
|
||||||
url = host + url
|
|
||||||
scrapedtitle = " %s" % title
|
|
||||||
title = re.sub(r"(?i) Ova| Especiales| \(Pelicula[s]*\)| \(Película[s]*\)| Sub Español| Peliculas", "", title)
|
|
||||||
if not thumb.startswith("http"):
|
|
||||||
thumb = "http:%s" % thumb
|
|
||||||
|
|
||||||
|
for item_data in elem_data:
|
||||||
|
url = '%s/%s/' % (host, item_data['slug'])
|
||||||
|
title = item_data['title']
|
||||||
|
title = re.sub(r"(?i) Ova| Especiales| \(Pelicula[s]*\)| \(Película[s]*\)| Sub Español| Peliculas", "",
|
||||||
|
title)
|
||||||
|
thumb = 'http://media.animemovil.com/animes/%s/wallpaper_small.jpg' % item_data['id']
|
||||||
infoLabels = {'filtro': {"original_language": "ja"}.items()}
|
infoLabels = {'filtro': {"original_language": "ja"}.items()}
|
||||||
itemlist.append(item.clone(action="episodios", title=scrapedtitle, url=url, thumbnail=thumb, text_color=color3,
|
itemlist.append(
|
||||||
contentTitle=title, contentSerieName=title, extra="recientes",
|
item.clone(action="episodios", title=title, url=url, thumbnail=thumb, text_color=color3,
|
||||||
context=renumbertools.context(item), infoLabels=infoLabels))
|
contentTitle=title, contentSerieName=title, extra="recientes",
|
||||||
|
context=renumbertools.context(item), infoLabels=infoLabels))
|
||||||
|
if status and itemlist:
|
||||||
|
offset = scrapertools.find_single_match(item.url, 'offset=(\d+)')
|
||||||
|
if offset:
|
||||||
|
offset = int(offset) + 2
|
||||||
|
else:
|
||||||
|
offset = 0
|
||||||
|
url = re.sub(r'offset=\d+', 'offset=%s' % offset, item.url)
|
||||||
|
itemlist.append(Item(channel=item.channel, action="listado", url=url, title=">> Página Siguiente",
|
||||||
|
thumbnail=item.thumbnail, text_color=color2))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -310,80 +277,69 @@ def findvideos(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
|
data = re.sub(r'\n|\s{2,}', '', data)
|
||||||
|
|
||||||
id = scrapertools.find_single_match(data, '"id":"([^"]+)"')
|
akiba_url = scrapertools.find_single_match(data, '<div class="x-link"><a href="(.*?)"')
|
||||||
bloque = scrapertools.find_single_match(data, 'ul class="controles">(.*?)</ul>')
|
url = httptools.downloadpage('http:'+akiba_url, follow_redirects=False).headers.get('location')
|
||||||
patron = '<li title="([^"]+)" id="[^"]*" host="([^"]+)">'
|
title = '%s (%s)' % (item.title, 'akiba')
|
||||||
matches = scrapertools.find_multiple_matches(data, patron)
|
itemlist.append(item.clone(title=title, url=url, action='play'))
|
||||||
for title, server in matches:
|
|
||||||
if title == "Vizard":
|
|
||||||
continue
|
|
||||||
title = "%s - %s" % (title, item.title)
|
|
||||||
post = "host=%s&id=%s" % (server, id)
|
|
||||||
itemlist.append(item.clone(action="play", url="http://server-2-stream.animemovil.com/V2/", title=title,
|
|
||||||
post=post))
|
|
||||||
|
|
||||||
downl = scrapertools.find_single_match(data, '<div class="descargarCap">.*?<a href="([^"]+)"')
|
info = scrapertools.find_single_match(data, 'episodio_info=(.*?);')
|
||||||
if downl:
|
dict_info = jsontools.load(info)
|
||||||
downl = downl.replace("&", "&")
|
|
||||||
itemlist.append(item.clone(action="play", title="Descarga - %s" % item.title, url=downl, server="directo"))
|
|
||||||
|
|
||||||
if not itemlist:
|
|
||||||
itemlist.append(Item(channel=item.channel, title="No hay vídeos disponibles", action=""))
|
|
||||||
if item.extra == "recientes":
|
|
||||||
url = scrapertools.find_single_match(data, '<a class="CapList".*?href="([^"]+)"')
|
|
||||||
if url:
|
|
||||||
url = host + url
|
|
||||||
itemlist.append(item.clone(action="episodios", title="Ir a lista de capítulos", url=url, text_color=color1))
|
|
||||||
elif item.contentType == "movie" and config.get_library_support():
|
|
||||||
if "No hay vídeos disponibles" not in itemlist[0].title:
|
|
||||||
itemlist.append(Item(channel=item.channel, title="Añadir película a la biblioteca", url=item.url,
|
|
||||||
action="add_pelicula_to_library", contentTitle=item.contentTitle, text_color=color4,
|
|
||||||
thumbnail=item.thumbnail, fanart=item.fanart))
|
|
||||||
|
|
||||||
return itemlist
|
servers = dict_info['stream']['servers']
|
||||||
|
id = dict_info['id']
|
||||||
|
access_point = dict_info['stream']['accessPoint']
|
||||||
|
expire = dict_info['stream']['expire']
|
||||||
|
callback = dict_info['stream']['callback']
|
||||||
|
signature = dict_info['stream']['signature']
|
||||||
|
last_modify = dict_info['stream']['last_modify']
|
||||||
|
|
||||||
|
for server in servers:
|
||||||
|
stream_info = 'http:%s/%s/%s?expire=%s&callback=%s&signature=%s&last_modify=%s' % \
|
||||||
|
(access_point, id, server, expire, callback, signature, last_modify)
|
||||||
|
|
||||||
def play(item):
|
dict_stream = jsontools.load(httptools.downloadpage(stream_info).data)
|
||||||
logger.info()
|
|
||||||
|
|
||||||
if item.server:
|
if dict_stream['status']:
|
||||||
return [item]
|
kind = dict_stream['result']['kind']
|
||||||
|
try:
|
||||||
|
if kind == 'iframe':
|
||||||
|
url = dict_stream['result']['src']
|
||||||
|
title = '%s (%s)' % (item.title, server)
|
||||||
|
elif kind == 'jwplayer':
|
||||||
|
url_style = dict_stream['result']['setup']
|
||||||
|
if server != 'rin':
|
||||||
|
|
||||||
itemlist = []
|
if 'playlist' in url_style:
|
||||||
|
part = 1
|
||||||
|
for media_list in url_style['playlist']:
|
||||||
|
url = media_list['file']
|
||||||
|
title = '%s (%s) - parte %s' % (item.title, server, part)
|
||||||
|
itemlist.append(item.clone(title=title, url=url, action='play'))
|
||||||
|
part += 1
|
||||||
|
else:
|
||||||
|
url = url_style['file']
|
||||||
|
title = '%s (%s)' % (item.title, server)
|
||||||
|
else:
|
||||||
|
src_list = url_style['sources']
|
||||||
|
for source in src_list:
|
||||||
|
url = source['file']
|
||||||
|
quality = source['label']
|
||||||
|
title = '%s [%s](%s)' % (item.title, quality, server)
|
||||||
|
itemlist.append(item.clone(title=title, url=url, action='play'))
|
||||||
|
|
||||||
data = jsontools.load(httptools.downloadpage(item.url, item.post).data)
|
elif kind == 'javascript':
|
||||||
if data["jwplayer"] == False:
|
if 'jsCode' in dict_stream['result']:
|
||||||
content = data["eval"]["contenido"]
|
jscode = dict_stream['result']['jsCode']
|
||||||
urls = scrapertools.find_multiple_matches(content, 'file\s*:\s*"([^"]+)"')
|
url = scrapertools.find_single_match(jscode, 'xmlhttp.open\("GET", "(.*?)"')
|
||||||
if not urls:
|
title = '%s (%s)' % (item.title, server)
|
||||||
urls = scrapertools.find_multiple_matches(content, '"GET","([^"]+)"')
|
|
||||||
for url in urls:
|
if url != '':
|
||||||
if "mediafire" in url:
|
itemlist.append(item.clone(title=title, url=url, action='play'))
|
||||||
data_mf = httptools.downloadpage(url).data
|
except:
|
||||||
url = scrapertools.find_single_match(data_mf, 'kNO\s*=\s*"([^"]+)"')
|
pass
|
||||||
ext = url[-4:]
|
itemlist = servertools.get_servers_itemlist(itemlist)
|
||||||
itemlist.insert(0, ["%s [directo]" % ext, url])
|
|
||||||
else:
|
|
||||||
if data["jwplayer"].get("sources"):
|
|
||||||
for source in data["jwplayer"]["sources"]:
|
|
||||||
label = source.get("label", "")
|
|
||||||
ext = source.get("type", "")
|
|
||||||
if ext and "/" in ext:
|
|
||||||
ext = ".%s " % ext.rsplit("/", 1)[1]
|
|
||||||
url = source.get("file")
|
|
||||||
if "server-3-stream" in url:
|
|
||||||
url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location")
|
|
||||||
itemlist.insert(0, ["%s%s [directo]" % (ext, label), url])
|
|
||||||
elif data["jwplayer"].get("file"):
|
|
||||||
label = data["jwplayer"].get("label", "")
|
|
||||||
url = data["jwplayer"]["file"]
|
|
||||||
ext = data["jwplayer"].get("type", "")
|
|
||||||
if ext and "/" in ext:
|
|
||||||
ext = "%s " % ext.rsplit("/", 1)[1]
|
|
||||||
if "server-3-stream" in url:
|
|
||||||
url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location")
|
|
||||||
itemlist.insert(0, [".%s%s [directo]" % (ext, label), url])
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -392,7 +348,7 @@ def newest(categoria):
|
|||||||
logger.info()
|
logger.info()
|
||||||
item = Item()
|
item = Item()
|
||||||
try:
|
try:
|
||||||
item.url = "http://skanime.net/"
|
item.url = host
|
||||||
item.extra = "novedades"
|
item.extra = "novedades"
|
||||||
itemlist = recientes(item)
|
itemlist = recientes(item)
|
||||||
# Se captura la excepción, para no interrumpir al canal novedades si un canal falla
|
# Se captura la excepción, para no interrumpir al canal novedades si un canal falla
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import urllib
|
|||||||
from core import httptools
|
from core import httptools
|
||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
from core import servertools
|
from core import servertools
|
||||||
|
from channelselector import get_thumb
|
||||||
from core import tmdb
|
from core import tmdb
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import logger, config
|
from platformcode import logger, config
|
||||||
@@ -40,14 +41,14 @@ def mainlist(item):
|
|||||||
|
|
||||||
itemlist.append(item.clone(title="Ultimas",
|
itemlist.append(item.clone(title="Ultimas",
|
||||||
action="lista",
|
action="lista",
|
||||||
thumbnail='https://s22.postimg.org/cb7nmhwv5/ultimas.png',
|
thumbnail=get_thumb('last', auto=True),
|
||||||
fanart='https://s22.postimg.org/cb7nmhwv5/ultimas.png',
|
fanart='https://s22.postimg.org/cb7nmhwv5/ultimas.png',
|
||||||
url=host + '/ultimos'
|
url=host + '/ultimos'
|
||||||
))
|
))
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Todas",
|
itemlist.append(item.clone(title="Todas",
|
||||||
action="lista",
|
action="lista",
|
||||||
thumbnail='https://s18.postimg.org/fwvaeo6qh/todas.png',
|
thumbnail=get_thumb('all', auto=True),
|
||||||
fanart='https://s18.postimg.org/fwvaeo6qh/todas.png',
|
fanart='https://s18.postimg.org/fwvaeo6qh/todas.png',
|
||||||
url=host + '/buscar?t=todos&q='
|
url=host + '/buscar?t=todos&q='
|
||||||
))
|
))
|
||||||
@@ -55,14 +56,14 @@ def mainlist(item):
|
|||||||
itemlist.append(item.clone(title="Generos",
|
itemlist.append(item.clone(title="Generos",
|
||||||
action="generos",
|
action="generos",
|
||||||
url=host,
|
url=host,
|
||||||
thumbnail='https://s3.postimg.org/5s9jg2wtf/generos.png',
|
thumbnail=get_thumb('genres', auto=True),
|
||||||
fanart='https://s3.postimg.org/5s9jg2wtf/generos.png'
|
fanart='https://s3.postimg.org/5s9jg2wtf/generos.png'
|
||||||
))
|
))
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Buscar",
|
itemlist.append(item.clone(title="Buscar",
|
||||||
action="search",
|
action="search",
|
||||||
url=host + '/buscar?t=todos&q=',
|
url=host + '/buscar?t=todos&q=',
|
||||||
thumbnail='https://s30.postimg.org/pei7txpa9/buscar.png',
|
thumbnail=get_thumb('search', auto=True),
|
||||||
fanart='https://s30.postimg.org/pei7txpa9/buscar.png'
|
fanart='https://s30.postimg.org/pei7txpa9/buscar.png'
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ host = "http://www.anitoonstv.com"
|
|||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
thumb_series = get_thumb("channels_tvshow.png")
|
thumb_series = get_thumb("tvshows", auto=True)
|
||||||
autoplay.init(item.channel, list_servers, list_quality)
|
autoplay.init(item.channel, list_servers, list_quality)
|
||||||
|
|
||||||
itemlist = list()
|
itemlist = list()
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from core import scrapertools
|
|||||||
from core import servertools
|
from core import servertools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
|
from channelselector import get_thumb
|
||||||
|
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
@@ -15,13 +16,13 @@ def mainlist(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
itemlist.append(Item(channel=item.channel, title="Películas", action="menupeliculas",
|
itemlist.append(Item(channel=item.channel, title="Películas", action="menupeliculas",
|
||||||
url="http://www.bajui.org/descargas/categoria/2/peliculas",
|
url="http://www.bajui.org/descargas/categoria/2/peliculas",
|
||||||
fanart=item.fanart))
|
fanart=item.fanart, thumbnail=get_thumb('movies', auto=True)))
|
||||||
itemlist.append(Item(channel=item.channel, title="Series", action="menuseries",
|
itemlist.append(Item(channel=item.channel, title="Series", action="menuseries",
|
||||||
fanart=item.fanart))
|
fanart=item.fanart, thumbnail=get_thumb('tvshows', auto=True)))
|
||||||
itemlist.append(Item(channel=item.channel, title="Documentales", action="menudocumentales",
|
itemlist.append(Item(channel=item.channel, title="Documentales", action="menudocumentales",
|
||||||
fanart=item.fanart))
|
fanart=item.fanart, thumbnail=get_thumb('documentaries', auto=True)))
|
||||||
itemlist.append(Item(channel=item.channel, title="Buscar", action="search",
|
itemlist.append(Item(channel=item.channel, title="Buscar", action="search",
|
||||||
fanart=item.fanart))
|
fanart=item.fanart, thumbnail=get_thumb('search', auto=True)))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ from core.item import Item
|
|||||||
from core import channeltools
|
from core import channeltools
|
||||||
from core import tmdb
|
from core import tmdb
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
from channelselector import get_thumb
|
||||||
|
|
||||||
__channel__ = "canalpelis"
|
__channel__ = "canalpelis"
|
||||||
|
|
||||||
@@ -51,24 +52,24 @@ def mainlist(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Peliculas", action="peliculas",thumbnail=thumbnail % 'peliculas',
|
itemlist.append(item.clone(title="Peliculas", action="peliculas",thumbnail=get_thumb('movies', auto=True),
|
||||||
text_blod=True, page=0, viewcontent='movies',
|
text_blod=True, page=0, viewcontent='movies',
|
||||||
url=host + 'movies/', viewmode="movie_with_plot"))
|
url=host + 'movies/', viewmode="movie_with_plot"))
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Géneros", action="generos",thumbnail=thumbnail % 'generos',
|
itemlist.append(item.clone(title="Géneros", action="generos",thumbnail=get_thumb('genres', auto=True),
|
||||||
text_blod=True, page=0, viewcontent='movies',
|
text_blod=True, page=0, viewcontent='movies',
|
||||||
url=host + 'genre/', viewmode="movie_with_plot"))
|
url=host + 'genre/', viewmode="movie_with_plot"))
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Año de Estreno", action="year_release",
|
itemlist.append(item.clone(title="Año de Estreno", action="year_release", thumbnail=get_thumb('year', auto=True),
|
||||||
text_blod=True, page=0, viewcontent='movies',
|
text_blod=True, page=0, viewcontent='movies', url=host + 'release/',
|
||||||
url=host + 'release/', viewmode="movie_with_plot"))
|
viewmode="movie_with_plot"))
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Buscar", action="search",thumbnail=thumbnail % 'busqueda',
|
itemlist.append(item.clone(title="Buscar", action="search",thumbnail=get_thumb('search', auto=True),
|
||||||
text_blod=True, url=host, page=0))
|
text_blod=True, url=host, page=0))
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Series", action="series", extra='serie', url=host + 'tvshows/',
|
itemlist.append(item.clone(title="Series", action="series", extra='serie', url=host + 'tvshows/',
|
||||||
viewmode="movie_with_plot", text_blod=True, viewcontent='movies',
|
viewmode="movie_with_plot", text_blod=True, viewcontent='movies',
|
||||||
thumbnail=thumbnail % 'series', page=0))
|
thumbnail=get_thumb('tvshows', auto=True), page=0))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ list_quality = ['default']
|
|||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
thumb_series = get_thumb("channels_tvshow.png")
|
thumb_series = get_thumb('tvshows', auto=True)
|
||||||
autoplay.init(item.channel, list_servers, list_quality)
|
autoplay.init(item.channel, list_servers, list_quality)
|
||||||
itemlist = list()
|
itemlist = list()
|
||||||
itemlist.append(Item(channel=item.channel, action="lista", title="Series", url=host,
|
itemlist.append(Item(channel=item.channel, action="lista", title="Series", url=host,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from core import servertools
|
|||||||
from core import tmdb
|
from core import tmdb
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
from channelselector import get_thumb
|
||||||
__channel__='ciberpeliculashd'
|
__channel__='ciberpeliculashd'
|
||||||
|
|
||||||
host = "http://ciberpeliculashd.net"
|
host = "http://ciberpeliculashd.net"
|
||||||
@@ -21,16 +21,23 @@ def mainlist(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
itemlist.append(Item(channel = item.channel, title = "Películas", text_bold = True, folder = False))
|
itemlist.append(Item(channel = item.channel, title = "Películas", text_bold = True, folder = False))
|
||||||
itemlist.append(Item(channel = item.channel, title = " Novedades", action = "peliculas", url = host + "/?peli=1"))
|
itemlist.append(Item(channel = item.channel, title = " Novedades", action = "peliculas", url = host + "/?peli=1",
|
||||||
itemlist.append(Item(channel = item.channel, title = " Por género", action = "filtro", url = host, extra = "categories" ))
|
thumbnail=get_thumb('newest', auto=True)))
|
||||||
itemlist.append(Item(channel = item.channel, title = " Por calidad", action = "filtro", url = host, extra = "qualitys"))
|
itemlist.append(Item(channel = item.channel, title = " Por género", action = "filtro", url = host,
|
||||||
itemlist.append(Item(channel = item.channel, title = " Por idioma", action = "filtro", url = host, extra = "languages"))
|
extra = "categories", thumbnail=get_thumb('genres', auto=True)))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = " Por calidad", action = "filtro", url = host,
|
||||||
|
extra = "qualitys", thumbnail=get_thumb('quality', auto=True)))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = " Por idioma", action = "filtro", url = host,
|
||||||
|
extra = "languages", thumbnail=get_thumb('language', auto=True)))
|
||||||
itemlist.append(Item(channel = item.channel, title = ""))
|
itemlist.append(Item(channel = item.channel, title = ""))
|
||||||
itemlist.append(Item(channel = item.channel, title = "Series", text_bold = True, folder = False))
|
itemlist.append(Item(channel = item.channel, title = "Series", text_bold = True, folder = False))
|
||||||
itemlist.append(Item(channel = item.channel, title = " Novedades", action = "series", url = host + "/series/?peli=1"))
|
itemlist.append(Item(channel = item.channel, title = " Novedades", action = "series",
|
||||||
itemlist.append(Item(channel = item.channel, title = " Nuevos Capitulos", action = "nuevos_capitulos", url = host + "/series/?peli=1"))
|
url = host +"/series/?peli=1", thumbnail=get_thumb('newest', auto=True)))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = " Nuevos Capitulos", action = "nuevos_capitulos",
|
||||||
|
url = host + "/series/?peli=1", thumbnail=get_thumb('new episodes', auto=True)))
|
||||||
itemlist.append(Item(channel = item.channel, title = ""))
|
itemlist.append(Item(channel = item.channel, title = ""))
|
||||||
itemlist.append(Item(channel = item.channel, title = "Buscar", action = "search", url = host + "/?s="))
|
itemlist.append(Item(channel = item.channel, title = "Buscar", action = "search", url = host + "/?s=",
|
||||||
|
thumbnail=get_thumb('search', auto=True)))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def nuevos_capitulos(item):
|
def nuevos_capitulos(item):
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from core import servertools
|
|||||||
from core import tmdb
|
from core import tmdb
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
from channelselector import get_thumb
|
||||||
|
|
||||||
host = "http://www.cineasiaenlinea.com/"
|
host = "http://www.cineasiaenlinea.com/"
|
||||||
__channel__='cineasiaenlinea'
|
__channel__='cineasiaenlinea'
|
||||||
@@ -36,19 +37,19 @@ def mainlist(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
itemlist.append(item.clone(action="peliculas", title="Novedades", url=host + "archivos/peliculas",
|
itemlist.append(item.clone(action="peliculas", title="Novedades", url=host + "archivos/peliculas",
|
||||||
thumbnail="https://raw.githubusercontent.com/master-1970/resources/master/images/genres"
|
thumbnail=get_thumb('newest', auto=True), text_color=color1,))
|
||||||
"/0/Directors%20Chair.png", text_color=color1))
|
|
||||||
itemlist.append(item.clone(action="peliculas", title="Estrenos", url=host + "archivos/estrenos",
|
itemlist.append(item.clone(action="peliculas", title="Estrenos", url=host + "archivos/estrenos",
|
||||||
thumbnail="https://raw.githubusercontent.com/master-1970/resources/master/images/genres"
|
thumbnail=get_thumb('premieres', auto=True), text_color=color1))
|
||||||
"/0/Directors%20Chair.png", text_color=color1))
|
|
||||||
itemlist.append(item.clone(action="indices", title="Por géneros", url=host,
|
itemlist.append(item.clone(action="indices", title="Por géneros", url=host,
|
||||||
thumbnail="https://raw.githubusercontent.com/master-1970/resources/master/images/genres"
|
thumbnail=get_thumb('genres', auto=True), text_color=color1))
|
||||||
"/0/Genre.png", text_color=color1))
|
itemlist.append(item.clone(action="indices", title="Por país", url=host, text_color=color1,
|
||||||
itemlist.append(item.clone(action="indices", title="Por país", url=host, text_color=color1))
|
thumbnail=get_thumb('country', auto=True)))
|
||||||
itemlist.append(item.clone(action="indices", title="Por año", url=host, text_color=color1))
|
itemlist.append(item.clone(action="indices", title="Por año", url=host, text_color=color1,
|
||||||
|
thumbnail=get_thumb('year', auto=True)))
|
||||||
|
|
||||||
itemlist.append(item.clone(title="", action=""))
|
itemlist.append(item.clone(title="", action=""))
|
||||||
itemlist.append(item.clone(action="search", title="Buscar...", text_color=color3))
|
itemlist.append(item.clone(action="search", title="Buscar...", text_color=color3,
|
||||||
|
thumbnail=get_thumb('search', auto=True)))
|
||||||
itemlist.append(item.clone(action="configuracion", title="Configurar canal...", text_color="gold", folder=False))
|
itemlist.append(item.clone(action="configuracion", title="Configurar canal...", text_color="gold", folder=False))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ from core import servertools
|
|||||||
from core import tmdb
|
from core import tmdb
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
from channelselector import get_thumb
|
||||||
|
|
||||||
IDIOMAS = {'latino': 'Latino', 'castellano': 'Español', 'portugues': 'Portugues'}
|
IDIOMAS = {'latino': 'Latino', 'castellano': 'Español', 'portugues': 'Portugues'}
|
||||||
list_language = IDIOMAS.values()
|
list_language = IDIOMAS.values()
|
||||||
logger.debug('lista_language: %s' % list_language)
|
|
||||||
|
|
||||||
list_quality = ['1080p', '720p', '480p', '360p', '240p', 'default']
|
list_quality = ['1080p', '720p', '480p', '360p', '240p', 'default']
|
||||||
list_servers = [
|
list_servers = [
|
||||||
@@ -86,35 +86,35 @@ def submenu(item):
|
|||||||
title=idioma.capitalize(),
|
title=idioma.capitalize(),
|
||||||
action="peliculas",
|
action="peliculas",
|
||||||
url=host,
|
url=host,
|
||||||
thumbnail='https://s8.postimg.org/6wqwy2c2t/peliculas.png',
|
thumbnail=get_thumb('movies', auto=True),
|
||||||
fanart='https://s8.postimg.org/6wqwy2c2t/peliculas.png',
|
fanart='https://s8.postimg.org/6wqwy2c2t/peliculas.png',
|
||||||
))
|
))
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
title="Destacadas",
|
title="Destacadas",
|
||||||
action="peliculas",
|
action="peliculas",
|
||||||
url=host + "/genero-" + idioma + "/" + idioma2 + "/",
|
url=host + "/genero-" + idioma + "/" + idioma2 + "/",
|
||||||
thumbnail='https://s30.postimg.org/humqxklsx/destacadas.png',
|
thumbnail=get_thumb('hot', auto=True),
|
||||||
fanart='https://s30.postimg.org/humqxklsx/destacadas.png',
|
fanart='https://s30.postimg.org/humqxklsx/destacadas.png',
|
||||||
))
|
))
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
title="Generos",
|
title="Generos",
|
||||||
action="generos",
|
action="generos",
|
||||||
url=host + "/genero-" + idioma,
|
url=host + "/genero-" + idioma,
|
||||||
thumbnail='https://s3.postimg.org/5s9jg2wtf/generos.png',
|
thumbnail=get_thumb('genres', auto=True),
|
||||||
fanart='https://s3.postimg.org/5s9jg2wtf/generos.png',
|
fanart='https://s3.postimg.org/5s9jg2wtf/generos.png',
|
||||||
))
|
))
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
title="Por Año",
|
title="Por Año",
|
||||||
action="anyos",
|
action="anyos",
|
||||||
url=host + "/" + idioma + "-por-ano",
|
url=host + "/" + idioma + "-por-ano",
|
||||||
thumbnail='https://s8.postimg.org/7eoedwfg5/pora_o.png',
|
thumbnail=get_thumb('year', auto=True),
|
||||||
fanart='https://s8.postimg.org/7eoedwfg5/pora_o.png',
|
fanart='https://s8.postimg.org/7eoedwfg5/pora_o.png',
|
||||||
))
|
))
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
title="Buscar",
|
title="Buscar",
|
||||||
action="search",
|
action="search",
|
||||||
thumbnail='https://s30.postimg.org/pei7txpa9/buscar.png',
|
thumbnail=get_thumb('search', auto=True),
|
||||||
url=host + '/apiseries/seriebyword/',
|
url=host + '/?s=',
|
||||||
fanart='https://s30.postimg.org/pei7txpa9/buscar.png',
|
fanart='https://s30.postimg.org/pei7txpa9/buscar.png',
|
||||||
host=item.host,
|
host=item.host,
|
||||||
))
|
))
|
||||||
@@ -350,15 +350,12 @@ def get_urls(item, link):
|
|||||||
|
|
||||||
data = httptools.downloadpage(url, post=post, headers=headers).data
|
data = httptools.downloadpage(url, post=post, headers=headers).data
|
||||||
dict_data = jsontools.load(data)
|
dict_data = jsontools.load(data)
|
||||||
logger.debug(dict_data['link'])
|
|
||||||
logger.debug(data)
|
|
||||||
return dict_data['link']
|
return dict_data['link']
|
||||||
|
|
||||||
|
|
||||||
def play(item):
|
def play(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
logger.debug('item: %s' % item)
|
|
||||||
if 'juicyapi' not in item.url:
|
if 'juicyapi' not in item.url:
|
||||||
itemlist = servertools.find_video_items(data=item.url)
|
itemlist = servertools.find_video_items(data=item.url)
|
||||||
|
|
||||||
@@ -397,72 +394,9 @@ def newest(categoria):
|
|||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def busqueda(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
# Descarga la página
|
|
||||||
data = httptools.downloadpage(item.url).data
|
|
||||||
|
|
||||||
from core import jsontools
|
|
||||||
data = jsontools.load(data)
|
|
||||||
|
|
||||||
for entry in data["results"]:
|
|
||||||
title = entry["richSnippet"]["metatags"]["ogTitle"]
|
|
||||||
url = entry["url"]
|
|
||||||
plot = entry["content"]
|
|
||||||
plot = scrapertools.htmlclean(plot)
|
|
||||||
thumbnail = entry["richSnippet"]["metatags"]["ogImage"]
|
|
||||||
title = scrapertools.find_single_match(title, '(.*?) \(.*?\)')
|
|
||||||
year = re.sub(r'.*?\((\d{4})\)', '', title)
|
|
||||||
title = year
|
|
||||||
fulltitle = title
|
|
||||||
|
|
||||||
new_item = item.clone(action="findvideos",
|
|
||||||
title=title,
|
|
||||||
fulltitle=fulltitle,
|
|
||||||
url=url,
|
|
||||||
thumbnail=thumbnail,
|
|
||||||
contentTitle=title,
|
|
||||||
contentType="movie",
|
|
||||||
plot=plot,
|
|
||||||
infoLabels={'year': year, 'sinopsis': plot}
|
|
||||||
)
|
|
||||||
itemlist.append(new_item)
|
|
||||||
|
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
|
||||||
|
|
||||||
actualpage = int(scrapertools.find_single_match(item.url, 'start=(\d+)'))
|
|
||||||
totalresults = int(data["cursor"]["resultCount"])
|
|
||||||
if actualpage + 20 <= totalresults:
|
|
||||||
url_next = item.url.replace("start=" + str(actualpage), "start=" + str(actualpage + 20))
|
|
||||||
itemlist.append(
|
|
||||||
Item(channel=item.channel,
|
|
||||||
action="busqueda",
|
|
||||||
title=">> Página Siguiente",
|
|
||||||
url=url_next
|
|
||||||
))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
texto = texto.replace(" ", "-")
|
||||||
data = httptools.downloadpage(host).data
|
item.url = host + '/?s=' + texto
|
||||||
cx = scrapertools.find_single_match(data, 'name="cx" value="(.*?)"')
|
if texto != '':
|
||||||
texto = texto.replace(" ", "%20")
|
return peliculas(item)
|
||||||
item.url = "https://www.googleapis.com/customsearch/v1element?key=AIzaSyCVAXiUzRYsML1Pv6RwSG1gunmMikTzQqY&rsz" \
|
|
||||||
"=filtered_cse&num=20&hl=es&sig=0c3990ce7a056ed50667fe0c3873c9b6&cx=%s&q=%s&sort=&googlehost=www" \
|
|
||||||
".google.com&start=0" % (cx, texto)
|
|
||||||
|
|
||||||
try:
|
|
||||||
return busqueda(item)
|
|
||||||
# Se captura la excepción, para no interrumpir al buscador global si un canal falla
|
|
||||||
except:
|
|
||||||
import sys
|
|
||||||
for line in sys.exc_info():
|
|
||||||
logger.error("%s" % line)
|
|
||||||
return []
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ from core import scrapertools
|
|||||||
from core import servertools
|
from core import servertools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
from channelselector import get_thumb
|
||||||
|
|
||||||
__modo_grafico__ = config.get_setting('modo_grafico', 'cinefox')
|
__modo_grafico__ = config.get_setting('modo_grafico', 'cinefox')
|
||||||
__perfil__ = int(config.get_setting('perfil', "cinefox"))
|
__perfil__ = int(config.get_setting('perfil', "cinefox"))
|
||||||
@@ -32,20 +33,22 @@ def mainlist(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
itemlist.append(item.clone(action="seccion_peliculas", title="Películas", fanart="http://i.imgur.com/PjJaW8o.png",
|
itemlist.append(item.clone(action="seccion_peliculas", title="Películas", fanart="http://i.imgur.com/PjJaW8o.png",
|
||||||
url=host + "/catalogue?type=peliculas"))
|
url=host + "/catalogue?type=peliculas", thumbnail=get_thumb('movies', auto=True)))
|
||||||
# Seccion series
|
# Seccion series
|
||||||
itemlist.append(item.clone(action="seccion_series", title="Series",
|
itemlist.append(item.clone(action="seccion_series", title="Series",
|
||||||
url=host + "/ultimos-capitulos", fanart="http://i.imgur.com/9loVksV.png"))
|
url=host + "/ultimos-capitulos", fanart="http://i.imgur.com/9loVksV.png",
|
||||||
|
thumbnail=get_thumb('tvshows', auto=True)))
|
||||||
|
|
||||||
itemlist.append(item.clone(action="peliculas", title="Documentales", fanart="http://i.imgur.com/Q7fsFI6.png",
|
itemlist.append(item.clone(action="peliculas", title="Documentales", fanart="http://i.imgur.com/Q7fsFI6.png",
|
||||||
url=host + "/catalogue?type=peliculas&genre=documental"))
|
url=host + "/catalogue?type=peliculas&genre=documental",
|
||||||
|
thumbnail=get_thumb('documentaries', auto=True)))
|
||||||
|
|
||||||
if config.get_setting("adult_mode") != 0:
|
if config.get_setting("adult_mode") != 0:
|
||||||
itemlist.append(item.clone(action="peliculas", title="Sección Adultos +18",
|
itemlist.append(item.clone(action="peliculas", title="Sección Adultos +18",
|
||||||
url=host + "/catalogue?type=adultos",
|
url=host + "/catalogue?type=adultos",
|
||||||
fanart="http://i.imgur.com/kIvE1Zh.png"))
|
fanart="http://i.imgur.com/kIvE1Zh.png", thumbnail=get_thumb('adults', auto=True)))
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Buscar...", action="local_search"))
|
itemlist.append(item.clone(title="Buscar...", action="local_search", thumbnail=get_thumb('search', auto=True)))
|
||||||
itemlist.append(item.clone(title="Configurar canal...", text_color="gold", action="configuracion", folder=False))
|
itemlist.append(item.clone(title="Configurar canal...", text_color="gold", action="configuracion", folder=False))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -254,9 +257,10 @@ def seccion_peliculas(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
# Seccion peliculas
|
# Seccion peliculas
|
||||||
itemlist.append(item.clone(action="peliculas", title="Novedades", fanart="http://i.imgur.com/PjJaW8o.png",
|
itemlist.append(item.clone(action="peliculas", title="Novedades", fanart="http://i.imgur.com/PjJaW8o.png",
|
||||||
url=host + "/catalogue?type=peliculas"))
|
url=host + "/catalogue?type=peliculas", thumbnail=get_thumb('newest', auto=True)))
|
||||||
itemlist.append(item.clone(action="peliculas", title="Estrenos",
|
itemlist.append(item.clone(action="peliculas", title="Estrenos",
|
||||||
url=host + "/estrenos-de-cine", fanart="http://i.imgur.com/PjJaW8o.png"))
|
url=host + "/estrenos-de-cine", fanart="http://i.imgur.com/PjJaW8o.png",
|
||||||
|
thumbnail=get_thumb('premieres', auto=True)))
|
||||||
itemlist.append(item.clone(action="filtro", title="Filtrar películas", extra="peliculas",
|
itemlist.append(item.clone(action="filtro", title="Filtrar películas", extra="peliculas",
|
||||||
url=host + "/catalogue?type=peliculas",
|
url=host + "/catalogue?type=peliculas",
|
||||||
fanart="http://i.imgur.com/PjJaW8o.png"))
|
fanart="http://i.imgur.com/PjJaW8o.png"))
|
||||||
@@ -281,10 +285,11 @@ def seccion_series(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
# Seccion series
|
# Seccion series
|
||||||
itemlist.append(item.clone(action="ultimos", title="Últimos capítulos",
|
itemlist.append(item.clone(action="ultimos", title="Últimos capítulos",
|
||||||
url=host + "/ultimos-capitulos", fanart="http://i.imgur.com/9loVksV.png"))
|
url=host + "/ultimos-capitulos", fanart="http://i.imgur.com/9loVksV.png",
|
||||||
|
thumbnail=get_thumb('new episodes', auto=True)))
|
||||||
itemlist.append(item.clone(action="series", title="Series recientes",
|
itemlist.append(item.clone(action="series", title="Series recientes",
|
||||||
url=host + "/catalogue?type=series",
|
url=host + "/catalogue?type=series",
|
||||||
fanart="http://i.imgur.com/9loVksV.png"))
|
fanart="http://i.imgur.com/9loVksV.png", thumbnail=get_thumb('recents', auto=True)))
|
||||||
itemlist.append(item.clone(action="filtro", title="Filtrar series", extra="series",
|
itemlist.append(item.clone(action="filtro", title="Filtrar series", extra="series",
|
||||||
url=host + "/catalogue?type=series",
|
url=host + "/catalogue?type=series",
|
||||||
fanart="http://i.imgur.com/9loVksV.png"))
|
fanart="http://i.imgur.com/9loVksV.png"))
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ from core import servertools
|
|||||||
from core import tmdb
|
from core import tmdb
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
from channelselector import get_thumb
|
||||||
|
|
||||||
host = 'http://verhdpelis.com/'
|
host = 'http://verhdpelis.com/'
|
||||||
headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'],
|
headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'],
|
||||||
@@ -49,21 +50,20 @@ def mainlist(item):
|
|||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Todas", action="lista", thumbnail='https://s18.postimg.org/fwvaeo6qh/todas.png',
|
itemlist.append(item.clone(title="Todas", action="lista", thumbnail=get_thumb('all', auto=True),
|
||||||
fanart='https://s18.postimg.org/fwvaeo6qh/todas.png', extra='peliculas/',
|
fanart='https://s18.postimg.org/fwvaeo6qh/todas.png', extra='peliculas/',
|
||||||
url=host + 'page/1.html'))
|
url=host + 'page/1.html'))
|
||||||
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
itemlist[-1].clone(title="Generos", action="generos", thumbnail='https://s3.postimg.org/5s9jg2wtf/generos.png',
|
itemlist[-1].clone(title="Generos", action="generos", thumbnail=get_thumb('genres', auto=True),
|
||||||
fanart='https://s3.postimg.org/5s9jg2wtf/generos.png', url=host))
|
fanart='https://s3.postimg.org/5s9jg2wtf/generos.png', url=host))
|
||||||
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
itemlist[-1].clone(title="Mas Vistas", action="lista", thumbnail='https://s9.postimg.org/wmhzu9d7z/vistas.png',
|
itemlist[-1].clone(title="Mas Vistas", action="lista", thumbnail=get_thumb('more watched', auto=True),
|
||||||
fanart='https://s9.postimg.org/wmhzu9d7z/vistas.png',
|
fanart='https://s9.postimg.org/wmhzu9d7z/vistas.png',
|
||||||
url=host + 'top-peliculas-online/1.html'))
|
url=host + 'top-peliculas-online/1.html'))
|
||||||
|
|
||||||
itemlist.append(itemlist[-1].clone(title="Buscar", action="search",
|
itemlist.append(itemlist[-1].clone(title="Buscar", action="search", thumbnail=get_thumb('search', auto=True),
|
||||||
thumbnail='https://s30.postimg.org/pei7txpa9/buscar.png',
|
|
||||||
fanart='https://s30.postimg.org/pei7txpa9/buscar.png', url=host + 'search/'))
|
fanart='https://s30.postimg.org/pei7txpa9/buscar.png', url=host + 'search/'))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
@@ -19,12 +19,17 @@ def mainlist(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
itemlist = list()
|
itemlist = list()
|
||||||
itemlist.append(item.clone(title="Ultimas", action="list_all", url=host))
|
itemlist.append(item.clone(title="Ultimas", action="list_all", url=host, thumbnail=get_thumb('last', auto=True)))
|
||||||
itemlist.append(item.clone(title="Generos", action="section", section='genre'))
|
itemlist.append(item.clone(title="Generos", action="section", section='genre',
|
||||||
itemlist.append(item.clone(title="Por Calidad", action="section", section='quality'))
|
thumbnail=get_thumb('genres', auto=True)))
|
||||||
itemlist.append(item.clone(title="Por Año", action="section", section='year'))
|
itemlist.append(item.clone(title="Por Calidad", action="section", section='quality',
|
||||||
itemlist.append(item.clone(title="Alfabetico", action="section", section='alpha'))
|
thumbnail=get_thumb('quality', auto=True)))
|
||||||
itemlist.append(item.clone(title="Buscar", action="search", url=host+'?s='))
|
itemlist.append(item.clone(title="Por Año", action="section", section='year',
|
||||||
|
thumbnail=get_thumb('year', auto=True)))
|
||||||
|
itemlist.append(item.clone(title="Alfabetico", action="section", section='alpha',
|
||||||
|
thumbnail=get_thumb('alphabet', auto=True)))
|
||||||
|
itemlist.append(item.clone(title="Buscar", action="search", url=host+'?s=',
|
||||||
|
thumbnail=get_thumb('search', auto=True)))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -40,13 +45,15 @@ def list_all(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
|
data = get_source(item.url)
|
||||||
|
|
||||||
if item.section == 'alpha':
|
if item.section == 'alpha':
|
||||||
patron = '<span class=Num>\d+.*?<a href=(.*?) class.*?<img src=(.*?) alt=.*?<strong>(.*?)</strong>.*?'
|
patron = '<span class=Num>\d+.*?<a href=(.*?) class.*?<img src=(.*?) alt=.*?<strong>(.*?)</strong>.*?'
|
||||||
patron += '<td>(\d{4})</td>.*?Qlty>(.*?)</span>'
|
patron += '<td>(\d{4})</td>.*?Qlty>(.*?)</span>'
|
||||||
else:
|
else:
|
||||||
patron = '<article id=post-.*?<a href=(.*?)>.*?<img src=(.*?) alt=.*?'
|
patron = '<article id=post-.*?<a href=(.*?)>.*?<img src=(.*?) alt=.*?'
|
||||||
patron += '<h2 class=Title>(.*?)<\/h2>.*?<span class=Year>(.*?)<\/span>.*?Qlty>(.*?)<\/span>'
|
patron += '<h2 class=Title>(.*?)<\/h2>.*?<span class=Year>(.*?)<\/span>.*?Qlty>(.*?)<\/span>'
|
||||||
|
data = get_source(item.url)
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
for scrapedurl, scrapedthumbnail, scrapedtitle, year, quality in matches:
|
for scrapedurl, scrapedthumbnail, scrapedtitle, year, quality in matches:
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from core import servertools
|
|||||||
from core import tmdb
|
from core import tmdb
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
from channelselector import get_thumb
|
||||||
|
|
||||||
CHANNEL_HOST = "http://www.cinetux.io/"
|
CHANNEL_HOST = "http://www.cinetux.io/"
|
||||||
|
|
||||||
@@ -32,28 +33,25 @@ def mainlist(item):
|
|||||||
titulo = "Peliculas (%s)" %total
|
titulo = "Peliculas (%s)" %total
|
||||||
itemlist.append(item.clone(title=titulo, text_color=color2, action="", text_bold=True))
|
itemlist.append(item.clone(title=titulo, text_color=color2, action="", text_bold=True))
|
||||||
itemlist.append(item.clone(action="peliculas", title=" Novedades", url=CHANNEL_HOST + "pelicula",
|
itemlist.append(item.clone(action="peliculas", title=" Novedades", url=CHANNEL_HOST + "pelicula",
|
||||||
thumbnail="https://raw.githubusercontent.com/master-1970/resources/master/images/genres"
|
thumbnail=get_thumb('newest', auto=True),
|
||||||
"/0/Directors%20Chair.png",
|
|
||||||
text_color=color1))
|
text_color=color1))
|
||||||
itemlist.append(item.clone(action="destacadas", title=" Destacadas", url=CHANNEL_HOST + "mas-vistos/",
|
itemlist.append(item.clone(action="destacadas", title=" Destacadas", url=CHANNEL_HOST + "mas-vistos/",
|
||||||
thumbnail="https://raw.githubusercontent.com/master-1970/resources/master/images/genres"
|
thumbnail=get_thumb('hot', auto=True),
|
||||||
"/0/Favorites.png",
|
|
||||||
text_color=color1))
|
text_color=color1))
|
||||||
itemlist.append(item.clone(action="idioma", title=" Por idioma", text_color=color1))
|
itemlist.append(item.clone(action="idioma", title=" Por idioma", text_color=color1,
|
||||||
|
thumbnail=get_thumb('language', auto=True)))
|
||||||
itemlist.append(item.clone(action="generos", title=" Por géneros", url=CHANNEL_HOST,
|
itemlist.append(item.clone(action="generos", title=" Por géneros", url=CHANNEL_HOST,
|
||||||
thumbnail="https://raw.githubusercontent.com/master-1970/resources/master/images/genres"
|
thumbnail=get_thumb('genres', auto=True),
|
||||||
"/0/Genre.png",
|
|
||||||
text_color=color1))
|
text_color=color1))
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Documentales", text_bold=True, text_color=color2, action=""))
|
itemlist.append(item.clone(title="Documentales", text_bold=True, text_color=color2, action=""))
|
||||||
itemlist.append(item.clone(action="peliculas", title=" Novedades", url=CHANNEL_HOST + "genero/documental/", text_color=color1,
|
itemlist.append(item.clone(action="peliculas", title=" Novedades", url=CHANNEL_HOST + "genero/documental/", text_color=color1,
|
||||||
thumbnail="https://raw.githubusercontent.com/master-1970/resources/master/images/genres"
|
thumbnail=get_thumb('newest', auto=True)))
|
||||||
"/0/Documentaries.png"))
|
|
||||||
itemlist.append(item.clone(action="peliculas", title=" Por orden alfabético", text_color=color1, url=CHANNEL_HOST + "genero/documental/?orderby=title&order=asc&gdsr_order=asc",
|
itemlist.append(item.clone(action="peliculas", title=" Por orden alfabético", text_color=color1, url=CHANNEL_HOST + "genero/documental/?orderby=title&order=asc&gdsr_order=asc",
|
||||||
thumbnail="https://raw.githubusercontent.com/master-1970/resources/master/images/genres"
|
thumbnail=get_thumb('alphabet', auto=True)))
|
||||||
"/0/A-Z.png"))
|
|
||||||
itemlist.append(item.clone(title="", action=""))
|
itemlist.append(item.clone(title="", action=""))
|
||||||
itemlist.append(item.clone(action="search", title="Buscar...", text_color=color3))
|
itemlist.append(item.clone(action="search", title="Buscar...", text_color=color3,
|
||||||
|
thumbnail=get_thumb('search', auto=True)))
|
||||||
itemlist.append(item.clone(action="configuracion", title="Configurar canal...", text_color="gold", folder=False))
|
itemlist.append(item.clone(action="configuracion", title="Configurar canal...", text_color="gold", folder=False))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "cuelgame",
|
"id": "cuelgame",
|
||||||
"name": "Cuelgame",
|
"name": "Cuelgame",
|
||||||
"active": false,
|
"active": true,
|
||||||
"adult": false,
|
"adult": false,
|
||||||
"language": ["cast"],
|
"language": ["cast"],
|
||||||
"thumbnail": "cuelgame.png",
|
"thumbnail": "cuelgame.png",
|
||||||
@@ -31,4 +31,4 @@
|
|||||||
"visible": true
|
"visible": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -3,83 +3,30 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import urllib
|
import urllib
|
||||||
from threading import Thread
|
|
||||||
|
|
||||||
import xbmc
|
|
||||||
import xbmcgui
|
|
||||||
from core import httptools
|
from core import httptools
|
||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
from core import tmdb
|
from core import tmdb
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from core.scrapertools import decodeHtmlentities as dhe
|
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
|
||||||
header = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0'}
|
header = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0'}
|
||||||
|
host = "http://www.divxtotal.co"
|
||||||
ACTION_SHOW_FULLSCREEN = 36
|
|
||||||
ACTION_GESTURE_SWIPE_LEFT = 511
|
|
||||||
ACTION_SELECT_ITEM = 7
|
|
||||||
ACTION_PREVIOUS_MENU = 10
|
|
||||||
ACTION_MOVE_LEFT = 1
|
|
||||||
ACTION_MOVE_RIGHT = 2
|
|
||||||
ACTION_MOVE_DOWN = 4
|
|
||||||
ACTION_MOVE_UP = 3
|
|
||||||
OPTION_PANEL = 6
|
|
||||||
OPTIONS_OK = 5
|
|
||||||
|
|
||||||
__modo_grafico__ = config.get_setting('modo_grafico', "divxtotal")
|
__modo_grafico__ = config.get_setting('modo_grafico', "divxtotal")
|
||||||
|
|
||||||
|
|
||||||
# Para la busqueda en bing evitando baneos
|
|
||||||
|
|
||||||
def browser(url):
|
|
||||||
import mechanize
|
|
||||||
|
|
||||||
# Utilizamos Browser mechanize para saltar problemas con la busqueda en bing
|
|
||||||
br = mechanize.Browser()
|
|
||||||
# Browser options
|
|
||||||
br.set_handle_equiv(False)
|
|
||||||
br.set_handle_gzip(True)
|
|
||||||
br.set_handle_redirect(True)
|
|
||||||
br.set_handle_referer(False)
|
|
||||||
br.set_handle_robots(False)
|
|
||||||
# Follows refresh 0 but not hangs on refresh > 0
|
|
||||||
br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)
|
|
||||||
# Want debugging messages?
|
|
||||||
# br.set_debug_http(True)
|
|
||||||
# br.set_debug_redirects(True)
|
|
||||||
# br.set_debug_responses(True)
|
|
||||||
|
|
||||||
# User-Agent (this is cheating, ok?)
|
|
||||||
# br.addheaders = [('User-agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/7.1.7 Safari/537.85.16')]
|
|
||||||
# br.addheaders =[('Cookie','SRCHD=AF=QBRE; domain=.bing.com; expires=25 de febrero de 2018 13:00:28 GMT+1; MUIDB=3B942052D204686335322894D3086911; domain=www.bing.com;expires=24 de febrero de 2018 13:00:28 GMT+1')]
|
|
||||||
# Open some site, let's pick a random one, the first that pops in mind
|
|
||||||
r = br.open(url)
|
|
||||||
response = r.read()
|
|
||||||
print response
|
|
||||||
if "img,divreturn" in response:
|
|
||||||
r = br.open("http://ssl-proxy.my-addr.org/myaddrproxy.php/" + url)
|
|
||||||
print "prooooxy"
|
|
||||||
response = r.read()
|
|
||||||
|
|
||||||
return response
|
|
||||||
|
|
||||||
|
|
||||||
api_key = "2e2160006592024ba87ccdf78c28f49f"
|
|
||||||
api_fankey = "dffe90fba4d02c199ae7a9e71330c987"
|
|
||||||
|
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
itemlist.append(item.clone(title="[COLOR orange][B]Películas[/B][/COLOR]", action="scraper",
|
itemlist.append(item.clone(title="[COLOR orange][B]Películas[/B][/COLOR]", action="scraper",
|
||||||
url="http://www.divxtotal.com/peliculas/", thumbnail="http://imgur.com/A4zN3OP.png",
|
url = host + "/peliculas/", thumbnail="http://imgur.com/A4zN3OP.png",
|
||||||
fanart="http://imgur.com/fdntKsy.jpg", contentType="movie"))
|
fanart="http://imgur.com/fdntKsy.jpg", contentType="movie"))
|
||||||
itemlist.append(item.clone(title="[COLOR orange][B] Películas HD[/B][/COLOR]", action="scraper",
|
itemlist.append(item.clone(title="[COLOR orange][B] Películas HD[/B][/COLOR]", action="scraper",
|
||||||
url="http://www.divxtotal.com/peliculas-hd/", thumbnail="http://imgur.com/A4zN3OP.png",
|
url = host + "/peliculas-hd/", thumbnail="http://imgur.com/A4zN3OP.png",
|
||||||
fanart="http://imgur.com/fdntKsy.jpg", contentType="movie"))
|
fanart="http://imgur.com/fdntKsy.jpg", contentType="movie"))
|
||||||
itemlist.append(itemlist[-1].clone(title="[COLOR orange][B]Series[/B][/COLOR]", action="scraper",
|
itemlist.append(itemlist[-1].clone(title="[COLOR orange][B]Series[/B][/COLOR]", action="scraper",
|
||||||
url="http://www.divxtotal.com/series/", thumbnail="http://imgur.com/GPX2wLt.png",
|
url = host + "/series/", thumbnail="http://imgur.com/GPX2wLt.png",
|
||||||
contentType="tvshow"))
|
contentType="tvshow"))
|
||||||
|
|
||||||
itemlist.append(itemlist[-1].clone(title="[COLOR orangered][B]Buscar[/B][/COLOR]", action="search",
|
itemlist.append(itemlist[-1].clone(title="[COLOR orangered][B]Buscar[/B][/COLOR]", action="search",
|
||||||
@@ -90,7 +37,7 @@ def mainlist(item):
|
|||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
logger.info()
|
logger.info()
|
||||||
texto = texto.replace(" ", "+")
|
texto = texto.replace(" ", "+")
|
||||||
item.url = "http://www.divxtotal.com/?s=" + texto
|
item.url = host + "/?s=" + texto
|
||||||
item.extra = "search"
|
item.extra = "search"
|
||||||
try:
|
try:
|
||||||
return buscador(item)
|
return buscador(item)
|
||||||
@@ -106,22 +53,16 @@ def buscador(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
data = httptools.downloadpage(item.url, headers=header, cookies=False).data
|
data = httptools.downloadpage(item.url, headers=header, cookies=False).data
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
|
patron = '<tr><td class="text-left"><a href="([^"]+)" title="([^"]+)">.*?-left">(.*?)</td>'
|
||||||
patron = scrapertools.find_multiple_matches(data,
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
'<tr><td class="text-left"><a href="([^"]+)" title="([^"]+)">.*?-left">(.*?)</td>')
|
for url, title, check in matches:
|
||||||
|
|
||||||
for url, title, check in patron:
|
|
||||||
|
|
||||||
if "N/A" in check:
|
if "N/A" in check:
|
||||||
checkmt = "tvshow"
|
checkmt = "tvshow"
|
||||||
|
|
||||||
else:
|
else:
|
||||||
checkmt = "movie"
|
checkmt = "movie"
|
||||||
|
|
||||||
titulo = title
|
titulo = title
|
||||||
title = re.sub(r"!|¡|HD|\d+\d+\d+\d+|\(.*?\).*\[.*?]\]", "", title)
|
title = re.sub(r"!|¡|HD|\d+\d+\d+\d+|\(.*?\).*\[.*?]\]", "", title)
|
||||||
title = re.sub(r"’|PRE-Estreno", "'", title)
|
title = re.sub(r"’|PRE-Estreno", "'", title)
|
||||||
|
|
||||||
if checkmt == "movie":
|
if checkmt == "movie":
|
||||||
new_item = item.clone(action="findvideos", title=titulo, url=url, fulltitle=title, contentTitle=title,
|
new_item = item.clone(action="findvideos", title=titulo, url=url, fulltitle=title, contentTitle=title,
|
||||||
contentType="movie", library=True)
|
contentType="movie", library=True)
|
||||||
@@ -138,9 +79,7 @@ def buscador(item):
|
|||||||
next = scrapertools.find_single_match(data, "<ul class=\"pagination\">.*?\(current\).*?href='([^']+)'")
|
next = scrapertools.find_single_match(data, "<ul class=\"pagination\">.*?\(current\).*?href='([^']+)'")
|
||||||
if len(next) > 0:
|
if len(next) > 0:
|
||||||
url = next
|
url = next
|
||||||
|
|
||||||
itemlist.append(item.clone(title="[COLOR springgreen][B]Siguiente >>[/B][/COLOR]", action="buscador", url=url))
|
itemlist.append(item.clone(title="[COLOR springgreen][B]Siguiente >>[/B][/COLOR]", action="buscador", url=url))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from core import tmdb
|
from core import tmdb
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
||||||
@@ -153,7 +92,6 @@ def buscador(item):
|
|||||||
item.title = item.title + " " + str(item.infoLabels['rating'])
|
item.title = item.title + " " + str(item.infoLabels['rating'])
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -162,14 +100,10 @@ def scraper(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
data = httptools.downloadpage(item.url, headers=header, cookies=False).data
|
data = httptools.downloadpage(item.url, headers=header, cookies=False).data
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
|
||||||
|
|
||||||
if item.contentType == "movie":
|
if item.contentType == "movie":
|
||||||
patron = scrapertools.find_multiple_matches(data,
|
patron = '<tr><td><a href="([^"]+)" title="([^"]+)".*?\d+-\d+-([^"]+)</td><td>'
|
||||||
'<tr><td><a href="([^"]+)" title="([^"]+)".*?\d+-\d+-([^"]+)</td><td>')
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
|
for url, title, year in matches:
|
||||||
for url, title, year in patron:
|
|
||||||
titulo = re.sub(r"\d+\d+\d+\d+|\(.*?\).*", "", title)
|
titulo = re.sub(r"\d+\d+\d+\d+|\(.*?\).*", "", title)
|
||||||
title = re.sub(r"!|¡|HD|\d+\d+\d+\d+|\(.*?\).*", "", title)
|
title = re.sub(r"!|¡|HD|\d+\d+\d+\d+|\(.*?\).*", "", title)
|
||||||
title = title.replace("Autosia", "Autopsia")
|
title = title.replace("Autosia", "Autopsia")
|
||||||
@@ -178,14 +112,12 @@ def scraper(item):
|
|||||||
fulltitle=title, contentTitle=title, contentType="movie", extra=year, library=True)
|
fulltitle=title, contentTitle=title, contentType="movie", extra=year, library=True)
|
||||||
new_item.infoLabels['year'] = get_year(url)
|
new_item.infoLabels['year'] = get_year(url)
|
||||||
itemlist.append(new_item)
|
itemlist.append(new_item)
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
patron = '(?s)<p class="secconimagen"><a href="([^"]+)"'
|
||||||
patron = scrapertools.find_multiple_matches(data,
|
patron += ' title="[^"]+"><img src="([^"]+)".*?'
|
||||||
'<p class="secconimagen"><a href="([^"]+)" title="[^"]+"><img src="([^"]+)".*?title="[^"]+">([^"]+)</a>')
|
patron += 'rel="bookmark">([^<]+)<'
|
||||||
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
for url, thumb, title in patron:
|
for url, thumb, title in matches:
|
||||||
titulo = title.strip()
|
titulo = title.strip()
|
||||||
title = re.sub(r"\d+x.*|\(.*?\)", "", title)
|
title = re.sub(r"\d+x.*|\(.*?\)", "", title)
|
||||||
new_item = item.clone(action="findvideos", title="[COLOR orange]" + titulo + "[/COLOR]", url=url,
|
new_item = item.clone(action="findvideos", title="[COLOR orange]" + titulo + "[/COLOR]", url=url,
|
||||||
@@ -193,7 +125,6 @@ def scraper(item):
|
|||||||
fulltitle=title, contentTitle=title, show=title, contentType="tvshow", library=True)
|
fulltitle=title, contentTitle=title, show=title, contentType="tvshow", library=True)
|
||||||
new_item.infoLabels['year'] = get_year(url)
|
new_item.infoLabels['year'] = get_year(url)
|
||||||
itemlist.append(new_item)
|
itemlist.append(new_item)
|
||||||
|
|
||||||
## Paginación
|
## Paginación
|
||||||
next = scrapertools.find_single_match(data, "<ul class=\"pagination\">.*?\(current\).*?href='([^']+)'")
|
next = scrapertools.find_single_match(data, "<ul class=\"pagination\">.*?\(current\).*?href='([^']+)'")
|
||||||
if len(next) > 0:
|
if len(next) > 0:
|
||||||
@@ -215,21 +146,14 @@ def scraper(item):
|
|||||||
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
for item_tmdb in itemlist:
|
for item_tmdb in itemlist:
|
||||||
logger.info(str(item_tmdb.infoLabels['tmdb_id']))
|
logger.info(str(item_tmdb.infoLabels['tmdb_id']))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findtemporadas(item):
|
def findtemporadas(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
if item.extra == "search":
|
|
||||||
th = Thread(target=get_art(item))
|
|
||||||
th.setDaemon(True)
|
|
||||||
th.start()
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
if len(item.extra.split("|")):
|
if len(item.extra.split("|")):
|
||||||
@@ -264,8 +188,7 @@ def findtemporadas(item):
|
|||||||
except:
|
except:
|
||||||
fanart_extra = item.fanart
|
fanart_extra = item.fanart
|
||||||
fanart_info = item.fanart
|
fanart_info = item.fanart
|
||||||
|
bloque_episodios = scrapertools.find_multiple_matches(data, 'Temporada (\d+).*?<\/a>(.*?)<\/table>')
|
||||||
bloque_episodios = scrapertools.find_multiple_matches(data, 'Temporada.*?(\d+).*?<\/a>(.*?)<\/table>')
|
|
||||||
for temporada, bloque_epis in bloque_episodios:
|
for temporada, bloque_epis in bloque_episodios:
|
||||||
item.infoLabels = item.InfoLabels
|
item.infoLabels = item.InfoLabels
|
||||||
item.infoLabels['season'] = temporada
|
item.infoLabels['season'] = temporada
|
||||||
@@ -298,9 +221,9 @@ def epis(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
if item.extra == "serie_add":
|
if item.extra == "serie_add":
|
||||||
item.url = item.datalibrary
|
item.url = item.datalibrary
|
||||||
patron = scrapertools.find_multiple_matches(item.url,
|
patron = '<td><img src=".*?images\/(.*?)\.png".*?href="([^"]+)" title="">.*?(\d+x\d+).*?td>'
|
||||||
'<td><img src=".*?images\/(.*?)\.png".*?href="([^"]+)" title="">.*?(\d+x\d+).*?td>')
|
matches = scrapertools.find_multiple_matches(item.url, patron)
|
||||||
for idioma, url, epi in patron:
|
for idioma, url, epi in matches:
|
||||||
episodio = scrapertools.find_single_match(epi, '\d+x(\d+)')
|
episodio = scrapertools.find_single_match(epi, '\d+x(\d+)')
|
||||||
item.infoLabels['episode'] = episodio
|
item.infoLabels['episode'] = episodio
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
@@ -320,19 +243,11 @@ def findvideos(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
|
|
||||||
if not item.infoLabels['episode']:
|
|
||||||
th = Thread(target=get_art(item))
|
|
||||||
th.setDaemon(True)
|
|
||||||
th.start()
|
|
||||||
|
|
||||||
if item.contentType != "movie":
|
if item.contentType != "movie":
|
||||||
|
|
||||||
if not item.infoLabels['episode']:
|
if not item.infoLabels['episode']:
|
||||||
capitulo = scrapertools.find_single_match(item.title, '(\d+x\d+)')
|
capitulo = scrapertools.find_single_match(item.title, '(\d+x\d+)')
|
||||||
url_capitulo = scrapertools.find_single_match(data,
|
patron = '<a href="(' + host + '/wp-content/uploads/.*?' + capitulo + '.*?.torrent)'
|
||||||
'<a href="(http://www.divxtotal.com/wp-content/uploads/.*?' + capitulo + '.*?.torrent)')
|
url_capitulo = scrapertools.find_single_match(data, patron)
|
||||||
|
|
||||||
if len(item.extra.split("|")) >= 2:
|
if len(item.extra.split("|")) >= 2:
|
||||||
extra = item.extra
|
extra = item.extra
|
||||||
else:
|
else:
|
||||||
@@ -350,7 +265,6 @@ def findvideos(item):
|
|||||||
title="[COLOR chocolate][B]Ver capítulo " + capitulo + "[/B][/COLOR]" + "-" + "[COLOR khaki] ( Video" + "[/COLOR]" + " " + "[COLOR khaki]" + ext_v + "[/COLOR]" + " " + "[COLOR khaki] " + size + " )" + "[/COLOR]",
|
title="[COLOR chocolate][B]Ver capítulo " + capitulo + "[/B][/COLOR]" + "-" + "[COLOR khaki] ( Video" + "[/COLOR]" + " " + "[COLOR khaki]" + ext_v + "[/COLOR]" + " " + "[COLOR khaki] " + size + " )" + "[/COLOR]",
|
||||||
url=url_capitulo, action="play", server="torrent", fanart=fanart, thumbnail=item.thumbnail,
|
url=url_capitulo, action="play", server="torrent", fanart=fanart, thumbnail=item.thumbnail,
|
||||||
extra=item.extra, fulltitle=item.fulltitle, folder=False))
|
extra=item.extra, fulltitle=item.fulltitle, folder=False))
|
||||||
|
|
||||||
if item.infoLabels['episode'] and item.library:
|
if item.infoLabels['episode'] and item.library:
|
||||||
thumbnail = scrapertools.find_single_match(item.extra, 'http://assets.fanart.tv/.*jpg')
|
thumbnail = scrapertools.find_single_match(item.extra, 'http://assets.fanart.tv/.*jpg')
|
||||||
if thumbnail == "":
|
if thumbnail == "":
|
||||||
@@ -363,15 +277,13 @@ def findvideos(item):
|
|||||||
action="info_capitulos", fanart=fanart, thumbnail=item.thumb_art,
|
action="info_capitulos", fanart=fanart, thumbnail=item.thumb_art,
|
||||||
thumb_info=item.thumb_info, extra=item.extra, show=item.show,
|
thumb_info=item.thumb_info, extra=item.extra, show=item.show,
|
||||||
InfoLabels=item.infoLabels, folder=False))
|
InfoLabels=item.infoLabels, folder=False))
|
||||||
|
|
||||||
if not item.infoLabels['episode']:
|
if not item.infoLabels['episode']:
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
Item(channel=item.channel, title="[COLOR moccasin][B]Todos los episodios[/B][/COLOR]", url=item.url,
|
Item(channel=item.channel, title="[COLOR moccasin][B]Todos los episodios[/B][/COLOR]", url=item.url,
|
||||||
action="findtemporadas", server="torrent", fanart=item.extra.split("|")[1],
|
action="findtemporadas", server="torrent",
|
||||||
thumbnail=item.thumbnail, extra=item.extra + "|" + item.thumbnail, contentType=item.contentType,
|
thumbnail=item.thumbnail, extra=item.extra + "|" + item.thumbnail, contentType=item.contentType,
|
||||||
contentTitle=item.contentTitle, InfoLabels=item.infoLabels, thumb_art=item.thumb_art,
|
contentTitle=item.contentTitle, InfoLabels=item.infoLabels, thumb_art=item.thumb_art,
|
||||||
thumb_info=item.thumbnail, fulltitle=item.fulltitle, library=item.library, folder=True))
|
thumb_info=item.thumbnail, fulltitle=item.fulltitle, library=item.library, folder=True))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
url = scrapertools.find_single_match(data, '<h3 class="orange text-center">.*?href="([^"]+)"')
|
url = scrapertools.find_single_match(data, '<h3 class="orange text-center">.*?href="([^"]+)"')
|
||||||
item.infoLabels['year'] = None
|
item.infoLabels['year'] = None
|
||||||
@@ -388,7 +300,6 @@ def findvideos(item):
|
|||||||
action="add_pelicula_to_library", url=item.url, infoLabels=infoLabels,
|
action="add_pelicula_to_library", url=item.url, infoLabels=infoLabels,
|
||||||
text_color="0xFFe5ffcc",
|
text_color="0xFFe5ffcc",
|
||||||
thumbnail='http://imgur.com/xQNTqqy.png'))
|
thumbnail='http://imgur.com/xQNTqqy.png'))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -401,7 +312,6 @@ def info_capitulos(item, images={}):
|
|||||||
url = url.replace("/0", "/")
|
url = url.replace("/0", "/")
|
||||||
from core import jsontools
|
from core import jsontools
|
||||||
data = httptools.downloadpage(url).data
|
data = httptools.downloadpage(url).data
|
||||||
|
|
||||||
if "<filename>episodes" in data:
|
if "<filename>episodes" in data:
|
||||||
image = scrapertools.find_single_match(data, '<Data>.*?<filename>(.*?)</filename>')
|
image = scrapertools.find_single_match(data, '<Data>.*?<filename>(.*?)</filename>')
|
||||||
image = "http://thetvdb.com/banners/" + image
|
image = "http://thetvdb.com/banners/" + image
|
||||||
@@ -431,7 +341,6 @@ def info_capitulos(item, images={}):
|
|||||||
except:
|
except:
|
||||||
rating = 0
|
rating = 0
|
||||||
try:
|
try:
|
||||||
|
|
||||||
if rating >= 5 and rating < 8:
|
if rating >= 5 and rating < 8:
|
||||||
rating = "[COLOR yellow]Puntuación[/COLOR] " + "[COLOR springgreen][B]" + str(rating) + "[/B][/COLOR]"
|
rating = "[COLOR yellow]Puntuación[/COLOR] " + "[COLOR springgreen][B]" + str(rating) + "[/B][/COLOR]"
|
||||||
elif rating >= 8 and rating < 10:
|
elif rating >= 8 and rating < 10:
|
||||||
@@ -444,90 +353,17 @@ def info_capitulos(item, images={}):
|
|||||||
rating = "[COLOR yellow]Puntuación[/COLOR] " + "[COLOR crimson][B]" + str(rating) + "[/B][/COLOR]"
|
rating = "[COLOR yellow]Puntuación[/COLOR] " + "[COLOR crimson][B]" + str(rating) + "[/B][/COLOR]"
|
||||||
if "10." in rating:
|
if "10." in rating:
|
||||||
rating = re.sub(r'10\.\d+', '10', rating)
|
rating = re.sub(r'10\.\d+', '10', rating)
|
||||||
|
|
||||||
|
|
||||||
except:
|
except:
|
||||||
|
|
||||||
title = "[COLOR red][B]LO SENTIMOS...[/B][/COLOR]"
|
title = "[COLOR red][B]LO SENTIMOS...[/B][/COLOR]"
|
||||||
plot = "Este capitulo no tiene informacion..."
|
plot = "Este capitulo no tiene informacion..."
|
||||||
plot = "[COLOR yellow][B]" + plot + "[/B][/COLOR]"
|
plot = "[COLOR yellow][B]" + plot + "[/B][/COLOR]"
|
||||||
image = "http://s6.postimg.org/ub7pb76c1/noinfo.png"
|
image = "http://s6.postimg.org/ub7pb76c1/noinfo.png"
|
||||||
foto = "http://s6.postimg.org/nm3gk1xox/noinfosup2.png"
|
foto = "http://s6.postimg.org/nm3gk1xox/noinfosup2.png"
|
||||||
rating = ""
|
rating = ""
|
||||||
|
|
||||||
ventana = TextBox2(title=title, plot=plot, thumbnail=image, fanart=foto, rating=rating)
|
ventana = TextBox2(title=title, plot=plot, thumbnail=image, fanart=foto, rating=rating)
|
||||||
ventana.doModal()
|
ventana.doModal()
|
||||||
|
|
||||||
|
|
||||||
class TextBox2(xbmcgui.WindowDialog):
|
|
||||||
""" Create a skinned textbox window """
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
self.getTitle = kwargs.get('title')
|
|
||||||
self.getPlot = kwargs.get('plot')
|
|
||||||
self.getThumbnail = kwargs.get('thumbnail')
|
|
||||||
self.getFanart = kwargs.get('fanart')
|
|
||||||
self.getRating = kwargs.get('rating')
|
|
||||||
|
|
||||||
self.background = xbmcgui.ControlImage(70, 20, 1150, 630, 'http://imgur.com/K6wduMe.png')
|
|
||||||
self.title = xbmcgui.ControlTextBox(120, 60, 430, 50)
|
|
||||||
self.rating = xbmcgui.ControlTextBox(145, 112, 1030, 45)
|
|
||||||
self.plot = xbmcgui.ControlTextBox(120, 150, 1056, 100)
|
|
||||||
self.thumbnail = xbmcgui.ControlImage(120, 300, 1056, 300, self.getThumbnail)
|
|
||||||
self.fanart = xbmcgui.ControlImage(780, 43, 390, 100, self.getFanart)
|
|
||||||
|
|
||||||
self.addControl(self.background)
|
|
||||||
self.background.setAnimations(
|
|
||||||
[('conditional', 'effect=slide start=1000% end=0% time=1500 condition=true tween=bounce',),
|
|
||||||
('WindowClose', 'effect=slide delay=800 start=0% end=1000% time=800 condition=true',)])
|
|
||||||
self.addControl(self.thumbnail)
|
|
||||||
self.thumbnail.setAnimations([('conditional',
|
|
||||||
'effect=zoom start=0% end=100% delay=2700 time=1500 condition=true tween=elastic easing=inout',),
|
|
||||||
('WindowClose', 'effect=slide end=0,700% time=300 condition=true',)])
|
|
||||||
self.addControl(self.plot)
|
|
||||||
self.plot.setAnimations(
|
|
||||||
[('conditional', 'effect=zoom delay=2000 center=auto start=0 end=100 time=800 condition=true ',), (
|
|
||||||
'conditional',
|
|
||||||
'effect=rotate delay=2000 center=auto aceleration=6000 start=0% end=360% time=800 condition=true',),
|
|
||||||
('WindowClose', 'effect=zoom center=auto start=100% end=-0% time=600 condition=true',)])
|
|
||||||
self.addControl(self.fanart)
|
|
||||||
self.fanart.setAnimations(
|
|
||||||
[('WindowOpen', 'effect=slide start=0,-700 delay=1000 time=2500 tween=bounce condition=true',), (
|
|
||||||
'conditional',
|
|
||||||
'effect=rotate center=auto start=0% end=360% delay=3000 time=2500 tween=bounce condition=true',),
|
|
||||||
('WindowClose', 'effect=slide end=0,-700% time=1000 condition=true',)])
|
|
||||||
self.addControl(self.title)
|
|
||||||
self.title.setText(self.getTitle)
|
|
||||||
self.title.setAnimations(
|
|
||||||
[('conditional', 'effect=slide start=-1500% end=0% delay=1000 time=2000 condition=true tween=elastic',),
|
|
||||||
('WindowClose', 'effect=slide start=0% end=-1500% time=800 condition=true',)])
|
|
||||||
self.addControl(self.rating)
|
|
||||||
self.rating.setText(self.getRating)
|
|
||||||
self.rating.setAnimations(
|
|
||||||
[('conditional', 'effect=fade start=0% end=100% delay=3000 time=1500 condition=true',),
|
|
||||||
('WindowClose', 'effect=slide end=0,-700% time=600 condition=true',)])
|
|
||||||
xbmc.sleep(200)
|
|
||||||
|
|
||||||
try:
|
|
||||||
self.plot.autoScroll(7000, 6000, 30000)
|
|
||||||
except:
|
|
||||||
|
|
||||||
xbmc.executebuiltin(
|
|
||||||
'Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
|
|
||||||
self.plot.setText(self.getPlot)
|
|
||||||
|
|
||||||
def get(self):
|
|
||||||
self.show()
|
|
||||||
|
|
||||||
def onAction(self, action):
|
|
||||||
if action == ACTION_PREVIOUS_MENU or action.getId() == ACTION_GESTURE_SWIPE_LEFT or action == 110 or action == 92:
|
|
||||||
self.close()
|
|
||||||
|
|
||||||
|
|
||||||
def test():
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def tokenize(text, match=re.compile("([idel])|(\d+):|(-?\d+)").match):
|
def tokenize(text, match=re.compile("([idel])|(\d+):|(-?\d+)").match):
|
||||||
i = 0
|
i = 0
|
||||||
while i < len(text):
|
while i < len(text):
|
||||||
@@ -576,7 +412,6 @@ def decode(text):
|
|||||||
data = data
|
data = data
|
||||||
except:
|
except:
|
||||||
data = src
|
data = src
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
@@ -591,381 +426,6 @@ def convert_size(size):
|
|||||||
return '%s %s' % (s, size_name[i])
|
return '%s %s' % (s, size_name[i])
|
||||||
|
|
||||||
|
|
||||||
def fanartv(item, id_tvdb, id, images={}):
|
|
||||||
headers = [['Content-Type', 'application/json']]
|
|
||||||
from core import jsontools
|
|
||||||
if item.contentType == "movie":
|
|
||||||
url = "http://webservice.fanart.tv/v3/movies/%s?api_key=cab16e262d72fea6a6843d679aa10300" \
|
|
||||||
% id
|
|
||||||
|
|
||||||
else:
|
|
||||||
url = "http://webservice.fanart.tv/v3/tv/%s?api_key=cab16e262d72fea6a6843d679aa10300" % id_tvdb
|
|
||||||
try:
|
|
||||||
data = jsontools.load(scrapertools.downloadpage(url, headers=headers))
|
|
||||||
if data and not "error message" in data:
|
|
||||||
for key, value in data.items():
|
|
||||||
if key not in ["name", "tmdb_id", "imdb_id", "thetvdb_id"]:
|
|
||||||
images[key] = value
|
|
||||||
else:
|
|
||||||
images = []
|
|
||||||
|
|
||||||
except:
|
|
||||||
images = []
|
|
||||||
return images
|
|
||||||
|
|
||||||
|
|
||||||
def filmaffinity(item, infoLabels):
|
|
||||||
title = infoLabels["title"].replace(" ", "+")
|
|
||||||
try:
|
|
||||||
year = infoLabels["year"]
|
|
||||||
except:
|
|
||||||
year = ""
|
|
||||||
sinopsis = infoLabels["sinopsis"]
|
|
||||||
|
|
||||||
if year == "":
|
|
||||||
if item.contentType != "movie":
|
|
||||||
tipo = "serie"
|
|
||||||
url_bing = "http://www.bing.com/search?q=%s+Serie+de+tv+site:filmaffinity.com" % title
|
|
||||||
else:
|
|
||||||
tipo = "película"
|
|
||||||
url_bing = "http://www.bing.com/search?q=%s+site:filmaffinity.com" % title
|
|
||||||
try:
|
|
||||||
data = browser(url_bing)
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
|
||||||
if "myaddrproxy.php" in data:
|
|
||||||
subdata_bing = scrapertools.get_match(data,
|
|
||||||
'li class="b_algo"><div class="b_title"><h2>(<a href="/myaddrproxy.php/http/www.filmaffinity.com/es/film.*?)"')
|
|
||||||
subdata_bing = re.sub(r'\/myaddrproxy.php\/http\/', '', subdata_bing)
|
|
||||||
else:
|
|
||||||
subdata_bing = scrapertools.get_match(data,
|
|
||||||
'li class="b_algo"><h2>(<a href="http://www.filmaffinity.com/.*?/film.*?)"')
|
|
||||||
|
|
||||||
url_filma = scrapertools.get_match(subdata_bing, '<a href="([^"]+)')
|
|
||||||
if not "http" in url_filma:
|
|
||||||
try:
|
|
||||||
data = httptools.downloadpage("http://" + url_filma, cookies=False, timeout=1).data
|
|
||||||
except:
|
|
||||||
data = httptools.downloadpage("http://" + url_filma, cookies=False, timeout=1).data
|
|
||||||
else:
|
|
||||||
try:
|
|
||||||
data = httptools.downloadpage(url_filma, cookies=False, timeout=1).data
|
|
||||||
except:
|
|
||||||
data = httptools.downloadpage(url_filma, cookies=False, timeout=1).data
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
tipo = "Pelicula"
|
|
||||||
url = "http://www.filmaffinity.com/es/advsearch.php?stext={0}&stype%5B%5D=title&country=&genre=&fromyear={1}&toyear={1}".format(
|
|
||||||
title, year)
|
|
||||||
data = httptools.downloadpage(url, cookies=False).data
|
|
||||||
url_filmaf = scrapertools.find_single_match(data, '<div class="mc-poster">\s*<a title="[^"]*" href="([^"]+)"')
|
|
||||||
if url_filmaf:
|
|
||||||
url_filmaf = "http://www.filmaffinity.com%s" % url_filmaf
|
|
||||||
data = httptools.downloadpage(url_filmaf, cookies=False).data
|
|
||||||
else:
|
|
||||||
if item.contentType != "movie":
|
|
||||||
tipo = "serie"
|
|
||||||
url_bing = "http://www.bing.com/search?q=%s+Serie+de+tv+site:filmaffinity.com" % title
|
|
||||||
else:
|
|
||||||
tipo = "película"
|
|
||||||
url_bing = "http://www.bing.com/search?q=%s+site:filmaffinity.com" % title
|
|
||||||
try:
|
|
||||||
data = browser(url_bing)
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
|
||||||
if "myaddrproxy.php" in data:
|
|
||||||
subdata_bing = scrapertools.get_match(data,
|
|
||||||
'li class="b_algo"><div class="b_title"><h2>(<a href="/myaddrproxy.php/http/www.filmaffinity.com/es/film.*?)"')
|
|
||||||
subdata_bing = re.sub(r'\/myaddrproxy.php\/http\/', '', subdata_bing)
|
|
||||||
else:
|
|
||||||
subdata_bing = scrapertools.get_match(data,
|
|
||||||
'li class="b_algo"><h2>(<a href="http://www.filmaffinity.com/.*?/film.*?)"')
|
|
||||||
|
|
||||||
url_filma = scrapertools.get_match(subdata_bing, '<a href="([^"]+)')
|
|
||||||
if not "http" in url_filma:
|
|
||||||
data = httptools.downloadpage("http://" + url_filma, cookies=False).data
|
|
||||||
else:
|
|
||||||
data = httptools.downloadpage(url_filma, cookies=False).data
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
sinopsis_f = scrapertools.find_single_match(data, '<dd itemprop="description">(.*?)</dd>')
|
|
||||||
sinopsis_f = sinopsis_f.replace("<br><br />", "\n")
|
|
||||||
sinopsis_f = re.sub(r"\(FILMAFFINITY\)<br />", "", sinopsis_f)
|
|
||||||
try:
|
|
||||||
year_f = scrapertools.get_match(data, '<dt>Año</dt>.*?>(\d+)</dd>')
|
|
||||||
except:
|
|
||||||
year_f = ""
|
|
||||||
try:
|
|
||||||
rating_filma = scrapertools.get_match(data, 'itemprop="ratingValue" content="(.*?)">')
|
|
||||||
except:
|
|
||||||
rating_filma = "Sin puntuacion"
|
|
||||||
critica = ""
|
|
||||||
patron = '<div itemprop="reviewBody">(.*?)</div>.*?itemprop="author">(.*?)\s*<i alt="([^"]+)"'
|
|
||||||
matches_reviews = scrapertools.find_multiple_matches(data, patron)
|
|
||||||
|
|
||||||
if matches_reviews:
|
|
||||||
for review, autor, valoracion in matches_reviews:
|
|
||||||
review = dhe(scrapertools.htmlclean(review))
|
|
||||||
review += "\n" + autor + "[CR]"
|
|
||||||
review = re.sub(r'Puntuac.*?\)', '', review)
|
|
||||||
if "positiva" in valoracion:
|
|
||||||
critica += "[COLOR green][B]%s[/B][/COLOR]\n" % review
|
|
||||||
elif "neutral" in valoracion:
|
|
||||||
critica += "[COLOR yellow][B]%s[/B][/COLOR]\n" % review
|
|
||||||
else:
|
|
||||||
critica += "[COLOR red][B]%s[/B][/COLOR]\n" % review
|
|
||||||
else:
|
|
||||||
critica = "[COLOR floralwhite][B]Esta %s no tiene críticas todavía...[/B][/COLOR]" % tipo
|
|
||||||
|
|
||||||
return critica, rating_filma, year_f, sinopsis_f
|
|
||||||
|
|
||||||
|
|
||||||
def get_art(item):
|
|
||||||
logger.info()
|
|
||||||
id = item.infoLabels['tmdb_id']
|
|
||||||
check_fanart = item.infoLabels['fanart']
|
|
||||||
if item.contentType != "movie":
|
|
||||||
tipo_ps = "tv"
|
|
||||||
else:
|
|
||||||
tipo_ps = "movie"
|
|
||||||
if not id:
|
|
||||||
year = item.extra
|
|
||||||
otmdb = tmdb.Tmdb(texto_buscado=item.fulltitle, year=year, tipo=tipo_ps)
|
|
||||||
id = otmdb.result.get("id")
|
|
||||||
|
|
||||||
if id == None:
|
|
||||||
otmdb = tmdb.Tmdb(texto_buscado=item.fulltitle, tipo=tipo_ps)
|
|
||||||
id = otmdb.result.get("id")
|
|
||||||
if id == None:
|
|
||||||
if item.contentType == "movie":
|
|
||||||
urlbing_imdb = "http://www.bing.com/search?q=%s+%s+tv+series+site:imdb.com" % (
|
|
||||||
item.fulltitle.replace(' ', '+'), year)
|
|
||||||
data = browser(urlbing_imdb)
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| |http://ssl-proxy.my-addr.org/myaddrproxy.php/", "", data)
|
|
||||||
subdata_imdb = scrapertools.find_single_match(data,
|
|
||||||
'<li class="b_algo">(.*?)h="ID.*?<strong>.*?TV Series')
|
|
||||||
else:
|
|
||||||
urlbing_imdb = "http://www.bing.com/search?q=%s+%s+site:imdb.com" % (
|
|
||||||
item.fulltitle.replace(' ', '+'), year)
|
|
||||||
data = browser(urlbing_imdb)
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| |http://ssl-proxy.my-addr.org/myaddrproxy.php/", "", data)
|
|
||||||
subdata_imdb = scrapertools.find_single_match(data, '<li class="b_algo">(.*?)h="ID.*?<strong>')
|
|
||||||
try:
|
|
||||||
imdb_id = scrapertools.get_match(subdata_imdb, '<a href=.*?http.*?imdb.com/title/(.*?)/.*?"')
|
|
||||||
except:
|
|
||||||
try:
|
|
||||||
imdb_id = scrapertools.get_match(subdata_imdb,
|
|
||||||
'<a href=.*?http.*?imdb.com/.*?/title/(.*?)/.*?"')
|
|
||||||
except:
|
|
||||||
imdb_id = ""
|
|
||||||
otmdb = tmdb.Tmdb(external_id=imdb_id, external_source="imdb_id", tipo=tipo_ps, idioma_busqueda="es")
|
|
||||||
id = otmdb.result.get("id")
|
|
||||||
|
|
||||||
if id == None:
|
|
||||||
if "(" in item.fulltitle:
|
|
||||||
title = scrapertools.find_single_match(item.fulltitle, '\(.*?\)')
|
|
||||||
if item.contentType != "movie":
|
|
||||||
urlbing_imdb = "http://www.bing.com/search?q=%s+%s+tv+series+site:imdb.com" % (
|
|
||||||
title.replace(' ', '+'), year)
|
|
||||||
data = browser(urlbing_imdb)
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| |http://ssl-proxy.my-addr.org/myaddrproxy.php/", "",
|
|
||||||
data)
|
|
||||||
subdata_imdb = scrapertools.find_single_match(data,
|
|
||||||
'<li class="b_algo">(.*?)h="ID.*?<strong>.*?TV Series')
|
|
||||||
else:
|
|
||||||
urlbing_imdb = "http://www.bing.com/search?q=%s+%s+site:imdb.com" % (
|
|
||||||
title.replace(' ', '+'), year)
|
|
||||||
data = browser(urlbing_imdb)
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| |http://ssl-proxy.my-addr.org/myaddrproxy.php/", "",
|
|
||||||
data)
|
|
||||||
subdata_imdb = scrapertools.find_single_match(data,
|
|
||||||
'<li class="b_algo">(.*?)h="ID.*?<strong>')
|
|
||||||
try:
|
|
||||||
imdb_id = scrapertools.get_match(subdata_imdb,
|
|
||||||
'<a href=.*?http.*?imdb.com/title/(.*?)/.*?"')
|
|
||||||
except:
|
|
||||||
try:
|
|
||||||
imdb_id = scrapertools.get_match(subdata_imdb,
|
|
||||||
'<a href=.*?http.*?imdb.com/.*?/title/(.*?)/.*?"')
|
|
||||||
except:
|
|
||||||
imdb_id = ""
|
|
||||||
otmdb = tmdb.Tmdb(external_id=imdb_id, external_source="imdb_id", tipo=tipo_ps,
|
|
||||||
idioma_busqueda="es")
|
|
||||||
id = otmdb.result.get("id")
|
|
||||||
|
|
||||||
if not id:
|
|
||||||
fanart = item.fanart
|
|
||||||
|
|
||||||
imagenes = []
|
|
||||||
itmdb = tmdb.Tmdb(id_Tmdb=id, tipo=tipo_ps)
|
|
||||||
images = itmdb.result.get("images")
|
|
||||||
if images:
|
|
||||||
for key, value in images.iteritems():
|
|
||||||
for detail in value:
|
|
||||||
imagenes.append('http://image.tmdb.org/t/p/original' + detail["file_path"])
|
|
||||||
|
|
||||||
if item.contentType == "movie":
|
|
||||||
if len(imagenes) >= 4:
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart and imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2]
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[3]
|
|
||||||
elif imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[2] + "|" + imagenes[3]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[3] + "|" + imagenes[3]
|
|
||||||
elif len(imagenes) == 3:
|
|
||||||
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart and imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2]
|
|
||||||
|
|
||||||
else:
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[0] + "|" + imagenes[1]
|
|
||||||
elif imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[1]
|
|
||||||
elif len(imagenes) == 2:
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[0] + "|" + imagenes[1]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[0]
|
|
||||||
elif len(imagenes) == 1:
|
|
||||||
item.extra = imagenes[0] + "|" + imagenes[0]
|
|
||||||
else:
|
|
||||||
item.extra = item.fanart + "|" + item.fanart
|
|
||||||
id_tvdb = ""
|
|
||||||
else:
|
|
||||||
|
|
||||||
if itmdb.result.get("external_ids").get("tvdb_id"):
|
|
||||||
id_tvdb = itmdb.result.get("external_ids").get("tvdb_id")
|
|
||||||
else:
|
|
||||||
id_tvdb = ""
|
|
||||||
|
|
||||||
if len(imagenes) >= 6:
|
|
||||||
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart and imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2] + "|" + imagenes[3] + "|" + imagenes[4] + "|" + \
|
|
||||||
imagenes[5]
|
|
||||||
else:
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[3] + "|" + imagenes[4] + "|" + imagenes[5] + "|" + \
|
|
||||||
imagenes[2]
|
|
||||||
elif imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[2] + "|" + imagenes[3] + "|" + imagenes[4] + "|" + imagenes[5] + "|" + \
|
|
||||||
imagenes[1]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[3] + "|" + imagenes[4] + "|" + imagenes[5] + "|" + imagenes[2] + "|" + \
|
|
||||||
imagenes[1]
|
|
||||||
elif len(imagenes) == 5:
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart and imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2] + "|" + imagenes[3] + "|" + imagenes[4]
|
|
||||||
else:
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[3] + "|" + imagenes[4] + "|" + imagenes[2]
|
|
||||||
elif imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[2] + "|" + imagenes[3] + "|" + imagenes[4] + "|" + imagenes[1]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[3] + "|" + imagenes[4] + "|" + imagenes[2] + "|" + imagenes[1]
|
|
||||||
elif len(imagenes) == 4:
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart and imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2] + "|" + imagenes[3] + "|" + imagenes[4]
|
|
||||||
else:
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[3] + "|" + imagenes[2]
|
|
||||||
elif imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[2] + "|" + imagenes[3] + "|" + imagenes[1]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[3] + "|" + imagenes[2] + "|" + imagenes[1]
|
|
||||||
|
|
||||||
elif len(imagenes) == 3:
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart and imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2]
|
|
||||||
else:
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[0] + "|" + imagenes[1]
|
|
||||||
elif imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[1]
|
|
||||||
elif len(imagenes) == 2:
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[0] + "|" + imagenes[1]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[0]
|
|
||||||
elif len(imagenes) == 1:
|
|
||||||
item.extra = imagenes[0] + "|" + imagenes[0]
|
|
||||||
else:
|
|
||||||
item.extra = item.fanart + "|" + item.fanart
|
|
||||||
item.extra = item.extra
|
|
||||||
images_fanarttv = fanartv(item, id_tvdb, id)
|
|
||||||
if images_fanarttv:
|
|
||||||
if item.contentType == "movie":
|
|
||||||
if images_fanarttv.get("moviedisc"):
|
|
||||||
item.thumbnail = images_fanarttv.get("moviedisc")[0].get("url")
|
|
||||||
elif images_fanarttv.get("hdmovielogo"):
|
|
||||||
item.thumbnail = images_fanarttv.get("hdmovielogo")[0].get("url")
|
|
||||||
elif images_fanarttv.get("moviethumb"):
|
|
||||||
item.thumbnail = images_fanarttv.get("moviethumb")[0].get("url")
|
|
||||||
elif images_fanarttv.get("moviebanner"):
|
|
||||||
item.thumbnail_ = images_fanarttv.get("moviebanner")[0].get("url")
|
|
||||||
else:
|
|
||||||
item.thumbnail = item.thumbnail
|
|
||||||
else:
|
|
||||||
if images_fanarttv.get("hdtvlogo"):
|
|
||||||
item.thumbnail = images_fanarttv.get("hdtvlogo")[0].get("url")
|
|
||||||
elif images_fanarttv.get("clearlogo"):
|
|
||||||
item.thumbnail = images_fanarttv.get("hdmovielogo")[0].get("url")
|
|
||||||
item.thumb_info = item.thumbnail
|
|
||||||
if images_fanarttv.get("tvbanner"):
|
|
||||||
item.thumb_art = images_fanarttv.get("tvbanner")[0].get("url")
|
|
||||||
elif images_fanarttv.get("tvthumb"):
|
|
||||||
item.thumb_art = images_fanarttv.get("tvthumb")[0].get("url")
|
|
||||||
else:
|
|
||||||
item.thumb_art = item.thumbnail
|
|
||||||
|
|
||||||
else:
|
|
||||||
item.extra = item.extra + "|" + item.thumbnail
|
|
||||||
|
|
||||||
|
|
||||||
def get_year(url):
|
def get_year(url):
|
||||||
data = httptools.downloadpage(url, headers=header, cookies=False).data
|
data = httptools.downloadpage(url, headers=header, cookies=False).data
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
@@ -984,7 +444,6 @@ def ext_size(url):
|
|||||||
pepe = open(torrents_path + "/temp.torrent", "rb").read()
|
pepe = open(torrents_path + "/temp.torrent", "rb").read()
|
||||||
except:
|
except:
|
||||||
pepe = ""
|
pepe = ""
|
||||||
|
|
||||||
torrent = decode(pepe)
|
torrent = decode(pepe)
|
||||||
try:
|
try:
|
||||||
name = torrent["info"]["name"]
|
name = torrent["info"]["name"]
|
||||||
@@ -1021,25 +480,22 @@ def ext_size(url):
|
|||||||
size = ""
|
size = ""
|
||||||
return ext_v, size
|
return ext_v, size
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(categoria):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
try:
|
try:
|
||||||
if categoria == 'torrent':
|
if categoria == 'torrent':
|
||||||
item.url = 'http://www.divxtotal.com/peliculas/'
|
item.url = host + '/peliculas/'
|
||||||
item.contentType="movie"
|
item.contentType="movie"
|
||||||
|
|
||||||
itemlist = scraper(item)
|
itemlist = scraper(item)
|
||||||
|
|
||||||
if itemlist[-1].title == "[COLOR springgreen][B]Siguiente >>[/B][/COLOR]":
|
if itemlist[-1].title == "[COLOR springgreen][B]Siguiente >>[/B][/COLOR]":
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
|
|
||||||
# Se captura la excepción, para no interrumpir al canal novedades si un canal falla
|
# Se captura la excepción, para no interrumpir al canal novedades si un canal falla
|
||||||
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("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "documaniatv",
|
|
||||||
"name": "DocumaniaTV",
|
|
||||||
"active": true,
|
|
||||||
"adult": false,
|
|
||||||
"language": ["cast", "lat"],
|
|
||||||
"thumbnail": "http://i.imgur.com/qMR9sg9.png",
|
|
||||||
"banner": "documaniatv.png",
|
|
||||||
"categories": [
|
|
||||||
"documentary"
|
|
||||||
],
|
|
||||||
"settings": [
|
|
||||||
{
|
|
||||||
"id": "include_in_newest_documentales",
|
|
||||||
"type": "bool",
|
|
||||||
"label": "Incluir en Novedades - Documentales",
|
|
||||||
"default": true,
|
|
||||||
"enabled": true,
|
|
||||||
"visible": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "documaniatvaccount",
|
|
||||||
"type": "bool",
|
|
||||||
"label": "Usar cuenta de documaniatv",
|
|
||||||
"default": true,
|
|
||||||
"enabled": true,
|
|
||||||
"visible": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "documaniatvuser",
|
|
||||||
"type": "text",
|
|
||||||
"label": "Usuario",
|
|
||||||
"color": "0xFFd50b0b",
|
|
||||||
"enabled": "eq(-1,true)",
|
|
||||||
"visible": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "documaniatvpassword",
|
|
||||||
"type": "text",
|
|
||||||
"label": "Contraseña",
|
|
||||||
"color": "0xFFd50b0b",
|
|
||||||
"enabled": "!eq(-1,)+eq(-2,true)",
|
|
||||||
"visible": true,
|
|
||||||
"hidden": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,373 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import re
|
|
||||||
import urllib
|
|
||||||
import urlparse
|
|
||||||
|
|
||||||
from core import jsontools
|
|
||||||
from core import scrapertools
|
|
||||||
from core.item import Item
|
|
||||||
from platformcode import config, logger
|
|
||||||
|
|
||||||
host = "http://www.documaniatv.com/"
|
|
||||||
account = config.get_setting("documaniatvaccount", "documaniatv")
|
|
||||||
|
|
||||||
headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'],
|
|
||||||
['Referer', host]]
|
|
||||||
|
|
||||||
|
|
||||||
def login():
|
|
||||||
logger.info()
|
|
||||||
|
|
||||||
user = config.get_setting("documaniatvuser", "documaniatv")
|
|
||||||
password = config.get_setting("documaniatvpassword", "documaniatv")
|
|
||||||
if user == "" or password == "":
|
|
||||||
return True, ""
|
|
||||||
|
|
||||||
data = scrapertools.cachePage(host, headers=headers)
|
|
||||||
if "http://www.documaniatv.com/user/" + user in data:
|
|
||||||
return False, user
|
|
||||||
|
|
||||||
post = "username=%s&pass=%s&Login=Iniciar Sesión" % (user, password)
|
|
||||||
data = scrapertools.cachePage("http://www.documaniatv.com/login.php", headers=headers, post=post)
|
|
||||||
|
|
||||||
if "Nombre de usuario o contraseña incorrectas" in data:
|
|
||||||
logger.error("login erróneo")
|
|
||||||
return True, ""
|
|
||||||
|
|
||||||
return False, user
|
|
||||||
|
|
||||||
|
|
||||||
def mainlist(item):
|
|
||||||
logger.info()
|
|
||||||
|
|
||||||
itemlist = []
|
|
||||||
itemlist.append(item.clone(action="novedades", title="Novedades", url="http://www.documaniatv.com/newvideos.html"))
|
|
||||||
itemlist.append(
|
|
||||||
item.clone(action="categorias", title="Categorías y Canales", url="http://www.documaniatv.com/browse.html"))
|
|
||||||
itemlist.append(item.clone(action="novedades", title="Top", url="http://www.documaniatv.com/topvideos.html"))
|
|
||||||
itemlist.append(item.clone(action="categorias", title="Series Documentales",
|
|
||||||
url="http://www.documaniatv.com/top-series-documentales-html"))
|
|
||||||
itemlist.append(item.clone(action="viendo", title="Viendo ahora", url="http://www.documaniatv.com"))
|
|
||||||
itemlist.append(item.clone(action="", title=""))
|
|
||||||
itemlist.append(item.clone(action="search", title="Buscar"))
|
|
||||||
|
|
||||||
folder = False
|
|
||||||
action = ""
|
|
||||||
if account:
|
|
||||||
error, user = login()
|
|
||||||
if error:
|
|
||||||
title = "Playlists Personales (Error en usuario y/o contraseña)"
|
|
||||||
else:
|
|
||||||
title = "Playlists Personales (Logueado)"
|
|
||||||
action = "usuario"
|
|
||||||
folder = True
|
|
||||||
|
|
||||||
else:
|
|
||||||
title = "Playlists Personales (Sin cuenta configurada)"
|
|
||||||
user = ""
|
|
||||||
|
|
||||||
url = "http://www.documaniatv.com/user/%s" % user
|
|
||||||
itemlist.append(item.clone(title=title, action=action, url=url, folder=folder))
|
|
||||||
itemlist.append(item.clone(title="Configurar canal...", text_color="gold", action="configuracion",
|
|
||||||
folder=False))
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def configuracion(item):
|
|
||||||
from platformcode import platformtools
|
|
||||||
platformtools.show_channel_settings()
|
|
||||||
if config.is_xbmc():
|
|
||||||
import xbmc
|
|
||||||
xbmc.executebuiltin("Container.Refresh")
|
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
|
||||||
itemlist = []
|
|
||||||
item = Item()
|
|
||||||
try:
|
|
||||||
if categoria == 'documentales':
|
|
||||||
item.url = "http://www.documaniatv.com/newvideos.html"
|
|
||||||
itemlist = novedades(item)
|
|
||||||
|
|
||||||
if itemlist[-1].action == "novedades":
|
|
||||||
itemlist.pop()
|
|
||||||
|
|
||||||
# Se captura la excepción, para no interrumpir al canal novedades si un canal falla
|
|
||||||
except:
|
|
||||||
import sys
|
|
||||||
for line in sys.exc_info():
|
|
||||||
logger.error("{0}".format(line))
|
|
||||||
return []
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
|
||||||
logger.info()
|
|
||||||
data = scrapertools.cachePage(host, headers=headers)
|
|
||||||
item.url = scrapertools.find_single_match(data, 'form action="([^"]+)"') + "?keywords=%s&video-id="
|
|
||||||
texto = texto.replace(" ", "+")
|
|
||||||
item.url = item.url % texto
|
|
||||||
try:
|
|
||||||
return novedades(item)
|
|
||||||
# Se captura la excepción, para no interrumpir al buscador global si un canal falla
|
|
||||||
except:
|
|
||||||
import sys
|
|
||||||
for line in sys.exc_info():
|
|
||||||
logger.error("%s" % line)
|
|
||||||
return []
|
|
||||||
|
|
||||||
|
|
||||||
def novedades(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
# Descarga la pagina
|
|
||||||
data = scrapertools.cachePage(item.url, headers=headers)
|
|
||||||
# Saca el plot si lo tuviese
|
|
||||||
scrapedplot = scrapertools.find_single_match(data, '<div class="pm-section-head">(.*?)</div>')
|
|
||||||
if "<div" in scrapedplot:
|
|
||||||
scrapedplot = ""
|
|
||||||
else:
|
|
||||||
scrapedplot = scrapertools.htmlclean(scrapedplot)
|
|
||||||
bloque = scrapertools.find_multiple_matches(data, '<li class="col-xs-[\d] col-sm-[\d] col-md-[\d]">(.*?)</li>')
|
|
||||||
|
|
||||||
if "Registrarse" in data or not account:
|
|
||||||
for match in bloque:
|
|
||||||
patron = '<span class="pm-label-duration">(.*?)</span>.*?<a href="([^"]+)"' \
|
|
||||||
'.*?title="([^"]+)".*?data-echo="([^"]+)"'
|
|
||||||
matches = scrapertools.find_multiple_matches(match, patron)
|
|
||||||
for duracion, scrapedurl, scrapedtitle, scrapedthumbnail in matches:
|
|
||||||
contentTitle = scrapedtitle[:]
|
|
||||||
scrapedtitle += " [" + duracion + "]"
|
|
||||||
if not scrapedthumbnail.startswith("data:image"):
|
|
||||||
scrapedthumbnail += "|" + headers[0][0] + "=" + headers[0][1]
|
|
||||||
else:
|
|
||||||
scrapedthumbnail = item.thumbnail
|
|
||||||
logger.debug(
|
|
||||||
"title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]")
|
|
||||||
itemlist.append(item.clone(action="play_", title=scrapedtitle, url=scrapedurl,
|
|
||||||
thumbnail=scrapedthumbnail, fanart=scrapedthumbnail, plot=scrapedplot,
|
|
||||||
fulltitle=scrapedtitle, contentTitle=contentTitle, folder=False))
|
|
||||||
else:
|
|
||||||
for match in bloque:
|
|
||||||
patron = '<span class="pm-label-duration">(.*?)</span>.*?onclick="watch_later_add\(([\d]+)\)' \
|
|
||||||
'.*?<a href="([^"]+)".*?title="([^"]+)".*?data-echo="([^"]+)"'
|
|
||||||
matches = scrapertools.find_multiple_matches(match, patron)
|
|
||||||
for duracion, video_id, scrapedurl, scrapedtitle, scrapedthumbnail in matches:
|
|
||||||
contentTitle = scrapedtitle[:]
|
|
||||||
scrapedtitle += " [" + duracion + "]"
|
|
||||||
if not scrapedthumbnail.startswith("data:image"):
|
|
||||||
scrapedthumbnail += "|" + headers[0][0] + "=" + headers[0][1]
|
|
||||||
else:
|
|
||||||
scrapedthumbnail = item.thumbnail
|
|
||||||
logger.debug(
|
|
||||||
"title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]")
|
|
||||||
itemlist.append(item.clone(action="findvideos", title=scrapedtitle, url=scrapedurl,
|
|
||||||
thumbnail=scrapedthumbnail, fanart=scrapedthumbnail, plot=scrapedplot,
|
|
||||||
id=video_id,
|
|
||||||
fulltitle=scrapedtitle, contentTitle=contentTitle))
|
|
||||||
|
|
||||||
# Busca enlaces de paginas siguientes...
|
|
||||||
try:
|
|
||||||
next_page_url = scrapertools.get_match(data, '<a href="([^"]+)">»</a>')
|
|
||||||
next_page_url = urlparse.urljoin(host, next_page_url)
|
|
||||||
itemlist.append(item.clone(action="novedades", title=">> Página siguiente", url=next_page_url))
|
|
||||||
except:
|
|
||||||
logger.error("Siguiente pagina no encontrada")
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def categorias(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
data = scrapertools.cachePage(item.url, headers=headers)
|
|
||||||
|
|
||||||
patron = '<div class="pm-li-category">.*?<a href="([^"]+)"' \
|
|
||||||
'.*?<img src="([^"]+)".*?<h3>(?:<a.*?><span.*?>|)(.*?)<'
|
|
||||||
matches = scrapertools.find_multiple_matches(data, patron)
|
|
||||||
for scrapedurl, scrapedthumbnail, scrapedtitle in matches:
|
|
||||||
if not scrapedthumbnail.startswith("data:image"):
|
|
||||||
scrapedthumbnail += "|" + headers[0][0] + "=" + headers[0][1]
|
|
||||||
else:
|
|
||||||
scrapedthumbnail = item.thumbnail
|
|
||||||
itemlist.append(item.clone(action="novedades", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail,
|
|
||||||
fanart=scrapedthumbnail))
|
|
||||||
|
|
||||||
# Busca enlaces de paginas siguientes...
|
|
||||||
next_page_url = scrapertools.find_single_match(data, '<a href="([^"]+)"><i class="fa fa-arrow-right">')
|
|
||||||
if next_page_url != "":
|
|
||||||
itemlist.append(item.clone(action="categorias", title=">> Página siguiente", url=next_page_url))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def viendo(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
# Descarga la pagina
|
|
||||||
data = scrapertools.cachePage(item.url, headers=headers)
|
|
||||||
bloque = scrapertools.find_single_match(data, '<ul class="pm-ul-carousel-videos list-inline"(.*?)</ul>')
|
|
||||||
patron = '<span class="pm-label-duration">(.*?)</span>.*?<a href="([^"]+)"' \
|
|
||||||
'.*?title="([^"]+)".*?data-echo="([^"]+)"'
|
|
||||||
matches = scrapertools.find_multiple_matches(bloque, patron)
|
|
||||||
for duracion, scrapedurl, scrapedtitle, scrapedthumbnail in matches:
|
|
||||||
scrapedtitle += " [" + duracion + "]"
|
|
||||||
if not scrapedthumbnail.startswith("data:image"):
|
|
||||||
scrapedthumbnail += "|" + headers[0][0] + "=" + headers[0][1]
|
|
||||||
else:
|
|
||||||
scrapedthumbnail = item.thumbnail
|
|
||||||
logger.debug("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]")
|
|
||||||
itemlist.append(item.clone(action="play_", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail,
|
|
||||||
fanart=scrapedthumbnail, fulltitle=scrapedtitle))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
# Se comprueba si el vídeo está ya en favoritos/ver más tarde
|
|
||||||
url = "http://www.documaniatv.com/ajax.php?p=playlists&do=video-watch-load-my-playlists&video-id=%s" % item.id
|
|
||||||
data = scrapertools.cachePage(url, headers=headers)
|
|
||||||
data = jsontools.load(data)
|
|
||||||
data = re.sub(r"\n|\r|\t", '', data['html'])
|
|
||||||
|
|
||||||
itemlist.append(item.clone(action="play_", title=">> Reproducir vídeo", folder=False))
|
|
||||||
if "kodi" in config.get_platform():
|
|
||||||
folder = False
|
|
||||||
else:
|
|
||||||
folder = True
|
|
||||||
patron = '<li data-playlist-id="([^"]+)".*?onclick="playlist_(\w+)_item' \
|
|
||||||
'.*?<span class="pm-playlists-name">(.*?)</span>.*?' \
|
|
||||||
'<span class="pm-playlists-video-count">(.*?)</span>'
|
|
||||||
matches = scrapertools.find_multiple_matches(data, patron)
|
|
||||||
for playlist_id, playlist_action, playlist_title, video_count in matches:
|
|
||||||
scrapedtitle = playlist_action.replace('remove', 'Eliminar de ').replace('add', 'Añadir a ')
|
|
||||||
scrapedtitle += playlist_title + " (" + video_count + ")"
|
|
||||||
itemlist.append(item.clone(action="acciones_playlist", title=scrapedtitle, list_id=playlist_id,
|
|
||||||
url="http://www.documaniatv.com/ajax.php", folder=folder))
|
|
||||||
|
|
||||||
if "kodi" in config.get_platform():
|
|
||||||
itemlist.append(item.clone(action="acciones_playlist", title="Crear una nueva playlist y añadir el documental",
|
|
||||||
id=item.id, url="http://www.documaniatv.com/ajax.php", folder=folder))
|
|
||||||
itemlist.append(item.clone(action="acciones_playlist", title="Me gusta", url="http://www.documaniatv.com/ajax.php",
|
|
||||||
folder=folder))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def play_(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
try:
|
|
||||||
import xbmc
|
|
||||||
if not xbmc.getCondVisibility('System.HasAddon(script.cnubis)'):
|
|
||||||
from platformcode import platformtools
|
|
||||||
platformtools.dialog_ok("Addon no encontrado",
|
|
||||||
"Para ver vídeos alojados en cnubis necesitas tener su instalado su add-on",
|
|
||||||
line3="Descárgalo en http://cnubis.com/kodi-pelisalacarta.html")
|
|
||||||
return itemlist
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Descarga la pagina
|
|
||||||
data = scrapertools.cachePage(item.url, headers=headers)
|
|
||||||
# Busca enlace directo
|
|
||||||
video_url = scrapertools.find_single_match(data, 'class="embedded-video"[^<]+<iframe.*?src="([^"]+)"')
|
|
||||||
if config.get_platform() == "plex" or config.get_platform() == "mediaserver":
|
|
||||||
code = scrapertools.find_single_match(video_url, 'u=([A-z0-9]+)')
|
|
||||||
url = "http://cnubis.com/plugins/mediaplayer/embeder/_embedkodi.php?u=%s" % code
|
|
||||||
data = scrapertools.downloadpage(url, headers=headers)
|
|
||||||
video_url = scrapertools.find_single_match(data, 'file\s*:\s*"([^"]+)"')
|
|
||||||
itemlist.append(item.clone(action="play", url=video_url, server="directo"))
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
cnubis_script = xbmc.translatePath("special://home/addons/script.cnubis/default.py")
|
|
||||||
xbmc.executebuiltin("XBMC.RunScript(%s, url=%s&referer=%s&title=%s)"
|
|
||||||
% (cnubis_script, urllib.quote_plus(video_url), urllib.quote_plus(item.url),
|
|
||||||
item.fulltitle))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def usuario(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
data = scrapertools.cachePage(item.url, headers=headers)
|
|
||||||
profile_id = scrapertools.find_single_match(data, 'data-profile-id="([^"]+)"')
|
|
||||||
url = "http://www.documaniatv.com/ajax.php?p=profile&do=profile-load-playlists&uid=%s" % profile_id
|
|
||||||
|
|
||||||
data = scrapertools.cachePage(url, headers=headers)
|
|
||||||
data = jsontools.load(data)
|
|
||||||
data = data['html']
|
|
||||||
|
|
||||||
patron = '<div class="pm-video-thumb">.*?src="([^"]+)".*?' \
|
|
||||||
'<span class="pm-pl-items">(.*?)</span>(.*?)</div>' \
|
|
||||||
'.*?<h3.*?href="([^"]+)".*?title="([^"]+)"'
|
|
||||||
matches = scrapertools.find_multiple_matches(data, patron)
|
|
||||||
for scrapedthumbnail, items, videos, scrapedurl, scrapedtitle in matches:
|
|
||||||
scrapedtitle = scrapedtitle.replace("Historia", 'Historial')
|
|
||||||
scrapedtitle += " (" + items + videos + ")"
|
|
||||||
if "no-thumbnail" in scrapedthumbnail:
|
|
||||||
scrapedthumbnail = ""
|
|
||||||
else:
|
|
||||||
scrapedthumbnail += "|" + headers[0][0] + "=" + headers[0][1]
|
|
||||||
itemlist.append(item.clone(action="playlist", title=scrapedtitle, url=scrapedurl,
|
|
||||||
thumbnail=scrapedthumbnail, fanart=scrapedthumbnail))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def acciones_playlist(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
if item.title == "Crear una nueva playlist y añadir el documental":
|
|
||||||
from platformcode import platformtools
|
|
||||||
texto = platformtools.dialog_input(heading="Introduce el título de la nueva playlist")
|
|
||||||
if texto is not None:
|
|
||||||
post = "p=playlists&do=create-playlist&title=%s&visibility=1&video-id=%s&ui=video-watch" % (texto, item.id)
|
|
||||||
data = scrapertools.cachePage(item.url, headers=headers, post=post)
|
|
||||||
else:
|
|
||||||
return
|
|
||||||
|
|
||||||
elif item.title != "Me gusta":
|
|
||||||
if "Eliminar" in item.title:
|
|
||||||
action = "remove-from-playlist"
|
|
||||||
else:
|
|
||||||
action = "add-to-playlist"
|
|
||||||
post = "p=playlists&do=%s&playlist-id=%s&video-id=%s" % (action, item.list_id, item.id)
|
|
||||||
data = scrapertools.cachePage(item.url, headers=headers, post=post)
|
|
||||||
else:
|
|
||||||
item.url = "http://www.documaniatv.com/ajax.php?vid=%s&p=video&do=like" % item.id
|
|
||||||
data = scrapertools.cachePage(item.url, headers=headers)
|
|
||||||
|
|
||||||
try:
|
|
||||||
import xbmc
|
|
||||||
from platformcode import platformtools
|
|
||||||
platformtools.dialog_notification(item.title, "Se ha añadido/eliminado correctamente")
|
|
||||||
xbmc.executebuiltin("Container.Refresh")
|
|
||||||
except:
|
|
||||||
itemlist.append(item.clone(action="", title="Se ha añadido/eliminado correctamente"))
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def playlist(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
data = scrapertools.cachePage(item.url, headers=headers)
|
|
||||||
patron = '<div class="pm-pl-list-index.*?src="([^"]+)".*?' \
|
|
||||||
'<a href="([^"]+)".*?>(.*?)</a>'
|
|
||||||
matches = scrapertools.find_multiple_matches(data, patron)
|
|
||||||
for scrapedthumbnail, scrapedurl, scrapedtitle in matches:
|
|
||||||
scrapedthumbnail += "|" + headers[0][0] + "=" + headers[0][1]
|
|
||||||
logger.debug("title=[" + scrapedtitle + "], url=[" + scrapedurl + "], thumbnail=[" + scrapedthumbnail + "]")
|
|
||||||
itemlist.append(item.clone(action="play_", title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail,
|
|
||||||
fanart=scrapedthumbnail, fulltitle=scrapedtitle, folder=False))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
@@ -8,5 +8,15 @@
|
|||||||
"banner": "gnula.png",
|
"banner": "gnula.png",
|
||||||
"categories": [
|
"categories": [
|
||||||
"movie"
|
"movie"
|
||||||
]
|
],
|
||||||
}
|
"settings": [
|
||||||
|
{
|
||||||
|
"id": "include_in_global_search",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en busqueda global",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from core import httptools
|
from core import httptools
|
||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
from core import servertools
|
from core import servertools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import logger
|
from platformcode import config, logger
|
||||||
|
|
||||||
host = "http://gnula.nu/"
|
host = "http://gnula.nu/"
|
||||||
|
host_search = "https://www.googleapis.com/customsearch/v1element?key=AIzaSyCVAXiUzRYsML1Pv6RwSG1gunmMikTzQqY&rsz=small&num=10&hl=es&prettyPrint=false&source=gcsc&gss=.es&sig=45e50696e04f15ce6310843f10a3a8fb&cx=014793692610101313036:vwtjajbclpq&q=%s&cse_tok=AOdTmaBgzSiy5RxoV4cZSGGEr17reWoGLg:1519145966291&googlehost=www.google.com&callback=google.search.Search.apiary10745&nocache=1519145965573&start=0"
|
||||||
|
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
@@ -19,43 +19,87 @@ def mainlist(item):
|
|||||||
Item(channel=item.channel, title="Generos", action="generos", url= host + "generos/lista-de-generos/"))
|
Item(channel=item.channel, title="Generos", action="generos", url= host + "generos/lista-de-generos/"))
|
||||||
itemlist.append(Item(channel=item.channel, title="Recomendadas", action="peliculas",
|
itemlist.append(Item(channel=item.channel, title="Recomendadas", action="peliculas",
|
||||||
url= host + "peliculas-online/lista-de-peliculas-recomendadas/", viewmode="movie"))
|
url= host + "peliculas-online/lista-de-peliculas-recomendadas/", viewmode="movie"))
|
||||||
|
itemlist.append(Item(channel = item.channel, action = ""))
|
||||||
|
itemlist.append(
|
||||||
|
Item(channel=item.channel, title="Buscar", action="search", url = host_search))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def search(item, texto):
|
||||||
|
logger.info()
|
||||||
|
texto = texto.replace(" ", "+")
|
||||||
|
item.url = item.url %texto
|
||||||
|
try:
|
||||||
|
return sub_search(item)
|
||||||
|
# Se captura la excepción, para no interrumpir al buscador global si un canal falla
|
||||||
|
except:
|
||||||
|
import sys
|
||||||
|
for line in sys.exc_info():
|
||||||
|
logger.error("%s" % line)
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
def sub_search(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
patron = '(?s)clicktrackUrl":".*?q=(.*?)".*?'
|
||||||
|
patron += 'title":"([^"]+)".*?'
|
||||||
|
patron += 'cseImage":{"src":"([^"]+)"'
|
||||||
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
|
for scrapedurl, scrapedtitle, scrapedthumbnail in matches:
|
||||||
|
scrapedurl = scrapertools.find_single_match(scrapedurl, ".*?online/")
|
||||||
|
scrapedtitle = scrapedtitle.decode("unicode-escape").replace(" online", "").replace("<b>", "").replace("</b>", "")
|
||||||
|
if "ver-" not in scrapedurl:
|
||||||
|
continue
|
||||||
|
year = scrapertools.find_single_match(scrapedtitle, "\d{4}")
|
||||||
|
contentTitle = scrapedtitle.replace("(%s)" %year,"").replace("Ver","").strip()
|
||||||
|
itemlist.append(Item(action = "findvideos",
|
||||||
|
channel = item.channel,
|
||||||
|
contentTitle = contentTitle,
|
||||||
|
infoLabels = {"year":year},
|
||||||
|
title = scrapedtitle,
|
||||||
|
thumbnail = scrapedthumbnail,
|
||||||
|
url = scrapedurl
|
||||||
|
))
|
||||||
|
if itemlist:
|
||||||
|
page = int(scrapertools.find_single_match(item.url, ".*?start=(\d+)")) + 10
|
||||||
|
npage = (page / 10) + 1
|
||||||
|
item_page = scrapertools.find_single_match(item.url, "(.*?start=)") + str(page)
|
||||||
|
itemlist.append(Item(action = "sub_search",
|
||||||
|
channel = item.channel,
|
||||||
|
title = "[COLOR green]Página %s[/COLOR]" %npage,
|
||||||
|
url = item_page
|
||||||
|
))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def generos(item):
|
def generos(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
data = scrapertools.find_single_match(data, '<spa[^>]+>Lista de g(.*?)/table')
|
data = scrapertools.find_single_match(data, '<spa[^>]+>Lista de g(.*?)/table')
|
||||||
|
|
||||||
patron = '<strong>([^<]+)</strong> .<a href="([^"]+)"'
|
patron = '<strong>([^<]+)</strong> .<a href="([^"]+)"'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
for genero, scrapedurl in matches:
|
for genero, scrapedurl in matches:
|
||||||
title = scrapertools.htmlclean(genero)
|
title = scrapertools.htmlclean(genero)
|
||||||
plot = ""
|
|
||||||
url = item.url + scrapedurl
|
url = item.url + scrapedurl
|
||||||
thumbnail = ""
|
|
||||||
itemlist.append(Item(channel = item.channel,
|
itemlist.append(Item(channel = item.channel,
|
||||||
action = 'peliculas',
|
action = 'peliculas',
|
||||||
title = title,
|
title = title,
|
||||||
url = url,
|
url = url,
|
||||||
thumbnail = thumbnail,
|
|
||||||
plot = plot,
|
|
||||||
viewmode = "movie"))
|
viewmode = "movie"))
|
||||||
|
|
||||||
itemlist = sorted(itemlist, key=lambda item: item.title)
|
itemlist = sorted(itemlist, key=lambda item: item.title)
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
patron = '<a class="Ntooltip" href="([^"]+)">([^<]+)<span><br[^<]+'
|
patron = '<a class="Ntooltip" href="([^"]+)">([^<]+)<span><br[^<]+'
|
||||||
patron += '<img src="([^"]+)"></span></a>(.*?)<br'
|
patron += '<img src="([^"]+)"></span></a>(.*?)<br'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
itemlist = []
|
|
||||||
for scrapedurl, scrapedtitle, scrapedthumbnail, resto in matches:
|
for scrapedurl, scrapedtitle, scrapedthumbnail, resto in matches:
|
||||||
language = []
|
language = []
|
||||||
plot = scrapertools.htmlclean(resto).strip()
|
plot = scrapertools.htmlclean(resto).strip()
|
||||||
@@ -110,6 +154,13 @@ def findvideos(item):
|
|||||||
url = url
|
url = url
|
||||||
))
|
))
|
||||||
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 itemlist:
|
||||||
|
if config.get_videolibrary_support():
|
||||||
|
itemlist.append(Item(channel = item.channel, action = ""))
|
||||||
|
itemlist.append(Item(channel=item.channel, title="Añadir a la videoteca", text_color="green",
|
||||||
|
action="add_pelicula_to_library", url=item.url, thumbnail = item.thumbnail,
|
||||||
|
fulltitle = item.contentTitle
|
||||||
|
))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ def listado(item):
|
|||||||
data = re.sub(r"\n|\r|\t|\s{2}| |<br>", "", data)
|
data = re.sub(r"\n|\r|\t|\s{2}| |<br>", "", data)
|
||||||
|
|
||||||
folder = filetools.join(config.get_data_path(), 'thumbs_kbagi')
|
folder = filetools.join(config.get_data_path(), 'thumbs_kbagi')
|
||||||
patron = 'data-file-id(.*?)</div></div></li>'
|
patron = 'data-file-id(.*?</p>)</div></div>'
|
||||||
bloques = scrapertools.find_multiple_matches(data, patron)
|
bloques = scrapertools.find_multiple_matches(data, patron)
|
||||||
for block in bloques:
|
for block in bloques:
|
||||||
if "adult_info" in block and not adult_content:
|
if "adult_info" in block and not adult_content:
|
||||||
@@ -184,8 +184,7 @@ def listado(item):
|
|||||||
new_item.fanart = item.thumbnail
|
new_item.fanart = item.thumbnail
|
||||||
|
|
||||||
itemlist.append(new_item)
|
itemlist.append(new_item)
|
||||||
|
next_page = scrapertools.find_single_match(data, 'class="pageSplitter.*?" data-nextpage-number="([^"]+)"')
|
||||||
next_page = scrapertools.find_single_match(data, 'class="pageSplitter" data-nextpage-number="([^"]+)"')
|
|
||||||
if next_page:
|
if next_page:
|
||||||
if item.post:
|
if item.post:
|
||||||
post = re.sub(r'pageNumber=(\d+)', "pageNumber=" + next_page, item.post)
|
post = re.sub(r'pageNumber=(\d+)', "pageNumber=" + next_page, item.post)
|
||||||
|
|||||||
@@ -4,349 +4,97 @@ import re
|
|||||||
import urllib
|
import urllib
|
||||||
import urlparse
|
import urlparse
|
||||||
|
|
||||||
|
from core import servertools
|
||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
|
from core import httptools
|
||||||
|
|
||||||
|
Host='http://www.tvsinpagar.com'
|
||||||
|
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
itemlist.append(Item(channel=item.channel, action="submenu", title="Películas"))
|
itemlist.append(Item(channel=item.channel, action="submenu", title="Películas",url=Host+"/peliculas/"))
|
||||||
itemlist.append(Item(channel=item.channel, action="submenu", title="Series"))
|
itemlist.append(Item(channel=item.channel, action="submenu", title="Series",url=Host+"/series/"))
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title="Anime", url="http://www.newpct.com/anime/",
|
#itemlist.append(Item(channel=item.channel, action="listado", title="Anime", url=Host+"/anime/",
|
||||||
viewmode="movie_with_plot"))
|
# viewmode="movie_with_plot"))
|
||||||
itemlist.append(
|
#itemlist.append(
|
||||||
Item(channel=item.channel, action="listado", title="Documentales", url="http://www.newpct.com/documentales/",
|
# Item(channel=item.channel, action="listado", title="Documentales", url=Host+"/documentales/",
|
||||||
viewmode="movie_with_plot"))
|
# viewmode="movie_with_plot"))
|
||||||
itemlist.append(Item(channel=item.channel, action="search", title="Buscar"))
|
#itemlist.append(Item(channel=item.channel, action="search", title="Buscar"))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
|
||||||
logger.info()
|
|
||||||
texto = texto.replace(" ", "+")
|
|
||||||
|
|
||||||
item.url = "http://www.newpct.com/buscar-descargas/%s" % (texto)
|
|
||||||
try:
|
|
||||||
return buscador(item)
|
|
||||||
# Se captura la excepciÛn, para no interrumpir al buscador global si un canal falla
|
|
||||||
except:
|
|
||||||
import sys
|
|
||||||
for line in sys.exc_info():
|
|
||||||
logger.error("%s" % line)
|
|
||||||
return []
|
|
||||||
|
|
||||||
|
|
||||||
def buscador(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
# Descarga la página
|
|
||||||
data = scrapertools.cache_page(item.url)
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
|
||||||
|
|
||||||
# <td class="center" style="border-bottom:solid 1px cyan;">14-09-14</td><td style="border-bottom:solid 1px cyan;"><strong><a href="http://www.newpct.com/descargar-pelicula/malefica-3d-sbs/" title="Más información sobre Malefica 3D SBS [BluRay 1080p][DTS 5.1-AC3 5.1 Castellano DTS 5.1-Ingles+Subs][ES-EN]"> <span class="searchTerm">Malefica</span> 3D SBS [BluRay 1080p][DTS 5.1-AC3 5.1 Castellano DTS 5.1-Ingles+Subs][ES-EN]</a></strong></td><td class="center" style="border-bottom:solid 1px cyan;">10.9 GB</td><td style="border-bottom:solid 1px cyan;"><a href="http://tumejorserie.com/descargar/index.php?link=torrents/059784.torrent" title="Descargar Malefica 3D SBS [BluRay 1080p][DTS 5.1-AC3 5.1 Castellano DTS 5.1-Ingles+Subs][ES-EN]"><img src="http://newpct.com/v2/imagenes//buttons/download.png"
|
|
||||||
|
|
||||||
patron = '<td class="center" style="border-bottom:solid 1px cyan;">([^<]+)</td>.*?' # createdate
|
|
||||||
patron += '<td class="center" style="border-bottom:solid 1px cyan;">([^<]+)</td>.*?' # info
|
|
||||||
patron += '<a href="([^"]+)" ' # url
|
|
||||||
patron += 'title="Descargar([^"]+)">' # title
|
|
||||||
patron += '<img src="([^"]+)"' # thumbnail
|
|
||||||
|
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
|
||||||
scrapertools.printMatches(matches)
|
|
||||||
|
|
||||||
for scrapedcreatedate, scrapedinfo, scrapedurl, scrapedtitle, scrapedthumbnail in matches:
|
|
||||||
scrapedtitle = scrapedtitle + "(Tamaño:" + scrapedinfo + "--" + scrapedcreatedate + ")"
|
|
||||||
itemlist.append(Item(channel=item.channel, title=scrapedtitle, url=scrapedurl, action="play", server="torrent",
|
|
||||||
thumbnail=scrapedthumbnail, fulltitle=scrapedtitle, folder=True))
|
|
||||||
|
|
||||||
from core import servertools
|
|
||||||
itemlist.extend(servertools.find_video_items(data=data))
|
|
||||||
for videoitem in itemlist:
|
|
||||||
videoitem.channel = item.channel
|
|
||||||
videoitem.action = "play"
|
|
||||||
videoitem.folder = False
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def submenu(item):
|
def submenu(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
if item.title == "Películas":
|
data = httptools.downloadpage(item.url).data
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title="Peliculas DVDRIP-BRRIP Castellano",
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
url="http://www.newpct.com/peliculas-castellano/peliculas-rip/",
|
patron = '<li><a href="'+item.url+'"><i.+?<ul>(.+?)<\/ul>' #Filtrado por url
|
||||||
viewmode="movie_with_plot"))
|
data_cat = scrapertools.find_single_match(data, patron)
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title="Peliculas Latino",
|
patron_cat='<li><a href="(.+?)" title="(.+?)".+?<\/a><\/li>'
|
||||||
url="http://www.newpct.com/peliculas-latino/", viewmode="movie_with_plot"))
|
matches = scrapertools.find_multiple_matches(data_cat, patron_cat)
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title="Estrenos de Cine Castellano",
|
for scrapedurl, scrapedtitle in matches:
|
||||||
url="http://www.newpct.com/peliculas-castellano/estrenos-de-cine/",
|
itemlist.append(item.clone(title=scrapedtitle, url=scrapedurl,action="listado"))
|
||||||
viewmode="movie_with_plot"))
|
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title="Peliculas Alta Definicion HD",
|
|
||||||
url="http://www.newpct.com/cine-alta-definicion-hd/", viewmode="movie_with_plot"))
|
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title="Peliculas en 3D HD",
|
|
||||||
url="http://www.newpct.com/peliculas-en-3d-hd/", viewmode="movie_with_plot"))
|
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title="Peliculas DVDFULL",
|
|
||||||
url="http://www.newpct.com/peliculas-castellano/peliculas-dvd/",
|
|
||||||
viewmode="movie_with_plot"))
|
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title="Peliculas V.O.Subtituladas",
|
|
||||||
url="http://www.newpct.com/peliculas-vo/", viewmode="movie_with_plot"))
|
|
||||||
else:
|
|
||||||
itemlist.append(
|
|
||||||
Item(channel=item.channel, action="listado", title="HDTV Castellano", url="http://www.newpct.com/series/",
|
|
||||||
category="serie", viewmode="movie_with_plot"))
|
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title="Miniseries Castellano",
|
|
||||||
url="http://www.newpct.com/miniseries-es/", viewmode="movie_with_plot"))
|
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title="Series TV - V.O.S.E",
|
|
||||||
url="http://www.newpct.com/series-vo/", category="serie", viewmode="movie_with_plot"))
|
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title="Últimos Capítulos HD",
|
|
||||||
url="http://www.newpct.com/series-alta-definicion-hd/", category="serie",
|
|
||||||
viewmode="movie_with_plot"))
|
|
||||||
itemlist.append(Item(channel=item.channel, action="series", title="Series HD [A-Z]",
|
|
||||||
url="http://www.newpct.com/index.php?l=torrentListByCategory&subcategory_s=1469&more=listar",
|
|
||||||
category="serie"))
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def listado(item):
|
def listado(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = scrapertools.cache_page(item.url)
|
data = httptools.downloadpage(item.url).data
|
||||||
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
'''
|
patron_data='<ul class="pelilist">(.+?)</ul>'
|
||||||
<li>
|
data_listado = scrapertools.find_single_match(data, patron_data)
|
||||||
<a href='http://www.newpct.com/descargar-pelicula/la-pequena-venecia/'>
|
patron_listado='<li><a href="(.+?)" title=".+?"><img src="(.+?)".+?><h2'
|
||||||
<div class='boxgrid captionb'>
|
if 'Serie' in item.title:
|
||||||
<img src='http://images.newpct.com/banco_de_imagenes/destacados/038707/la-pequeña-venecia--dvdrip--ac3-5-1-español-castellano--2012-.jpg' alt='Descargar Peliculas Castellano » Películas RIP La Pequeña Venecia [DVDrip][AC3 5.1 Español Castellano][2012]' />
|
patron_listado+='.+?>'
|
||||||
<div class='cover boxcaption'>
|
else:
|
||||||
<h3>La Pequeña Venecia </h3>
|
patron_listado+='>'
|
||||||
<p>Peliculas Castellano<br/>
|
patron_listado+='(.+?)<\/h2><span>(.+?)<\/span><\/a><\/li>'
|
||||||
Calidad: DVDRIP AC3 5.1<br>
|
matches = scrapertools.find_multiple_matches(data_listado, patron_listado)
|
||||||
Tamaño: 1.1 GB<br>
|
for scrapedurl, scrapedthumbnail,scrapedtitle,scrapedquality in matches:
|
||||||
Idioma : Español Castellano
|
if 'Serie' in item.title:
|
||||||
</p>
|
action="episodios"
|
||||||
</div>
|
else:
|
||||||
</div>
|
action="findvideos"
|
||||||
</a>
|
itemlist.append(item.clone(title=scrapedtitle, url=scrapedurl,thumbnail=scrapedthumbnail, action=action, quality=scrapedquality,show=scrapedtitle))
|
||||||
<div id='bot-desc'>
|
|
||||||
<div id='tinfo'>
|
|
||||||
<a class='youtube' href='#' rel='gx9EKDC0UFQ' title='Ver Trailer' alt='Ver Trailer'>
|
|
||||||
<img style='width:25px;' src='http://www.newpct.com/images.inc/images/playm2.gif'></a>
|
|
||||||
</div>
|
|
||||||
<div id='tdescargar' ><a class='atdescargar' href='http://www.newpct.com/descargar-pelicula/la-pequena-venecia/'>DESCARGAR</a></div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
'''
|
|
||||||
patron = "<li[^<]+"
|
|
||||||
patron += "<a href='([^']+)'[^<]+"
|
|
||||||
patron += "<div class='boxgrid captionb'[^<]+"
|
|
||||||
patron += "<img src='([^']+)'[^<]+"
|
|
||||||
patron += "<div class='cover boxcaption'[^<]+"
|
|
||||||
patron += '<h3>([^<]+)</h3>(.*?)</div>'
|
|
||||||
|
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
|
||||||
|
|
||||||
for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedplot in matches:
|
|
||||||
title = scrapedtitle.strip()
|
|
||||||
title = unicode(title, "iso-8859-1", errors="replace").encode("utf-8")
|
|
||||||
|
|
||||||
url = urlparse.urljoin(item.url, scrapedurl)
|
|
||||||
thumbnail = urlparse.urljoin(item.url, scrapedthumbnail)
|
|
||||||
plot = scrapertools.htmlclean(scrapedplot).strip()
|
|
||||||
plot = unicode(plot, "iso-8859-1", errors="replace").encode("utf-8")
|
|
||||||
|
|
||||||
logger.debug("title=[" + title + "], url=[" + url + "], thumbnail=[" + thumbnail + "]")
|
|
||||||
if item.category == "serie":
|
|
||||||
itemlist.append(
|
|
||||||
Item(channel=item.channel, action="episodios", title=title, url=url, thumbnail=thumbnail, plot=plot))
|
|
||||||
else:
|
|
||||||
itemlist.append(
|
|
||||||
Item(channel=item.channel, action="findvideos", title=title, url=url, thumbnail=thumbnail, plot=plot,
|
|
||||||
contentTitle=title))
|
|
||||||
|
|
||||||
# Página siguiente
|
# Página siguiente
|
||||||
'''
|
patron_pag='<ul class="pagination"><li><a class="current" href=".+?">.+?<\/a>.+?<a href="(.+?)">'
|
||||||
GET /include.inc/ajax.php/orderCategory.php?type=todo&leter=&sql=SELECT+DISTINCT+++%09%09%09%09%09%09torrentID%2C+++%09%09%09%09%09%09torrentCategoryID%2C+++%09%09%09%09%09%09torrentCategoryIDR%2C+++%09%09%09%09%09%09torrentImageID%2C+++%09%09%09%09%09%09torrentName%2C+++%09%09%09%09%09%09guid%2C+++%09%09%09%09%09%09torrentShortName%2C++%09%09%09%09%09%09torrentLanguage%2C++%09%09%09%09%09%09torrentSize%2C++%09%09%09%09%09%09calidad+as+calidad_%2C++%09%09%09%09%09%09torrentDescription%2C++%09%09%09%09%09%09torrentViews%2C++%09%09%09%09%09%09rating%2C++%09%09%09%09%09%09n_votos%2C++%09%09%09%09%09%09vistas_hoy%2C++%09%09%09%09%09%09vistas_ayer%2C++%09%09%09%09%09%09vistas_semana%2C++%09%09%09%09%09%09vistas_mes++%09%09%09%09++FROM+torrentsFiles+as+t+WHERE++(torrentStatus+%3D+1+OR+torrentStatus+%3D+2)++AND+(torrentCategoryID+IN+(1537%2C+758%2C+1105%2C+760%2C+1225))++++ORDER+BY+torrentDateAdded++DESC++LIMIT+0%2C+50&pag=3&tot=&ban=3&cate=1225 HTTP/1.1
|
siguiente = scrapertools.find_single_match(data, patron_pag)
|
||||||
Host: www.newpct.com
|
itemlist.append(
|
||||||
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0
|
Item(channel=item.channel, title="[COLOR cyan]Página Siguiente >>[/COLOR]", url=siguiente, action="listado"))
|
||||||
Accept: */*
|
|
||||||
Accept-Language: es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3
|
|
||||||
Accept-Encoding: gzip, deflate
|
|
||||||
X-Requested-With: XMLHttpRequest
|
|
||||||
Referer: http://www.newpct.com/peliculas-castellano/peliculas-rip/
|
|
||||||
Cookie: adbooth_popunder=5%7CSat%2C%2009%20Mar%202013%2018%3A23%3A22%20GMT
|
|
||||||
Connection: keep-alive
|
|
||||||
'''
|
|
||||||
|
|
||||||
'''
|
|
||||||
function orderCategory(type,leter,pag,other)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
if(leter=='buscar')
|
|
||||||
{
|
|
||||||
leter = document.getElementById('word').value;
|
|
||||||
}
|
|
||||||
if(type=='todo')
|
|
||||||
{
|
|
||||||
document.getElementById('todo').className = "active_todo";
|
|
||||||
}
|
|
||||||
if(type=='letter')
|
|
||||||
{
|
|
||||||
switch(leter)
|
|
||||||
{
|
|
||||||
case '09':
|
|
||||||
document.getElementById('09').className = "active_num";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
document.getElementById(leter).className = "active_a";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var parametros = {
|
|
||||||
"type" : type,
|
|
||||||
"leter" : leter,
|
|
||||||
"sql" : "SELECT DISTINCT torrentID, torrentCategoryID, torrentCategoryIDR, torrentImageID, torrentName, guid, torrentShortName, torrentLanguage, torrentSize, calidad as calidad_, torrentDescription, torrentViews, rating, n_votos, vistas_hoy, vistas_ayer, vistas_semana, vistas_mes FROM torrentsFiles as t WHERE (torrentStatus = 1 OR torrentStatus = 2) AND (torrentCategoryID IN (1537, 758, 1105, 760, 1225)) ORDER BY torrentDateAdded DESC LIMIT 0, 50",
|
|
||||||
"pag" : pag,
|
|
||||||
"tot" : '',
|
|
||||||
"ban" : '3',
|
|
||||||
"other": other,
|
|
||||||
"cate" : '1225'
|
|
||||||
|
|
||||||
};
|
|
||||||
//alert(type+leter);
|
|
||||||
|
|
||||||
$('#content-category').html('<div style="margin:100px auto;width:100px;height:100px;"><img src="http://www.newpct.com/images.inc/images/ajax-loader.gif"/></div>');
|
|
||||||
var page = $(this).attr('data');
|
|
||||||
var dataString = 'page='+page;
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
type: "GET",
|
|
||||||
url: 'http://www.newpct.com/include.inc/ajax.php/orderCategory.php',
|
|
||||||
data: parametros,
|
|
||||||
success: function(data) {
|
|
||||||
|
|
||||||
//Cargamos finalmente el contenido deseado
|
|
||||||
$('#content-category').fadeIn(1000).html(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
'''
|
|
||||||
if item.extra != "":
|
|
||||||
bloque = item.extra
|
|
||||||
else:
|
|
||||||
bloque = scrapertools.get_match(data, "function orderCategory(.*?)\}\)\;")
|
|
||||||
logger.info("bloque=" + bloque)
|
|
||||||
param_type = scrapertools.get_match(data, "<a href='javascript:;' onclick=\"orderCategory\('([^']+)'[^>]+> >> </a>")
|
|
||||||
logger.info("param_type=" + param_type)
|
|
||||||
param_leter = scrapertools.get_match(data,
|
|
||||||
"<a href='javascript:;' onclick=\"orderCategory\('[^']+','([^']*)'[^>]+> >> </a>")
|
|
||||||
logger.info("param_leter=" + param_leter)
|
|
||||||
param_pag = scrapertools.get_match(data,
|
|
||||||
"<a href='javascript:;' onclick=\"orderCategory\('[^']+','[^']*','([^']+)'[^>]+> >> </a>")
|
|
||||||
logger.info("param_pag=" + param_pag)
|
|
||||||
param_total = scrapertools.get_match(bloque, '"total"\s*\:\s*\'([^\']+)')
|
|
||||||
logger.info("param_sql=" + param_total)
|
|
||||||
param_sql = scrapertools.get_match(bloque, '"sql"\s*\:\s*\'([^\']+)')
|
|
||||||
logger.info("param_sql=" + param_sql)
|
|
||||||
param_tot = scrapertools.get_match(bloque, "\"tot\"\s*\:\s*'([^']*)'")
|
|
||||||
logger.info("param_tot=" + param_tot)
|
|
||||||
param_ban = scrapertools.get_match(bloque, "\"ban\"\s*\:\s*'([^']+)'")
|
|
||||||
logger.info("param_ban=" + param_ban)
|
|
||||||
param_cate = scrapertools.get_match(bloque, "\"cate\"\s*\:\s*'([^']+)'")
|
|
||||||
logger.info("param_cate=" + param_cate)
|
|
||||||
base_url = scrapertools.get_match(bloque, "url\s*\:\s*'([^']+)'")
|
|
||||||
base_url = re.sub("../..", "http://www.newpct.com", base_url, count=1)
|
|
||||||
logger.info("base_url=" + base_url)
|
|
||||||
# http://www.newpct.com/include.inc/ajax.php/orderCategory.php?type=todo&leter=&sql=SELECT+DISTINCT+++%09%09%09%09%09%09torrentID%2C+++%09%09%09%09%09%09torrentCategoryID%2C+++%09%09%09%09%09%09torrentCategoryIDR%2C+++%09%09%09%09%09%09torrentImageID%2C+++%09%09%09%09%09%09torrentName%2C+++%09%09%09%09%09%09guid%2C+++%09%09%09%09%09%09torrentShortName%2C++%09%09%09%09%09%09torrentLanguage%2C++%09%09%09%09%09%09torrentSize%2C++%09%09%09%09%09%09calidad+as+calidad_%2C++%09%09%09%09%09%09torrentDescription%2C++%09%09%09%09%09%09torrentViews%2C++%09%09%09%09%09%09rating%2C++%09%09%09%09%09%09n_votos%2C++%09%09%09%09%09%09vistas_hoy%2C++%09%09%09%09%09%09vistas_ayer%2C++%09%09%09%09%09%09vistas_semana%2C++%09%09%09%09%09%09vistas_mes++%09%09%09%09++FROM+torrentsFiles+as+t+WHERE++(torrentStatus+%3D+1+OR+torrentStatus+%3D+2)++AND+(torrentCategoryID+IN+(1537%2C+758%2C+1105%2C+760%2C+1225))++++ORDER+BY+torrentDateAdded++DESC++LIMIT+0%2C+50&pag=3&tot=&ban=3&cate=1225
|
|
||||||
url_next_page = base_url + "?" + urllib.urlencode(
|
|
||||||
{"total": param_total, "type": param_type, "leter": param_leter, "sql": param_sql, "pag": param_pag,
|
|
||||||
"tot": param_tot, "ban": param_ban, "cate": param_cate})
|
|
||||||
logger.info("url_next_page=" + url_next_page)
|
|
||||||
if item.category == "serie":
|
|
||||||
itemlist.append(
|
|
||||||
Item(channel=item.channel, action="listado", title=">> Página siguiente", url=url_next_page, extra=bloque,
|
|
||||||
category="serie", viewmode="movie_with_plot"))
|
|
||||||
else:
|
|
||||||
itemlist.append(
|
|
||||||
Item(channel=item.channel, action="listado", title=">> Página siguiente", url=url_next_page, extra=bloque,
|
|
||||||
viewmode="movie_with_plot"))
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def series(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
# Lista menú Series de la A-Z
|
|
||||||
data = scrapertools.cache_page(item.url)
|
|
||||||
patron = '<div id="content-abc">(.*?)<\/div>'
|
|
||||||
data = re.compile(patron, re.DOTALL | re.M).findall(data)
|
|
||||||
patron = 'id="([^"]+)".*?>([^"]+)<\/a>'
|
|
||||||
matches = re.compile(patron, re.DOTALL | re.M).findall(data[0])
|
|
||||||
for id, scrapedtitle in matches:
|
|
||||||
url_base = "http://www.newpct.com/include.inc/ajax.php/orderCategory.php?total=9&type=letter&leter=%s&sql=+%09%09SELECT++t.torrentID%2C++%09%09%09%09t.torrentCategoryID%2C++%09%09%09%09t.torrentCategoryIDR%2C++%09%09%09%09t.torrentImageID%2C++%09%09%09%09t.torrentName%2C++%09%09%09%09t.guid%2C++%09%09%09%09t.torrentShortName%2C+%09%09%09%09t.torrentLanguage%2C+%09%09%09%09t.torrentSize%2C+%09%09%09%09t.calidad+as+calidad_%2C+%09%09%09%09t.torrentDescription%2C+%09%09%09%09t.torrentViews%2C+%09%09%09%09t.rating%2C+%09%09%09%09t.n_votos%2C+%09%09%09%09t.vistas_hoy%2C+%09%09%09%09t.vistas_ayer%2C+%09%09%09%09t.vistas_semana%2C+%09%09%09%09t.vistas_mes%2C+%09%09%09%09t.imagen+FROM+torrentsFiles+as+t++%09%09LEFT+JOIN+torrentsCategories+as+tc+ON+(t.torrentCategoryID+%3D+tc.categoryID)++%09%09INNER+JOIN++%09%09(+%09%09%09SELECT+torrentID+%09%09%09FROM+torrentsFiles++%09%09%09WHERE++torrentCategoryIDR+%3D+1469+%09%09%09ORDER+BY+torrentID+DESC+%09%09)t1+ON+t1.torrentID+%3D+t.torrentID+WHERE+(t.torrentStatus+%3D+1+OR+t.torrentStatus+%3D+2)+AND+t.home_active+%3D+0++AND+tc.categoryIDR+%3D+1469+GROUP+BY+t.torrentCategoryID+ORDER+BY+t.torrentID+DESC+LIMIT+0%2C+50&pag=&tot=&ban=3&cate=1469"
|
|
||||||
scrapedurl = url_base.replace("%s", id)
|
|
||||||
if id != "todo": itemlist.append(
|
|
||||||
Item(channel=item.channel, action="listaseries", title=scrapedtitle, url=scrapedurl, folder=True))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def listaseries(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
data = scrapertools.downloadpageGzip(item.url)
|
|
||||||
patron = "<li[^<]+<a href='([^']+)'>.*?<img src='([^']+)'.*?<h3>([^']+)<\/h3>"
|
|
||||||
matches = re.compile(patron, re.DOTALL | re.M).findall(data)
|
|
||||||
for scrapedurl, scrapedthumbnail, scrapedtitle in matches:
|
|
||||||
itemlist.append(Item(channel=item.channel, action="episodios", title=scrapedtitle, url=scrapedurl,
|
|
||||||
thumbnail=scrapedthumbnail, folder=True))
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
data = scrapertools.cache_page(item.url)
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
patron = "<ul style='display:none;'.*?>(.*?)<\/ul>"
|
patron_data='<ul class="buscar-list">(.+?)</ul>'
|
||||||
data = re.compile(patron, re.DOTALL | re.M).findall(data)
|
data_listado = scrapertools.find_single_match(data, patron_data)
|
||||||
patron = "<a href='([^']+)'.*?title='([^']+)'"
|
patron = '<img src="(.+?)" alt=".+?">.+?<div class=".+?">.+?<a href=(.+?)" title=".+?">.+?>Serie.+?>(.+?)<'
|
||||||
for index in range(len(data)):
|
matches = scrapertools.find_multiple_matches(data_listado, patron)
|
||||||
matches = re.compile(patron, re.DOTALL | re.M).findall(data[index])
|
for scrapedthumbnail,scrapedurl, scrapedtitle in matches:
|
||||||
for scrapedurl, scrapedtitle in matches:
|
if " al " in scrapedtitle:
|
||||||
itemlist.append(Item(channel=item.channel, action="findvideos", title=scrapedtitle, url=scrapedurl,
|
#action="episodios"
|
||||||
thumbnail=item.thumbnail, folder=True))
|
titulo=scrapedurl.split('http')
|
||||||
|
scrapedurl="http"+titulo[1]
|
||||||
|
itemlist.append(item.clone(title=scrapedtitle, url=scrapedurl,thumbnail=scrapedthumbnail, action="findvideos", show=scrapedtitle))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
new_item = []
|
||||||
data = scrapertools.cache_page(item.url)
|
data = httptools.downloadpage(item.url).data
|
||||||
|
itemlist = servertools.find_video_items(data = data)
|
||||||
# <span id='content-torrent'> <a href='http://tumejorjuego.com/descargar/index.php?link=descargar/torrent/58591/el-tour-de-los-muppets-bluray-screener-espanol-castellano-line-2014.html' rel='nofollow' id='58591' title='el-tour-de-los-muppets-bluray-screener-espanol-castellano-line-2014' class='external-url' target='_blank'>
|
url = scrapertools.find_single_match( data, 'location.href = "([^"]+)"')
|
||||||
torrent_url = scrapertools.find_single_match(data, "<span id='content-torrent'[^<]+<a href='([^']+)'")
|
new_item.append(Item(url = url, title = "Torrent", server = "torrent", action = "play"))
|
||||||
if torrent_url != "":
|
itemlist.extend(new_item)
|
||||||
itemlist.append(Item(channel=item.channel, action="play", title="Torrent", url=torrent_url, server="torrent"))
|
for it in itemlist:
|
||||||
|
it.channel = item.channel
|
||||||
from core import servertools
|
|
||||||
itemlist.extend(servertools.find_video_items(data=data))
|
|
||||||
for videoitem in itemlist:
|
|
||||||
videoitem.channel = item.channel
|
|
||||||
videoitem.action = "play"
|
|
||||||
videoitem.folder = False
|
|
||||||
videoitem.title = "[" + videoitem.server + "]"
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
@@ -1,470 +1,100 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import urllib
|
||||||
|
import urlparse
|
||||||
|
|
||||||
from channelselector import get_thumb
|
|
||||||
from core import httptools
|
|
||||||
from core import scrapertools
|
|
||||||
from core import servertools
|
from core import servertools
|
||||||
|
from core import scrapertools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import logger
|
||||||
from core import tmdb
|
from core import httptools
|
||||||
|
|
||||||
|
Host='http://descargas2020.com'
|
||||||
|
|
||||||
host = 'http://newpct1.com/'
|
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
itemlist.append(Item(channel=item.channel, action="submenu", title="Películas",url=Host+"/peliculas/"))
|
||||||
thumb_pelis=get_thumb("channels_movie.png")
|
itemlist.append(Item(channel=item.channel, action="submenu", title="Series",url=Host+"/series/"))
|
||||||
thumb_series=get_thumb("channels_tvshow.png")
|
#itemlist.append(Item(channel=item.channel, action="listado", title="Anime", url=Host+"/anime/",
|
||||||
thumb_search = get_thumb("search.png")
|
# viewmode="movie_with_plot"))
|
||||||
|
#itemlist.append(
|
||||||
itemlist.append(Item(channel=item.channel, action="submenu", title="Películas", url=host,
|
# Item(channel=item.channel, action="listado", title="Documentales", url=Host+"/documentales/",
|
||||||
extra="peliculas", thumbnail=thumb_pelis ))
|
# viewmode="movie_with_plot"))
|
||||||
|
#itemlist.append(Item(channel=item.channel, action="search", title="Buscar"))
|
||||||
itemlist.append(Item(channel=item.channel, action="submenu", title="Series", url=host, extra="series",
|
|
||||||
thumbnail=thumb_series))
|
|
||||||
itemlist.append(
|
|
||||||
Item(channel=item.channel, action="search", title="Buscar", url=host + "buscar", thumbnail=thumb_search))
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def submenu(item):
|
def submenu(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url).data)
|
data = httptools.downloadpage(item.url).data
|
||||||
data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8")
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
|
patron = '<li><a href="'+item.url+'"><i.+?<ul>(.+?)<\/ul>' #Filtrado por url
|
||||||
patron = '<li><a href="http://(?:www.)?newpct1.com/' + item.extra + '/">.*?<ul>(.*?)</ul>'
|
data_cat = scrapertools.find_single_match(data, patron)
|
||||||
data = scrapertools.get_match(data, patron)
|
patron_cat='<li><a href="(.+?)" title="(.+?)".+?<\/a><\/li>'
|
||||||
|
matches = scrapertools.find_multiple_matches(data_cat, patron_cat)
|
||||||
patron = '<a href="([^"]+)".*?>([^>]+)</a>'
|
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
|
||||||
|
|
||||||
for scrapedurl, scrapedtitle in matches:
|
for scrapedurl, scrapedtitle in matches:
|
||||||
title = scrapedtitle.strip()
|
itemlist.append(item.clone(title=scrapedtitle, url=scrapedurl,action="listado"))
|
||||||
url = scrapedurl
|
|
||||||
|
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title=title, url=url, extra="pelilist"))
|
|
||||||
itemlist.append(
|
|
||||||
Item(channel=item.channel, action="alfabeto", title=title + " [A-Z]", url=url, extra="pelilist"))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def alfabeto(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
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 = '<ul class="alfabeto">(.*?)</ul>'
|
|
||||||
data = scrapertools.get_match(data, patron)
|
|
||||||
|
|
||||||
patron = '<a href="([^"]+)"[^>]+>([^>]+)</a>'
|
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
|
||||||
|
|
||||||
for scrapedurl, scrapedtitle in matches:
|
|
||||||
title = scrapedtitle.upper()
|
|
||||||
url = scrapedurl
|
|
||||||
|
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title=title, url=url, extra=item.extra))
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def listado(item):
|
def listado(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
url_next_page =''
|
data = httptools.downloadpage(item.url).data
|
||||||
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url).data)
|
patron_data='<ul class="pelilist">(.+?)</ul>'
|
||||||
data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8")
|
data_listado = scrapertools.find_single_match(data, patron_data)
|
||||||
#logger.debug(data)
|
patron_listado='<li><a href="(.+?)" title=".+?"><img src="(.+?)".+?><h2'
|
||||||
logger.debug('item.modo: %s'%item.modo)
|
if 'Serie' in item.title:
|
||||||
logger.debug('item.extra: %s'%item.extra)
|
patron_listado+='.+?>'
|
||||||
|
|
||||||
if item.modo != 'next' or item.modo =='':
|
|
||||||
logger.debug('item.title: %s'% item.title)
|
|
||||||
patron = '<ul class="' + item.extra + '">(.*?)</ul>'
|
|
||||||
logger.debug("patron=" + patron)
|
|
||||||
fichas = scrapertools.get_match(data, patron)
|
|
||||||
page_extra = item.extra
|
|
||||||
else:
|
else:
|
||||||
fichas = data
|
patron_listado+='>'
|
||||||
page_extra = item.extra
|
patron_listado+='(.+?)<\/h2><span>(.+?)<\/span><\/a><\/li>'
|
||||||
|
matches = scrapertools.find_multiple_matches(data_listado, patron_listado)
|
||||||
patron = '<a href="([^"]+).*?' # la url
|
for scrapedurl, scrapedthumbnail,scrapedtitle,scrapedquality in matches:
|
||||||
patron += 'title="([^"]+).*?' # el titulo
|
if 'Serie' in item.title:
|
||||||
patron += '<img src="([^"]+)"[^>]+>.*?' # el thumbnail
|
action="episodios"
|
||||||
patron += '<span>([^<].*?)<' # la calidad
|
|
||||||
|
|
||||||
matches = re.compile(patron, re.DOTALL).findall(fichas)
|
|
||||||
logger.debug('item.next_page: %s'%item.next_page)
|
|
||||||
|
|
||||||
|
|
||||||
# Paginacion
|
|
||||||
if item.next_page != 'b':
|
|
||||||
if len(matches) > 30:
|
|
||||||
url_next_page = item.url
|
|
||||||
matches = matches[:30]
|
|
||||||
next_page = 'b'
|
|
||||||
modo = 'continue'
|
|
||||||
else:
|
|
||||||
matches = matches[30:]
|
|
||||||
next_page = 'a'
|
|
||||||
patron_next_page = '<a href="([^"]+)">Next<\/a>'
|
|
||||||
matches_next_page = re.compile(patron_next_page, re.DOTALL).findall(data)
|
|
||||||
modo = 'continue'
|
|
||||||
if len(matches_next_page) > 0:
|
|
||||||
url_next_page = matches_next_page[0]
|
|
||||||
modo = 'next'
|
|
||||||
|
|
||||||
for scrapedurl, scrapedtitle, scrapedthumbnail, calidad in matches:
|
|
||||||
url = scrapedurl
|
|
||||||
title = scrapedtitle
|
|
||||||
thumbnail = scrapedthumbnail
|
|
||||||
action = "findvideos"
|
|
||||||
extra = ""
|
|
||||||
year = scrapertools.find_single_match(scrapedthumbnail, r'-(\d{4})')
|
|
||||||
if "1.com/series" in url:
|
|
||||||
action = "episodios"
|
|
||||||
extra = "serie"
|
|
||||||
|
|
||||||
|
|
||||||
title = scrapertools.find_single_match(title, '([^-]+)')
|
|
||||||
title = title.replace("Ver online", "", 1).replace("Descarga Serie HD", "", 1).replace("Ver en linea", "",
|
|
||||||
1).strip()
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
title = title.replace("Descargar", "", 1).strip()
|
action="findvideos"
|
||||||
if title.endswith("gratis"): title = title[:-7]
|
itemlist.append(item.clone(title=scrapedtitle, url=scrapedurl,thumbnail=scrapedthumbnail, action=action, quality=scrapedquality,show=scrapedtitle))
|
||||||
|
# Página siguiente
|
||||||
show = title
|
patron_pag='<ul class="pagination"><li><a class="current" href=".+?">.+?<\/a>.+?<a href="(.+?)">'
|
||||||
if item.extra != "buscar-list":
|
siguiente = scrapertools.find_single_match(data, patron_pag)
|
||||||
title = title + ' ' + calidad
|
itemlist.append(
|
||||||
|
Item(channel=item.channel, title="[COLOR cyan]Página Siguiente >>[/COLOR]", url=siguiente, action="listado"))
|
||||||
context = ""
|
|
||||||
context_title = scrapertools.find_single_match(url, "http://(?:www.)?newpct1.com/(.*?)/(.*?)/")
|
|
||||||
if context_title:
|
|
||||||
try:
|
|
||||||
context = context_title[0].replace("descargar-", "").replace("pelicula", "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 = show
|
|
||||||
logger.debug('contxt title: %s'%context_title)
|
|
||||||
logger.debug('year: %s' % year)
|
|
||||||
|
|
||||||
logger.debug('context: %s' % context)
|
|
||||||
if not 'array' in title:
|
|
||||||
itemlist.append(Item(channel=item.channel, action=action, title=title, url=url, thumbnail=thumbnail,
|
|
||||||
extra = extra,
|
|
||||||
show = context_title, contentTitle=context_title, contentType=context,
|
|
||||||
context=["buscar_trailer"], infoLabels= {'year':year}))
|
|
||||||
|
|
||||||
tmdb.set_infoLabels(itemlist, True)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if url_next_page:
|
|
||||||
itemlist.append(Item(channel=item.channel, action="listado", title=">> Página siguiente",
|
|
||||||
url=url_next_page, next_page=next_page, folder=True,
|
|
||||||
text_color='yellow', text_bold=True, modo = modo, plot = extra,
|
|
||||||
extra = page_extra))
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def listado2(item):
|
def episodios(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url, post=item.post).data)
|
data = httptools.downloadpage(item.url).data
|
||||||
data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8")
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
|
patron_data='<ul class="buscar-list">(.+?)</ul>'
|
||||||
list_chars = [["ñ", "ñ"]]
|
data_listado = scrapertools.find_single_match(data, patron_data)
|
||||||
|
patron = '<img src="(.+?)" alt=".+?">.+?<div class=".+?">.+?<a href=(.+?)" title=".+?">.+?>Serie.+?>(.+?)<'
|
||||||
for el in list_chars:
|
matches = scrapertools.find_multiple_matches(data_listado, patron)
|
||||||
data = re.sub(r"%s" % el[0], el[1], data)
|
for scrapedthumbnail,scrapedurl, scrapedtitle in matches:
|
||||||
|
if " al " in scrapedtitle:
|
||||||
try:
|
#action="episodios"
|
||||||
get, post = scrapertools.find_single_match(data, '<ul class="pagination">.*?<a class="current" href.*?'
|
titulo=scrapedurl.split('http')
|
||||||
'<a\s*href="([^"]+)"(?:\s*onClick=".*?\'([^"]+)\'.*?")')
|
scrapedurl="http"+titulo[1]
|
||||||
except:
|
itemlist.append(item.clone(title=scrapedtitle, url=scrapedurl,thumbnail=scrapedthumbnail, action="findvideos", show=scrapedtitle))
|
||||||
post = False
|
|
||||||
|
|
||||||
if post:
|
|
||||||
if "pg" in item.post:
|
|
||||||
item.post = re.sub(r"pg=(\d+)", "pg=%s" % post, item.post)
|
|
||||||
else:
|
|
||||||
item.post += "&pg=%s" % post
|
|
||||||
|
|
||||||
pattern = '<ul class="%s">(.*?)</ul>' % item.pattern
|
|
||||||
data = scrapertools.get_match(data, pattern)
|
|
||||||
pattern = '<li><a href="(?P<url>[^"]+)".*?<img src="(?P<img>[^"]+)"[^>]+>.*?<h2.*?>\s*(?P<title>.*?)\s*</h2>'
|
|
||||||
|
|
||||||
matches = re.compile(pattern, re.DOTALL).findall(data)
|
|
||||||
|
|
||||||
for url, thumb, title in matches:
|
|
||||||
# fix encoding for title
|
|
||||||
real_title = scrapertools.find_single_match(title, r'font color.*?font.*?><b>(.*?)<\/b><\/font>')
|
|
||||||
title = scrapertools.htmlclean(title)
|
|
||||||
title = title.replace("�", "ñ")
|
|
||||||
|
|
||||||
# no mostramos lo que no sean videos
|
|
||||||
if "/juego/" in url or "/varios/" in url:
|
|
||||||
continue
|
|
||||||
|
|
||||||
if ".com/series" in url:
|
|
||||||
|
|
||||||
show = real_title
|
|
||||||
|
|
||||||
itemlist.append(Item(channel=item.channel, action="episodios", title=title, url=url, thumbnail=thumb,
|
|
||||||
context=["buscar_trailer"], contentSerieName=show))
|
|
||||||
else:
|
|
||||||
|
|
||||||
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, url=url, thumbnail=thumb,
|
|
||||||
context=["buscar_trailer"]))
|
|
||||||
|
|
||||||
if post:
|
|
||||||
itemlist.append(item.clone(channel=item.channel, action="listado2", title=">> Página siguiente",
|
|
||||||
thumbnail=get_thumb("next.png")))
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
new_item = []
|
||||||
## Cualquiera de las tres opciones son válidas
|
data = httptools.downloadpage(item.url).data
|
||||||
# item.url = item.url.replace("1.com/","1.com/ver-online/")
|
itemlist = servertools.find_video_items(data = data)
|
||||||
# item.url = item.url.replace("1.com/","1.com/descarga-directa/")
|
url = scrapertools.find_single_match( data, 'location.href = "([^"]+)"')
|
||||||
item.url = item.url.replace("1.com/", "1.com/descarga-torrent/")
|
new_item.append(Item(url = url, title = "Torrent", server = "torrent", action = "play"))
|
||||||
|
itemlist.extend(new_item)
|
||||||
# Descarga la página
|
for it in itemlist:
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url).data)
|
it.channel = item.channel
|
||||||
data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8")
|
|
||||||
|
|
||||||
title = scrapertools.find_single_match(data, "<h1><strong>([^<]+)</strong>[^<]+</h1>")
|
|
||||||
title += scrapertools.find_single_match(data, "<h1><strong>[^<]+</strong>([^<]+)</h1>")
|
|
||||||
caratula = scrapertools.find_single_match(data, '<div class="entry-left">.*?src="([^"]+)"')
|
|
||||||
|
|
||||||
# <a href="http://tumejorjuego.com/download/index.php?link=descargar-torrent/058310_yo-frankenstein-blurayrip-ac3-51.html" title="Descargar torrent de Yo Frankenstein " class="btn-torrent" target="_blank">Descarga tu Archivo torrent!</a>
|
|
||||||
|
|
||||||
patron = 'openTorrent.*?"title=".*?" class="btn-torrent">.*?function openTorrent.*?href = "(.*?)";'
|
|
||||||
|
|
||||||
# escraped torrent
|
|
||||||
url = scrapertools.find_single_match(data, patron)
|
|
||||||
if url != "":
|
|
||||||
itemlist.append(
|
|
||||||
Item(channel=item.channel, action="play", server="torrent", title=title + " [torrent]", fulltitle=title,
|
|
||||||
url=url, thumbnail=caratula, plot=item.plot, folder=False))
|
|
||||||
|
|
||||||
logger.debug("matar %s" % data)
|
|
||||||
# escraped ver vídeos, descargar vídeos un link, múltiples liks
|
|
||||||
data = data.replace("'", '"')
|
|
||||||
data = data.replace(
|
|
||||||
'javascript:;" onClick="popup("http://www.newpct1.com/pct1/library/include/ajax/get_modallinks.php?links=', "")
|
|
||||||
data = data.replace("http://tumejorserie.com/descargar/url_encript.php?link=", "")
|
|
||||||
data = data.replace("$!", "#!")
|
|
||||||
|
|
||||||
patron_descargar = '<div id="tab2"[^>]+>.*?</ul>'
|
|
||||||
patron_ver = '<div id="tab3"[^>]+>.*?</ul>'
|
|
||||||
|
|
||||||
match_ver = scrapertools.find_single_match(data, patron_ver)
|
|
||||||
match_descargar = scrapertools.find_single_match(data, patron_descargar)
|
|
||||||
|
|
||||||
patron = '<div class="box1"><img src="([^"]+)".*?' # logo
|
|
||||||
patron += '<div class="box2">([^<]+)</div>' # servidor
|
|
||||||
patron += '<div class="box3">([^<]+)</div>' # idioma
|
|
||||||
patron += '<div class="box4">([^<]+)</div>' # calidad
|
|
||||||
patron += '<div class="box5"><a href="([^"]+)".*?' # enlace
|
|
||||||
patron += '<div class="box6">([^<]+)</div>' # titulo
|
|
||||||
|
|
||||||
enlaces_ver = re.compile(patron, re.DOTALL).findall(match_ver)
|
|
||||||
enlaces_descargar = re.compile(patron, re.DOTALL).findall(match_descargar)
|
|
||||||
|
|
||||||
for logo, servidor, idioma, calidad, enlace, titulo in enlaces_ver:
|
|
||||||
servidor = servidor.replace("streamin", "streaminto")
|
|
||||||
titulo = titulo + " [" + servidor + "]"
|
|
||||||
mostrar_server = True
|
|
||||||
if config.get_setting("hidepremium"):
|
|
||||||
mostrar_server = servertools.is_server_enabled(servidor)
|
|
||||||
if mostrar_server:
|
|
||||||
try:
|
|
||||||
devuelve = servertools.findvideosbyserver(enlace, servidor)
|
|
||||||
if devuelve:
|
|
||||||
enlace = devuelve[0][1]
|
|
||||||
itemlist.append(
|
|
||||||
Item(fanart=item.fanart, channel=item.channel, action="play", server=servidor, title=titulo,
|
|
||||||
fulltitle=item.title, url=enlace, thumbnail=logo, plot=item.plot, folder=False))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
for logo, servidor, idioma, calidad, enlace, titulo in enlaces_descargar:
|
|
||||||
servidor = servidor.replace("uploaded", "uploadedto")
|
|
||||||
partes = enlace.split(" ")
|
|
||||||
p = 1
|
|
||||||
for enlace in partes:
|
|
||||||
parte_titulo = titulo + " (%s/%s)" % (p, len(partes)) + " [" + servidor + "]"
|
|
||||||
p += 1
|
|
||||||
mostrar_server = True
|
|
||||||
if config.get_setting("hidepremium"):
|
|
||||||
mostrar_server = servertools.is_server_enabled(servidor)
|
|
||||||
if mostrar_server:
|
|
||||||
try:
|
|
||||||
devuelve = servertools.findvideosbyserver(enlace, servidor)
|
|
||||||
if devuelve:
|
|
||||||
enlace = devuelve[0][1]
|
|
||||||
itemlist.append(Item(fanart=item.fanart, channel=item.channel, action="play", server=servidor,
|
|
||||||
title=parte_titulo, fulltitle=item.title, url=enlace, thumbnail=logo,
|
|
||||||
plot=item.plot, folder=False))
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
infoLabels = item.infoLabels
|
|
||||||
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")
|
|
||||||
pattern = '<ul class="%s">(.*?)</ul>' % "pagination" # item.pattern
|
|
||||||
pagination = scrapertools.find_single_match(data, pattern)
|
|
||||||
if pagination:
|
|
||||||
pattern = '<li><a href="([^"]+)">Last<\/a>'
|
|
||||||
full_url = scrapertools.find_single_match(pagination, pattern)
|
|
||||||
url, last_page = scrapertools.find_single_match(full_url, r'(.*?\/pg\/)(\d+)')
|
|
||||||
list_pages = [item.url]
|
|
||||||
for x in range(2, int(last_page) + 1):
|
|
||||||
response = httptools.downloadpage('%s%s'% (url,x))
|
|
||||||
if response.sucess:
|
|
||||||
list_pages.append("%s%s" % (url, x))
|
|
||||||
else:
|
|
||||||
list_pages = [item.url]
|
|
||||||
|
|
||||||
for index, page in enumerate(list_pages):
|
|
||||||
logger.debug("Loading page %s/%s url=%s" % (index, len(list_pages), page))
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(page).data)
|
|
||||||
data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8")
|
|
||||||
|
|
||||||
pattern = '<ul class="%s">(.*?)</ul>' % "buscar-list" # item.pattern
|
|
||||||
data = scrapertools.get_match(data, pattern)
|
|
||||||
|
|
||||||
pattern = '<li[^>]*><a href="(?P<url>[^"]+).*?<img src="(?P<thumb>[^"]+)".*?<h2[^>]+>(?P<info>.*?)</h2>'
|
|
||||||
matches = re.compile(pattern, re.DOTALL).findall(data)
|
|
||||||
|
|
||||||
for url, thumb, info in matches:
|
|
||||||
|
|
||||||
if "<span" in info: # new style
|
|
||||||
pattern = ".*?[^>]+>.*?Temporada\s*(?P<season>\d+)\s*Capitulo(?:s)?\s*(?P<episode>\d+)" \
|
|
||||||
"(?:.*?(?P<episode2>\d+)?)<.+?<span[^>]+>(?P<lang>.*?)</span>\s*Calidad\s*<span[^>]+>" \
|
|
||||||
"[\[]\s*(?P<quality>.*?)\s*[\]]</span>"
|
|
||||||
r = re.compile(pattern)
|
|
||||||
match = [m.groupdict() for m in r.finditer(info)][0]
|
|
||||||
|
|
||||||
if match["episode2"]:
|
|
||||||
multi = True
|
|
||||||
title = "%s (%sx%s-%s) [%s][%s]" % (item.show, match["season"], str(match["episode"]).zfill(2),
|
|
||||||
str(match["episode2"]).zfill(2), match["lang"],
|
|
||||||
match["quality"])
|
|
||||||
else:
|
|
||||||
multi = False
|
|
||||||
title = "%s (%sx%s) [%s][%s]" % (item.show, match["season"], str(match["episode"]).zfill(2),
|
|
||||||
match["lang"], match["quality"])
|
|
||||||
|
|
||||||
else: # old style
|
|
||||||
pattern = "\[(?P<quality>.*?)\].*?\[Cap.(?P<season>\d+)(?P<episode>\d{2})(?:_(?P<season2>\d+)" \
|
|
||||||
"(?P<episode2>\d{2}))?.*?\].*?(?:\[(?P<lang>.*?)\])?"
|
|
||||||
|
|
||||||
r = re.compile(pattern)
|
|
||||||
match = [m.groupdict() for m in r.finditer(info)][0]
|
|
||||||
# logger.debug("data %s" % match)
|
|
||||||
|
|
||||||
str_lang = ""
|
|
||||||
if match["lang"] is not None:
|
|
||||||
str_lang = "[%s]" % match["lang"]
|
|
||||||
|
|
||||||
if match["season2"] and match["episode2"]:
|
|
||||||
multi = True
|
|
||||||
if match["season"] == match["season2"]:
|
|
||||||
|
|
||||||
title = "%s (%sx%s-%s) %s[%s]" % (item.show, match["season"], match["episode"],
|
|
||||||
match["episode2"], str_lang, match["quality"])
|
|
||||||
else:
|
|
||||||
title = "%s (%sx%s-%sx%s) %s[%s]" % (item.show, match["season"], match["episode"],
|
|
||||||
match["season2"], match["episode2"], str_lang,
|
|
||||||
match["quality"])
|
|
||||||
else:
|
|
||||||
title = "%s (%sx%s) %s[%s]" % (item.show, match["season"], match["episode"], str_lang,
|
|
||||||
match["quality"])
|
|
||||||
multi = False
|
|
||||||
|
|
||||||
season = match['season']
|
|
||||||
episode = match['episode']
|
|
||||||
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, url=url, thumbnail=thumb,
|
|
||||||
quality=item.quality, multi=multi, contentSeason=season,
|
|
||||||
contentEpisodeNumber=episode, infoLabels = infoLabels))
|
|
||||||
|
|
||||||
# order list
|
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb = True)
|
|
||||||
if len(itemlist) > 1:
|
|
||||||
itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber)))
|
|
||||||
|
|
||||||
if config.get_videolibrary_support() and len(itemlist) > 0:
|
|
||||||
itemlist.append(
|
|
||||||
item.clone(title="Añadir esta serie a la videoteca", action="add_serie_to_library", extra="episodios"))
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
def search(item, texto):
|
|
||||||
logger.info("search:" + texto)
|
|
||||||
# texto = texto.replace(" ", "+")
|
|
||||||
|
|
||||||
try:
|
|
||||||
item.post = "q=%s" % texto
|
|
||||||
item.pattern = "buscar-list"
|
|
||||||
itemlist = listado2(item)
|
|
||||||
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
# Se captura la excepción, para no interrumpir al buscador global si un canal falla
|
|
||||||
except:
|
|
||||||
import sys
|
|
||||||
for line in sys.exc_info():
|
|
||||||
logger.error("%s" % line)
|
|
||||||
return []
|
|
||||||
|
|
||||||
def newest(categoria):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
item = Item()
|
|
||||||
try:
|
|
||||||
item.extra = 'pelilist'
|
|
||||||
if categoria == 'torrent':
|
|
||||||
item.url = host+'peliculas/'
|
|
||||||
|
|
||||||
itemlist = listado(item)
|
|
||||||
if itemlist[-1].title == ">> Página siguiente":
|
|
||||||
itemlist.pop()
|
|
||||||
item.url = host+'series/'
|
|
||||||
itemlist.extend(listado(item))
|
|
||||||
if itemlist[-1].title == ">> Página siguiente":
|
|
||||||
itemlist.pop()
|
|
||||||
|
|
||||||
# Se captura la excepción, para no interrumpir al canal novedades si un canal falla
|
|
||||||
except:
|
|
||||||
import sys
|
|
||||||
for line in sys.exc_info():
|
|
||||||
logger.error("{0}".format(line))
|
|
||||||
return []
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from threading import Thread
|
|
||||||
|
|
||||||
import xbmc
|
|
||||||
import xbmcgui
|
|
||||||
from core import httptools
|
from core import httptools
|
||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
from core import servertools
|
from core import servertools
|
||||||
@@ -12,71 +9,22 @@ from core import tmdb
|
|||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
|
||||||
ACTION_SHOW_FULLSCREEN = 36
|
|
||||||
ACTION_GESTURE_SWIPE_LEFT = 511
|
|
||||||
ACTION_SELECT_ITEM = 7
|
|
||||||
ACTION_PREVIOUS_MENU = 10
|
|
||||||
ACTION_MOVE_LEFT = 1
|
|
||||||
ACTION_MOVE_RIGHT = 2
|
|
||||||
ACTION_MOVE_DOWN = 4
|
|
||||||
ACTION_MOVE_UP = 3
|
|
||||||
OPTION_PANEL = 6
|
|
||||||
OPTIONS_OK = 5
|
|
||||||
|
|
||||||
__modo_grafico__ = config.get_setting('modo_grafico', "peliscon")
|
__modo_grafico__ = config.get_setting('modo_grafico', "peliscon")
|
||||||
|
|
||||||
|
host = "http://peliscon.com"
|
||||||
# Para la busqueda en bing evitando baneos
|
|
||||||
|
|
||||||
def browser(url):
|
|
||||||
import mechanize
|
|
||||||
|
|
||||||
# Utilizamos Browser mechanize para saltar problemas con la busqueda en bing
|
|
||||||
br = mechanize.Browser()
|
|
||||||
# Browser options
|
|
||||||
br.set_handle_equiv(False)
|
|
||||||
br.set_handle_gzip(True)
|
|
||||||
br.set_handle_redirect(True)
|
|
||||||
br.set_handle_referer(False)
|
|
||||||
br.set_handle_robots(False)
|
|
||||||
# Follows refresh 0 but not hangs on refresh > 0
|
|
||||||
br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)
|
|
||||||
# Want debugging messages?
|
|
||||||
# br.set_debug_http(True)
|
|
||||||
# br.set_debug_redirects(True)
|
|
||||||
# br.set_debug_responses(True)
|
|
||||||
|
|
||||||
# User-Agent (this is cheating, ok?)
|
|
||||||
# br.addheaders = [('User-agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/7.1.7 Safari/537.85.16')]
|
|
||||||
# br.addheaders =[('Cookie','SRCHD=AF=QBRE; domain=.bing.com; expires=25 de febrero de 2018 13:00:28 GMT+1; MUIDB=3B942052D204686335322894D3086911; domain=www.bing.com;expires=24 de febrero de 2018 13:00:28 GMT+1')]
|
|
||||||
# Open some site, let's pick a random one, the first that pops in mind
|
|
||||||
r = br.open(url)
|
|
||||||
response = r.read()
|
|
||||||
print response
|
|
||||||
if "img,divreturn" in response:
|
|
||||||
r = br.open("http://ssl-proxy.my-addr.org/myaddrproxy.php/" + url)
|
|
||||||
print "prooooxy"
|
|
||||||
response = r.read()
|
|
||||||
|
|
||||||
return response
|
|
||||||
|
|
||||||
|
|
||||||
api_key = "2e2160006592024ba87ccdf78c28f49f"
|
|
||||||
api_fankey = "dffe90fba4d02c199ae7a9e71330c987"
|
|
||||||
|
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title="[COLOR aqua][B]Películas[/B][/COLOR]", action="scraper", url="http://peliscon.com/peliculas/",
|
item.clone(title="[COLOR aqua][B]Películas[/B][/COLOR]", action="scraper", url= host + "/peliculas/",
|
||||||
thumbnail="http://imgur.com/FrcWTS8.png", fanart="http://imgur.com/MGQyetQ.jpg",
|
thumbnail="http://imgur.com/FrcWTS8.png", fanart="http://imgur.com/MGQyetQ.jpg",
|
||||||
contentType="movie"))
|
contentType="movie"))
|
||||||
itemlist.append(itemlist[-1].clone(title="[COLOR aqua][B]Series[/B][/COLOR]", action="scraper",
|
itemlist.append(itemlist[-1].clone(title="[COLOR aqua][B]Series[/B][/COLOR]", action="scraper",
|
||||||
url="http://peliscon.com/series/", thumbnail="http://imgur.com/FrcWTS8.png",
|
url= host + "/series/", thumbnail="http://imgur.com/FrcWTS8.png",
|
||||||
fanart="http://imgur.com/i41eduI.jpg", contentType="tvshow"))
|
fanart="http://imgur.com/i41eduI.jpg", contentType="tvshow"))
|
||||||
itemlist.append(item.clone(title="[COLOR aqua][B] Últimos capitulos[/B][/COLOR]", action="ul_cap",
|
itemlist.append(item.clone(title="[COLOR aqua][B] Últimos capitulos[/B][/COLOR]", action="ul_cap",
|
||||||
url="http://peliscon.com/episodios/", thumbnail="http://imgur.com/FrcWTS8.png",
|
url= host + "/episodios/", thumbnail="http://imgur.com/FrcWTS8.png",
|
||||||
fanart="http://imgur.com/i41eduI.jpg", contentType="tvshow"))
|
fanart="http://imgur.com/i41eduI.jpg", contentType="tvshow"))
|
||||||
itemlist.append(itemlist[-1].clone(title="[COLOR crimson][B]Buscar[/B][/COLOR]", action="search",
|
itemlist.append(itemlist[-1].clone(title="[COLOR crimson][B]Buscar[/B][/COLOR]", action="search",
|
||||||
thumbnail="http://imgur.com/FrcWTS8.png", fanart="http://imgur.com/h1b7tfN.jpg"))
|
thumbnail="http://imgur.com/FrcWTS8.png", fanart="http://imgur.com/h1b7tfN.jpg"))
|
||||||
@@ -86,7 +34,7 @@ def mainlist(item):
|
|||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
logger.info()
|
logger.info()
|
||||||
texto = texto.replace(" ", "+")
|
texto = texto.replace(" ", "+")
|
||||||
item.url = "https://peliscon.com/?s=" + texto
|
item.url = host + "/?s=" + texto
|
||||||
item.extra = "search"
|
item.extra = "search"
|
||||||
try:
|
try:
|
||||||
return buscador(item)
|
return buscador(item)
|
||||||
@@ -105,9 +53,7 @@ def buscador(item):
|
|||||||
|
|
||||||
patron = scrapertools.find_multiple_matches(data,
|
patron = scrapertools.find_multiple_matches(data,
|
||||||
'<div class="result-item">.*?href="([^"]+)".*?alt="([^"]+)".*?<span class=".*?">([^"]+)</span>.*?<span class="year">([^"]+)</span>')
|
'<div class="result-item">.*?href="([^"]+)".*?alt="([^"]+)".*?<span class=".*?">([^"]+)</span>.*?<span class="year">([^"]+)</span>')
|
||||||
|
|
||||||
for url, title, genere, year in patron:
|
for url, title, genere, year in patron:
|
||||||
|
|
||||||
if "Serie" in genere:
|
if "Serie" in genere:
|
||||||
checkmt = "tvshow"
|
checkmt = "tvshow"
|
||||||
genere = "[COLOR aqua][B]" + genere + "[/B][/COLOR]"
|
genere = "[COLOR aqua][B]" + genere + "[/B][/COLOR]"
|
||||||
@@ -115,20 +61,15 @@ def buscador(item):
|
|||||||
checkmt = "movie"
|
checkmt = "movie"
|
||||||
genere = "[COLOR cadetblue][B]" + genere + "[/B][/COLOR]"
|
genere = "[COLOR cadetblue][B]" + genere + "[/B][/COLOR]"
|
||||||
titulo = "[COLOR crimson]" + title + "[/COLOR]" + " [ " + genere + " ] "
|
titulo = "[COLOR crimson]" + title + "[/COLOR]" + " [ " + genere + " ] "
|
||||||
|
|
||||||
if checkmt == "movie":
|
if checkmt == "movie":
|
||||||
new_item = item.clone(action="findvideos", title=titulo, url=url, fulltitle=title, contentTitle=title,
|
new_item = item.clone(action="findvideos", title=titulo, url=url, fulltitle=title, contentTitle=title,
|
||||||
contentType="movie", library=True)
|
contentType="movie", library=True)
|
||||||
else:
|
else:
|
||||||
|
|
||||||
new_item = item.clone(action="findtemporadas", title=titulo, url=url, fulltitle=title, contentTitle=title,
|
new_item = item.clone(action="findtemporadas", title=titulo, url=url, fulltitle=title, contentTitle=title,
|
||||||
show=title, contentType="tvshow", library=True)
|
show=title, contentType="tvshow", library=True)
|
||||||
|
|
||||||
new_item.infoLabels['year'] = year
|
new_item.infoLabels['year'] = year
|
||||||
itemlist.append(new_item)
|
itemlist.append(new_item)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from core import tmdb
|
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
if not "Siguiente >>" in item.title:
|
if not "Siguiente >>" in item.title:
|
||||||
@@ -143,7 +84,6 @@ def buscador(item):
|
|||||||
next = scrapertools.find_single_match(data, '<div class=\'resppages\'><a href="([^"]+)"')
|
next = scrapertools.find_single_match(data, '<div class=\'resppages\'><a href="([^"]+)"')
|
||||||
if len(next) > 0:
|
if len(next) > 0:
|
||||||
url = next
|
url = next
|
||||||
|
|
||||||
itemlist.append(item.clone(title="[COLOR springgreen][B]Siguiente >>[/B][/COLOR]", action="buscador", url=url))
|
itemlist.append(item.clone(title="[COLOR springgreen][B]Siguiente >>[/B][/COLOR]", action="buscador", url=url))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -152,14 +92,11 @@ def scraper(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
if item.contentType == "movie":
|
if item.contentType == "movie":
|
||||||
|
|
||||||
patron = scrapertools.find_multiple_matches(data,
|
patron = scrapertools.find_multiple_matches(data,
|
||||||
'<div class="poster">.*?src="(.*?)" alt=.*?href="(.*?)">.*?'
|
'<div class="poster">.*?src="(.*?)" alt=.*?href="(.*?)">.*?'
|
||||||
'<h4>(.*?)<\/h4>.*?img\/flags\/(.*?)\.png.*?imdb.*?<span>(.*?)>')
|
'<h4>(.*?)<\/h4>.*?img\/flags\/(.*?)\.png.*?imdb.*?<span>(.*?)>')
|
||||||
|
|
||||||
for thumb, url, title, language, year in patron:
|
for thumb, url, title, language, year in patron:
|
||||||
titulo = title
|
titulo = title
|
||||||
title = re.sub(r"!|¡", "", title)
|
title = re.sub(r"!|¡", "", title)
|
||||||
@@ -169,13 +106,10 @@ def scraper(item):
|
|||||||
fulltitle=title, contentTitle=title, contentType="movie", extra=year, library=True,
|
fulltitle=title, contentTitle=title, contentType="movie", extra=year, library=True,
|
||||||
language= language, infoLabels={'year':year})
|
language= language, infoLabels={'year':year})
|
||||||
itemlist.append(new_item)
|
itemlist.append(new_item)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
patron = scrapertools.find_multiple_matches(data,
|
patron = scrapertools.find_multiple_matches(data,
|
||||||
'<div class="poster">.*?src="(.*?)" alt=.*?href="(.*?)">.*?'
|
'<div class="poster">.*?src="(.*?)" alt=.*?href="(.*?)">.*?'
|
||||||
'<h4>(.*?)<\/h4>.*?<span>(.*?)<')
|
'<h4>(.*?)<\/h4>.*?<span>(.*?)<')
|
||||||
|
|
||||||
for thumb, url, title, year in patron:
|
for thumb, url, title, year in patron:
|
||||||
titulo = title.strip()
|
titulo = title.strip()
|
||||||
title = re.sub(r"\d+x.*", "", title)
|
title = re.sub(r"\d+x.*", "", title)
|
||||||
@@ -183,17 +117,14 @@ def scraper(item):
|
|||||||
thumbnail=thumb, fulltitle=title, contentTitle=title, show=title,
|
thumbnail=thumb, fulltitle=title, contentTitle=title, show=title,
|
||||||
contentType="tvshow", library=True, infoLabels={'year':year})
|
contentType="tvshow", library=True, infoLabels={'year':year})
|
||||||
itemlist.append(new_item)
|
itemlist.append(new_item)
|
||||||
|
|
||||||
## Paginación
|
## Paginación
|
||||||
next = scrapertools.find_single_match(data, '<div class=\'resppages\'><a href="([^"]+)"')
|
next = scrapertools.find_single_match(data, '<div class=\'resppages\'><a href="([^"]+)"')
|
||||||
if len(next) > 0:
|
if len(next) > 0:
|
||||||
url = next
|
url = next
|
||||||
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title="[COLOR springgreen][B]Siguiente >>[/B][/COLOR]", thumbnail="http://imgur.com/a7lQAld.png",
|
item.clone(title="[COLOR springgreen][B]Siguiente >>[/B][/COLOR]", thumbnail="http://imgur.com/a7lQAld.png",
|
||||||
url=url))
|
url=url))
|
||||||
try:
|
try:
|
||||||
from core import tmdb
|
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
if not "Siguiente >>" in item.title:
|
if not "Siguiente >>" in item.title:
|
||||||
@@ -202,13 +133,8 @@ def scraper(item):
|
|||||||
else:
|
else:
|
||||||
item.infoLabels['rating'] = "[COLOR springgreen]" + str(item.infoLabels['rating']) + "[/COLOR]"
|
item.infoLabels['rating'] = "[COLOR springgreen]" + str(item.infoLabels['rating']) + "[/COLOR]"
|
||||||
item.title = item.title + " " + str(item.infoLabels['rating'])
|
item.title = item.title + " " + str(item.infoLabels['rating'])
|
||||||
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
for item_tmdb in itemlist:
|
|
||||||
logger.info(str(item_tmdb.infoLabels['tmdb_id']))
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -217,35 +143,25 @@ def ul_cap(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
|
|
||||||
patron = scrapertools.find_multiple_matches(data,
|
patron = scrapertools.find_multiple_matches(data,
|
||||||
'<div class="poster">.*?<img src="([^"]+)" alt="([^"]+):.*?href="([^"]+)"><span class="b">(\d+x\d+)<\/span>')
|
'<div class="poster">.*?<img src="([^"]+)" alt="([^"]+):.*?href="([^"]+)"><span class="b">(\d+x\d+)<\/span>')
|
||||||
|
|
||||||
for thumb, title, url, cap in patron:
|
for thumb, title, url, cap in patron:
|
||||||
temp = re.sub(r"x\d+", "", cap)
|
temp = re.sub(r"x\d+", "", cap)
|
||||||
epi = re.sub(r"\d+x", "", cap)
|
epi = re.sub(r"\d+x", "", cap)
|
||||||
titulo = title.strip() + "--" + "[COLOR red][B]" + cap + "[/B][/COLOR]"
|
titulo = title.strip() + "--" + "[COLOR red][B]" + cap + "[/B][/COLOR]"
|
||||||
title = re.sub(r"\d+x.*", "", title)
|
title = re.sub(r"\d+x.*", "", title)
|
||||||
# filtro_thumb = thumb.replace("https://image.tmdb.org/t/p/w300", "")
|
|
||||||
# filtro_list = {"poster_path": filtro_thumb}
|
|
||||||
# filtro_list = filtro_list.items()
|
|
||||||
# url_tv = scrapertools.find_single_match(url,'episodios/(.*?)/')
|
|
||||||
new_item = item.clone(action="findvideos", title="[COLOR aqua]" + titulo + "[/COLOR]", url=url, thumbnail=thumb,
|
new_item = item.clone(action="findvideos", title="[COLOR aqua]" + titulo + "[/COLOR]", url=url, thumbnail=thumb,
|
||||||
fulltitle=title, contentTitle=title, show=title, contentType="tvshow", temp=temp, epi=epi,
|
fulltitle=title, contentTitle=title, show=title, contentType="tvshow", temp=temp, epi=epi,
|
||||||
library=True)
|
library=True)
|
||||||
|
|
||||||
itemlist.append(new_item)
|
itemlist.append(new_item)
|
||||||
|
|
||||||
## Paginación
|
## Paginación
|
||||||
next = scrapertools.find_single_match(data, '<div class=\'resppages\'><a href="([^"]+)"')
|
next = scrapertools.find_single_match(data, '<div class=\'resppages\'><a href="([^"]+)"')
|
||||||
if len(next) > 0:
|
if len(next) > 0:
|
||||||
url = next
|
url = next
|
||||||
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title="[COLOR springgreen][B]Siguiente >>[/B][/COLOR]", thumbnail="http://imgur.com/a7lQAld.png",
|
item.clone(title="[COLOR springgreen][B]Siguiente >>[/B][/COLOR]", thumbnail="http://imgur.com/a7lQAld.png",
|
||||||
url=url))
|
url=url))
|
||||||
try:
|
try:
|
||||||
from core import tmdb
|
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
||||||
|
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
@@ -257,27 +173,17 @@ def ul_cap(item):
|
|||||||
else:
|
else:
|
||||||
item.infoLabels['rating'] = "[COLOR springgreen] (" + str(item.infoLabels['rating']) + ")[/COLOR]"
|
item.infoLabels['rating'] = "[COLOR springgreen] (" + str(item.infoLabels['rating']) + ")[/COLOR]"
|
||||||
item.title = item.title + " " + str(item.infoLabels['rating'])
|
item.title = item.title + " " + str(item.infoLabels['rating'])
|
||||||
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
for item_tmdb in itemlist:
|
|
||||||
logger.info(str(item_tmdb.infoLabels['tmdb_id']))
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findtemporadas(item):
|
def findtemporadas(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
if not item.temp:
|
if not item.temp:
|
||||||
th = Thread(target=get_art(item))
|
|
||||||
th.setDaemon(True)
|
|
||||||
th.start()
|
|
||||||
check_temp = None
|
check_temp = None
|
||||||
else:
|
else:
|
||||||
|
|
||||||
check_temp = "yes"
|
check_temp = "yes"
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
@@ -318,19 +224,12 @@ def findtemporadas(item):
|
|||||||
for temporada, bloque_epis in bloque_episodios:
|
for temporada, bloque_epis in bloque_episodios:
|
||||||
item.infoLabels = item.InfoLabels
|
item.infoLabels = item.InfoLabels
|
||||||
item.infoLabels['season'] = temporada
|
item.infoLabels['season'] = temporada
|
||||||
|
|
||||||
itemlist.append(item.clone(action="epis",
|
itemlist.append(item.clone(action="epis",
|
||||||
title="[COLOR cornflowerblue][B]Temporada [/B][/COLOR]" + "[COLOR darkturquoise][B]" + temporada + "[/B][/COLOR]",
|
title="[COLOR cornflowerblue][B]Temporada [/B][/COLOR]" + "[COLOR darkturquoise][B]" + temporada + "[/B][/COLOR]",
|
||||||
url=bloque_epis, contentType=item.contentType, contentTitle=item.contentTitle,
|
url=bloque_epis, contentType=item.contentType, contentTitle=item.contentTitle,
|
||||||
show=item.show, extra=item.extra, fanart_extra=fanart_extra, fanart_info=fanart_info,
|
show=item.show, extra=item.extra, fanart_extra=fanart_extra, fanart_info=fanart_info,
|
||||||
datalibrary=data, check_temp=check_temp, folder=True))
|
datalibrary=data, check_temp=check_temp, folder=True))
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
||||||
for item in itemlist:
|
|
||||||
item.fanart = fanart
|
|
||||||
item.extra = extra
|
|
||||||
if item.temp:
|
|
||||||
item.thumbnail = item.infoLabels['temporada_poster']
|
|
||||||
|
|
||||||
if config.get_videolibrary_support() and itemlist:
|
if config.get_videolibrary_support() and itemlist:
|
||||||
if len(bloque_episodios) == 1:
|
if len(bloque_episodios) == 1:
|
||||||
extra = "epis"
|
extra = "epis"
|
||||||
@@ -340,7 +239,7 @@ def findtemporadas(item):
|
|||||||
infoLabels = {'tmdb_id': item.infoLabels['tmdb_id'], 'tvdb_id': item.infoLabels['tvdb_id'],
|
infoLabels = {'tmdb_id': item.infoLabels['tmdb_id'], 'tvdb_id': item.infoLabels['tvdb_id'],
|
||||||
'imdb_id': item.infoLabels['imdb_id']}
|
'imdb_id': item.infoLabels['imdb_id']}
|
||||||
itemlist.append(Item(channel=item.channel, title="Añadir esta serie a la videoteca", text_color="0xFFe5ffcc",
|
itemlist.append(Item(channel=item.channel, title="Añadir esta serie a la videoteca", text_color="0xFFe5ffcc",
|
||||||
action="add_serie_to_library", extra=extra, url=item.url,
|
action="add_serie_to_library", extra="", url=item.url,
|
||||||
contentSerieName=item.fulltitle, infoLabels=infoLabels,
|
contentSerieName=item.fulltitle, infoLabels=infoLabels,
|
||||||
thumbnail='http://imgur.com/3ik73p8.png', datalibrary=data))
|
thumbnail='http://imgur.com/3ik73p8.png', datalibrary=data))
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -349,16 +248,13 @@ def findtemporadas(item):
|
|||||||
def epis(item):
|
def epis(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
if item.extra == "serie_add":
|
if item.extra == "serie_add":
|
||||||
item.url = item.datalibrary
|
item.url = item.datalibrary
|
||||||
|
|
||||||
patron = scrapertools.find_multiple_matches(item.url, '<div class="imagen"><a href="([^"]+)".*?"numerando">(.*?)<')
|
patron = scrapertools.find_multiple_matches(item.url, '<div class="imagen"><a href="([^"]+)".*?"numerando">(.*?)<')
|
||||||
for url, epi in patron:
|
for url, epi in patron:
|
||||||
episodio = scrapertools.find_single_match(epi, '\d+ - (\d+)')
|
episodio = scrapertools.find_single_match(epi, '\d+ - (\d+)')
|
||||||
item.infoLabels['episode'] = episodio
|
item.infoLabels['episode'] = episodio
|
||||||
epi = re.sub(r" - ", "X", epi)
|
epi = re.sub(r" - ", "X", epi)
|
||||||
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title="[COLOR deepskyblue]Episodio " + "[COLOR red]" + epi, url=url, action="findvideos",
|
item.clone(title="[COLOR deepskyblue]Episodio " + "[COLOR red]" + epi, url=url, action="findvideos",
|
||||||
show=item.show, fanart=item.extra, extra=item.extra, fanart_extra=item.fanart_extra,
|
show=item.show, fanart=item.extra, extra=item.extra, fanart_extra=item.fanart_extra,
|
||||||
@@ -377,21 +273,12 @@ def findvideos(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
if item.temp:
|
if item.temp:
|
||||||
url_epis = item.url
|
url_epis = item.url
|
||||||
|
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
|
|
||||||
if not item.infoLabels['episode'] or item.temp:
|
|
||||||
th = Thread(target=get_art(item))
|
|
||||||
th.setDaemon(True)
|
|
||||||
th.start()
|
|
||||||
|
|
||||||
if item.contentType != "movie":
|
if item.contentType != "movie":
|
||||||
|
|
||||||
if not item.infoLabels['episode']:
|
if not item.infoLabels['episode']:
|
||||||
capitulo = scrapertools.find_single_match(item.title, '(\d+x\d+)')
|
capitulo = scrapertools.find_single_match(item.title, '(\d+x\d+)')
|
||||||
url_capitulo = scrapertools.find_single_match(data,
|
url_capitulo = scrapertools.find_single_match(data,
|
||||||
'<a href="(http://www.divxtotal.com/wp-content/uploads/.*?' + capitulo + '.*?.torrent)')
|
'<a href="(http://www.divxtotal.com/wp-content/uploads/.*?' + capitulo + '.*?.torrent)')
|
||||||
|
|
||||||
if len(item.extra.split("|")) >= 2:
|
if len(item.extra.split("|")) >= 2:
|
||||||
extra = item.extra
|
extra = item.extra
|
||||||
else:
|
else:
|
||||||
@@ -399,17 +286,14 @@ def findvideos(item):
|
|||||||
else:
|
else:
|
||||||
capitulo = item.title
|
capitulo = item.title
|
||||||
url_capitulo = item.url
|
url_capitulo = item.url
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fanart = item.fanart_extra
|
fanart = item.fanart_extra
|
||||||
except:
|
except:
|
||||||
fanart = item.extra.split("|")[0]
|
fanart = item.extra.split("|")[0]
|
||||||
|
|
||||||
url_data = scrapertools.find_multiple_matches(data, '<div id="option-(.*?)".*?src="([^"]+)"')
|
url_data = scrapertools.find_multiple_matches(data, '<div id="option-(.*?)".*?src="([^"]+)"')
|
||||||
for option, url in url_data:
|
for option, url in url_data:
|
||||||
server, idioma = scrapertools.find_single_match(data,
|
server, idioma = scrapertools.find_single_match(data,
|
||||||
'href="#option-' + option + '">.*?</b>(.*?)<span class="dt_flag">.*?flags/(.*?).png')
|
'href="#option-' + option + '">.*?</b>(.*?)<span class="dt_flag">.*?flags/(.*?).png')
|
||||||
|
|
||||||
if not item.temp:
|
if not item.temp:
|
||||||
item.infoLabels['year'] = None
|
item.infoLabels['year'] = None
|
||||||
if item.temp:
|
if item.temp:
|
||||||
@@ -427,7 +311,6 @@ def findvideos(item):
|
|||||||
itemlist.append(Item(channel=item.channel, title=title, url=url, action="play", fanart=fanart,
|
itemlist.append(Item(channel=item.channel, title=title, url=url, action="play", fanart=fanart,
|
||||||
thumbnail=item.thumbnail, extra=item.extra, fulltitle=item.fulltitle,
|
thumbnail=item.thumbnail, extra=item.extra, fulltitle=item.fulltitle,
|
||||||
folder=False))
|
folder=False))
|
||||||
|
|
||||||
if item.temp:
|
if item.temp:
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
@@ -443,26 +326,17 @@ def findvideos(item):
|
|||||||
fanart = item.fanart
|
fanart = item.fanart
|
||||||
if item.temp:
|
if item.temp:
|
||||||
item.infoLabels['tvdb_id'] = item.tvdb
|
item.infoLabels['tvdb_id'] = item.tvdb
|
||||||
|
|
||||||
itemlist.append(
|
|
||||||
Item(channel=item.channel, title="[COLOR steelblue][B] info[/B][/COLOR]", action="info_capitulos",
|
|
||||||
fanart=fanart, thumbnail=item.thumb_art, thumb_info=item.thumb_info, extra=item.extra,
|
|
||||||
show=item.show, InfoLabels=item.infoLabels, folder=False))
|
|
||||||
if item.temp and not item.check_temp:
|
if item.temp and not item.check_temp:
|
||||||
url_epis = re.sub(r"-\dx.*", "", url_epis)
|
url_epis = re.sub(r"-\dx.*", "", url_epis)
|
||||||
url_epis = url_epis.replace("episodios", "series")
|
url_epis = url_epis.replace("episodios", "series")
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
Item(channel=item.channel, title="[COLOR salmon][B]Todos los episodios[/B][/COLOR]", url=url_epis,
|
Item(channel=item.channel, title="[COLOR salmon][B]Todos los episodios[/B][/COLOR]", url=url_epis,
|
||||||
action="findtemporadas", server="torrent", fanart=item.extra.split("|")[1],
|
action="findtemporadas", server="torrent",
|
||||||
thumbnail=item.infoLabels['thumbnail'], extra=item.extra + "|" + item.thumbnail,
|
thumbnail=item.infoLabels['thumbnail'],
|
||||||
contentType=item.contentType, contentTitle=item.contentTitle, InfoLabels=item.infoLabels,
|
contentType=item.contentType, contentTitle=item.contentTitle, InfoLabels=item.infoLabels,
|
||||||
thumb_art=item.thumb_art, thumb_info=item.thumbnail, fulltitle=item.fulltitle,
|
thumb_art=item.thumb_art, thumb_info=item.thumbnail, fulltitle=item.fulltitle,
|
||||||
library=item.library, temp=item.temp, folder=True))
|
library=item.library, temp=item.temp, folder=True))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
url_data = scrapertools.find_multiple_matches(data, '<div id="option-(.*?)".*?src="([^"]+)"')
|
url_data = scrapertools.find_multiple_matches(data, '<div id="option-(.*?)".*?src="([^"]+)"')
|
||||||
for option, url in url_data:
|
for option, url in url_data:
|
||||||
server, idioma = scrapertools.find_single_match(data,
|
server, idioma = scrapertools.find_single_match(data,
|
||||||
@@ -481,7 +355,6 @@ def findvideos(item):
|
|||||||
action="add_pelicula_to_library", url=item.url, fanart=item.extra.split("|")[0],
|
action="add_pelicula_to_library", url=item.url, fanart=item.extra.split("|")[0],
|
||||||
infoLabels=infoLabels, text_color="0xFFe5ffcc",
|
infoLabels=infoLabels, text_color="0xFFe5ffcc",
|
||||||
thumbnail='http://imgur.com/3ik73p8.png'))
|
thumbnail='http://imgur.com/3ik73p8.png'))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -496,417 +369,6 @@ def play(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def info_capitulos(item, images={}):
|
|
||||||
logger.info()
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
try:
|
|
||||||
url = "http://thetvdb.com/api/1D62F2F90030C444/series/" + str(item.InfoLabels['tvdb_id']) + "/default/" + str(
|
|
||||||
item.InfoLabels['season']) + "/" + str(item.InfoLabels['episode']) + "/es.xml"
|
|
||||||
if "/0" in url:
|
|
||||||
url = url.replace("/0", "/")
|
|
||||||
from core import jsontools
|
|
||||||
data = httptools.downloadpage(url).data
|
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
|
||||||
|
|
||||||
if "<filename>episodes" in data:
|
|
||||||
image = scrapertools.find_single_match(data, '<Data>.*?<filename>(.*?)</filename>')
|
|
||||||
image = "http://thetvdb.com/banners/" + image
|
|
||||||
else:
|
|
||||||
try:
|
|
||||||
image = item.InfoLabels['episodio_imagen']
|
|
||||||
except:
|
|
||||||
image = "http://imgur.com/ZiEAVOD.png"
|
|
||||||
|
|
||||||
foto = item.thumb_info
|
|
||||||
if not ".png" in foto:
|
|
||||||
foto = "http://imgur.com/PRiEW1D.png"
|
|
||||||
try:
|
|
||||||
title = item.InfoLabels['episodio_titulo']
|
|
||||||
except:
|
|
||||||
title = ""
|
|
||||||
title = "[COLOR red][B]" + title + "[/B][/COLOR]"
|
|
||||||
|
|
||||||
try:
|
|
||||||
plot = "[COLOR peachpuff]" + str(item.InfoLabels['episodio_sinopsis']) + "[/COLOR]"
|
|
||||||
except:
|
|
||||||
plot = scrapertools.find_single_match(data, '<Overview>(.*?)</Overview>')
|
|
||||||
if plot == "":
|
|
||||||
plot = "Sin información todavia"
|
|
||||||
try:
|
|
||||||
rating = item.InfoLabels['episodio_vote_average']
|
|
||||||
except:
|
|
||||||
rating = 0
|
|
||||||
try:
|
|
||||||
|
|
||||||
if rating >= 5 and rating < 8:
|
|
||||||
rating = "[COLOR yellow]Puntuación[/COLOR] " + "[COLOR springgreen][B]" + str(rating) + "[/B][/COLOR]"
|
|
||||||
elif rating >= 8 and rating < 10:
|
|
||||||
rating = "[COLOR yellow]Puntuación[/COLOR] " + "[COLOR yellow][B]" + str(rating) + "[/B][/COLOR]"
|
|
||||||
elif rating == 10:
|
|
||||||
rating = "[COLOR yellow]Puntuación[/COLOR] " + "[COLOR orangered][B]" + str(rating) + "[/B][/COLOR]"
|
|
||||||
else:
|
|
||||||
rating = "[COLOR yellow]Puntuación[/COLOR] " + "[COLOR crimson][B]" + str(rating) + "[/B][/COLOR]"
|
|
||||||
except:
|
|
||||||
rating = "[COLOR yellow]Puntuación[/COLOR] " + "[COLOR crimson][B]" + str(rating) + "[/B][/COLOR]"
|
|
||||||
if "10." in rating:
|
|
||||||
rating = re.sub(r'10\.\d+', '10', rating)
|
|
||||||
|
|
||||||
|
|
||||||
except:
|
|
||||||
|
|
||||||
title = "[COLOR red][B]LO SENTIMOS...[/B][/COLOR]"
|
|
||||||
plot = "Este capitulo no tiene informacion..."
|
|
||||||
plot = "[COLOR yellow][B]" + plot + "[/B][/COLOR]"
|
|
||||||
image = "http://s6.postimg.org/ub7pb76c1/noinfo.png"
|
|
||||||
foto = "http://s6.postimg.org/nm3gk1xox/noinfosup2.png"
|
|
||||||
rating = ""
|
|
||||||
|
|
||||||
ventana = TextBox2(title=title, plot=plot, thumbnail=image, fanart=foto, rating=rating)
|
|
||||||
ventana.doModal()
|
|
||||||
|
|
||||||
|
|
||||||
class TextBox2(xbmcgui.WindowDialog):
|
|
||||||
""" Create a skinned textbox window """
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
self.getTitle = kwargs.get('title')
|
|
||||||
self.getPlot = kwargs.get('plot')
|
|
||||||
self.getThumbnail = kwargs.get('thumbnail')
|
|
||||||
self.getFanart = kwargs.get('fanart')
|
|
||||||
self.getRating = kwargs.get('rating')
|
|
||||||
|
|
||||||
self.background = xbmcgui.ControlImage(70, 20, 1150, 630, 'http://imgur.com/aj4qzTr.jpg')
|
|
||||||
self.title = xbmcgui.ControlTextBox(120, 60, 430, 50)
|
|
||||||
self.rating = xbmcgui.ControlTextBox(145, 112, 1030, 45)
|
|
||||||
self.plot = xbmcgui.ControlTextBox(120, 150, 1056, 100)
|
|
||||||
self.thumbnail = xbmcgui.ControlImage(120, 300, 1056, 300, self.getThumbnail)
|
|
||||||
self.fanart = xbmcgui.ControlImage(780, 43, 390, 100, self.getFanart)
|
|
||||||
|
|
||||||
self.addControl(self.background)
|
|
||||||
self.background.setAnimations(
|
|
||||||
[('conditional', 'effect=slide start=1000% end=0% time=1500 condition=true tween=bounce',),
|
|
||||||
('WindowClose', 'effect=slide delay=800 start=0% end=1000% time=800 condition=true',)])
|
|
||||||
self.addControl(self.thumbnail)
|
|
||||||
self.thumbnail.setAnimations([('conditional',
|
|
||||||
'effect=zoom start=0% end=100% delay=2700 time=1500 condition=true tween=elastic easing=inout',),
|
|
||||||
('WindowClose', 'effect=slide end=0,700% time=300 condition=true',)])
|
|
||||||
self.addControl(self.plot)
|
|
||||||
self.plot.setAnimations(
|
|
||||||
[('conditional', 'effect=zoom delay=2000 center=auto start=0 end=100 time=800 condition=true ',), (
|
|
||||||
'conditional',
|
|
||||||
'effect=rotate delay=2000 center=auto aceleration=6000 start=0% end=360% time=800 condition=true',),
|
|
||||||
('WindowClose', 'effect=zoom center=auto start=100% end=-0% time=600 condition=true',)])
|
|
||||||
self.addControl(self.fanart)
|
|
||||||
self.fanart.setAnimations(
|
|
||||||
[('WindowOpen', 'effect=slide start=0,-700 delay=1000 time=2500 tween=bounce condition=true',), (
|
|
||||||
'conditional',
|
|
||||||
'effect=rotate center=auto start=0% end=360% delay=3000 time=2500 tween=bounce condition=true',),
|
|
||||||
('WindowClose', 'effect=slide end=0,-700% time=1000 condition=true',)])
|
|
||||||
self.addControl(self.title)
|
|
||||||
self.title.setText(self.getTitle)
|
|
||||||
self.title.setAnimations(
|
|
||||||
[('conditional', 'effect=slide start=-1500% end=0% delay=1000 time=2000 condition=true tween=elastic',),
|
|
||||||
('WindowClose', 'effect=slide start=0% end=-1500% time=800 condition=true',)])
|
|
||||||
self.addControl(self.rating)
|
|
||||||
self.rating.setText(self.getRating)
|
|
||||||
self.rating.setAnimations(
|
|
||||||
[('conditional', 'effect=fade start=0% end=100% delay=3000 time=1500 condition=true',),
|
|
||||||
('WindowClose', 'effect=slide end=0,-700% time=600 condition=true',)])
|
|
||||||
xbmc.sleep(200)
|
|
||||||
|
|
||||||
try:
|
|
||||||
self.plot.autoScroll(7000, 6000, 30000)
|
|
||||||
except:
|
|
||||||
|
|
||||||
xbmc.executebuiltin(
|
|
||||||
'Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
|
|
||||||
self.plot.setText(self.getPlot)
|
|
||||||
|
|
||||||
def get(self):
|
|
||||||
self.show()
|
|
||||||
|
|
||||||
def onAction(self, action):
|
|
||||||
if action == ACTION_PREVIOUS_MENU or action.getId() == ACTION_GESTURE_SWIPE_LEFT or action == 110 or action == 92:
|
|
||||||
self.close()
|
|
||||||
|
|
||||||
|
|
||||||
def test():
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
def fanartv(item, id_tvdb, id, images={}):
|
|
||||||
headers = [['Content-Type', 'application/json']]
|
|
||||||
from core import jsontools
|
|
||||||
if item.contentType == "movie":
|
|
||||||
url = "http://webservice.fanart.tv/v3/movies/%s?api_key=cab16e262d72fea6a6843d679aa10300" \
|
|
||||||
% id
|
|
||||||
else:
|
|
||||||
url = "http://webservice.fanart.tv/v3/tv/%s?api_key=cab16e262d72fea6a6843d679aa10300" % id_tvdb
|
|
||||||
try:
|
|
||||||
data = jsontools.load(scrapertools.downloadpage(url, headers=headers))
|
|
||||||
if data and not "error message" in data:
|
|
||||||
for key, value in data.items():
|
|
||||||
if key not in ["name", "tmdb_id", "imdb_id", "thetvdb_id"]:
|
|
||||||
images[key] = value
|
|
||||||
else:
|
|
||||||
images = []
|
|
||||||
|
|
||||||
except:
|
|
||||||
images = []
|
|
||||||
return images
|
|
||||||
|
|
||||||
|
|
||||||
def get_art(item):
|
|
||||||
logger.info()
|
|
||||||
id = item.infoLabels['tmdb_id']
|
|
||||||
check_fanart = item.infoLabels['fanart']
|
|
||||||
if item.contentType != "movie":
|
|
||||||
tipo_ps = "tv"
|
|
||||||
else:
|
|
||||||
tipo_ps = "movie"
|
|
||||||
if not id:
|
|
||||||
year = item.extra
|
|
||||||
otmdb = tmdb.Tmdb(texto_buscado=item.fulltitle, year=year, tipo=tipo_ps)
|
|
||||||
id = otmdb.result.get("id")
|
|
||||||
|
|
||||||
if id == None:
|
|
||||||
otmdb = tmdb.Tmdb(texto_buscado=item.fulltitle, tipo=tipo_ps)
|
|
||||||
id = otmdb.result.get("id")
|
|
||||||
if id == None:
|
|
||||||
if item.contentType == "movie":
|
|
||||||
urlbing_imdb = "http://www.bing.com/search?q=%s+%s+tv+series+site:imdb.com" % (
|
|
||||||
item.fulltitle.replace(' ', '+'), year)
|
|
||||||
data = browser(urlbing_imdb)
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| |http://ssl-proxy.my-addr.org/myaddrproxy.php/", "", data)
|
|
||||||
subdata_imdb = scrapertools.find_single_match(data,
|
|
||||||
'<li class="b_algo">(.*?)h="ID.*?<strong>.*?TV Series')
|
|
||||||
else:
|
|
||||||
urlbing_imdb = "http://www.bing.com/search?q=%s+%s+site:imdb.com" % (
|
|
||||||
item.fulltitle.replace(' ', '+'), year)
|
|
||||||
data = browser(urlbing_imdb)
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| |http://ssl-proxy.my-addr.org/myaddrproxy.php/", "", data)
|
|
||||||
subdata_imdb = scrapertools.find_single_match(data, '<li class="b_algo">(.*?)h="ID.*?<strong>')
|
|
||||||
try:
|
|
||||||
imdb_id = scrapertools.get_match(subdata_imdb, '<a href=.*?http.*?imdb.com/title/(.*?)/.*?"')
|
|
||||||
except:
|
|
||||||
try:
|
|
||||||
imdb_id = scrapertools.get_match(subdata_imdb,
|
|
||||||
'<a href=.*?http.*?imdb.com/.*?/title/(.*?)/.*?"')
|
|
||||||
except:
|
|
||||||
imdb_id = ""
|
|
||||||
otmdb = tmdb.Tmdb(external_id=imdb_id, external_source="imdb_id", tipo=tipo_ps, idioma_busqueda="es")
|
|
||||||
id = otmdb.result.get("id")
|
|
||||||
|
|
||||||
if id == None:
|
|
||||||
if "(" in item.fulltitle:
|
|
||||||
title = scrapertools.find_single_match(item.fulltitle, '\(.*?\)')
|
|
||||||
if item.contentType != "movie":
|
|
||||||
urlbing_imdb = "http://www.bing.com/search?q=%s+%s+tv+series+site:imdb.com" % (
|
|
||||||
title.replace(' ', '+'), year)
|
|
||||||
data = browser(urlbing_imdb)
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| |http://ssl-proxy.my-addr.org/myaddrproxy.php/", "",
|
|
||||||
data)
|
|
||||||
subdata_imdb = scrapertools.find_single_match(data,
|
|
||||||
'<li class="b_algo">(.*?)h="ID.*?<strong>.*?TV Series')
|
|
||||||
else:
|
|
||||||
urlbing_imdb = "http://www.bing.com/search?q=%s+%s+site:imdb.com" % (
|
|
||||||
title.replace(' ', '+'), year)
|
|
||||||
data = browser(urlbing_imdb)
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| |http://ssl-proxy.my-addr.org/myaddrproxy.php/", "",
|
|
||||||
data)
|
|
||||||
subdata_imdb = scrapertools.find_single_match(data,
|
|
||||||
'<li class="b_algo">(.*?)h="ID.*?<strong>')
|
|
||||||
try:
|
|
||||||
imdb_id = scrapertools.get_match(subdata_imdb,
|
|
||||||
'<a href=.*?http.*?imdb.com/title/(.*?)/.*?"')
|
|
||||||
except:
|
|
||||||
try:
|
|
||||||
imdb_id = scrapertools.get_match(subdata_imdb,
|
|
||||||
'<a href=.*?http.*?imdb.com/.*?/title/(.*?)/.*?"')
|
|
||||||
except:
|
|
||||||
imdb_id = ""
|
|
||||||
otmdb = tmdb.Tmdb(external_id=imdb_id, external_source="imdb_id", tipo=tipo_ps,
|
|
||||||
idioma_busqueda="es")
|
|
||||||
id = otmdb.result.get("id")
|
|
||||||
|
|
||||||
if not id:
|
|
||||||
fanart = item.fanart
|
|
||||||
|
|
||||||
imagenes = []
|
|
||||||
itmdb = tmdb.Tmdb(id_Tmdb=id, tipo=tipo_ps)
|
|
||||||
images = itmdb.result.get("images")
|
|
||||||
if images:
|
|
||||||
for key, value in images.iteritems():
|
|
||||||
for detail in value:
|
|
||||||
imagenes.append('http://image.tmdb.org/t/p/original' + detail["file_path"])
|
|
||||||
|
|
||||||
if item.contentType == "movie":
|
|
||||||
if len(imagenes) >= 4:
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart and imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2]
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[3]
|
|
||||||
elif imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[2] + "|" + imagenes[3]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[3] + "|" + imagenes[3]
|
|
||||||
elif len(imagenes) == 3:
|
|
||||||
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart and imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2]
|
|
||||||
|
|
||||||
else:
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[0] + "|" + imagenes[1]
|
|
||||||
elif imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[1]
|
|
||||||
elif len(imagenes) == 2:
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[0] + "|" + imagenes[1]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[0]
|
|
||||||
elif len(imagenes) == 1:
|
|
||||||
item.extra = imagenes[0] + "|" + imagenes[0]
|
|
||||||
else:
|
|
||||||
item.extra = item.fanart + "|" + item.fanart
|
|
||||||
id_tvdb = ""
|
|
||||||
else:
|
|
||||||
|
|
||||||
if itmdb.result.get("external_ids").get("tvdb_id"):
|
|
||||||
id_tvdb = itmdb.result.get("external_ids").get("tvdb_id")
|
|
||||||
if item.temp:
|
|
||||||
item.tvdb = id_tvdb
|
|
||||||
|
|
||||||
|
|
||||||
else:
|
|
||||||
id_tvdb = ""
|
|
||||||
|
|
||||||
if len(imagenes) >= 6:
|
|
||||||
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart and imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2] + "|" + imagenes[3] + "|" + imagenes[4] + "|" + \
|
|
||||||
imagenes[5]
|
|
||||||
else:
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[3] + "|" + imagenes[4] + "|" + imagenes[5] + "|" + \
|
|
||||||
imagenes[2]
|
|
||||||
elif imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[2] + "|" + imagenes[3] + "|" + imagenes[4] + "|" + imagenes[5] + "|" + \
|
|
||||||
imagenes[1]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[3] + "|" + imagenes[4] + "|" + imagenes[5] + "|" + imagenes[2] + "|" + \
|
|
||||||
imagenes[1]
|
|
||||||
elif len(imagenes) == 5:
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart and imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2] + "|" + imagenes[3] + "|" + imagenes[4]
|
|
||||||
else:
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[3] + "|" + imagenes[4] + "|" + imagenes[2]
|
|
||||||
elif imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[2] + "|" + imagenes[3] + "|" + imagenes[4] + "|" + imagenes[1]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[3] + "|" + imagenes[4] + "|" + imagenes[2] + "|" + imagenes[1]
|
|
||||||
elif len(imagenes) == 4:
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart and imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2] + "|" + imagenes[3] + "|" + imagenes[4]
|
|
||||||
else:
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[3] + "|" + imagenes[2]
|
|
||||||
elif imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[2] + "|" + imagenes[3] + "|" + imagenes[1]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[3] + "|" + imagenes[2] + "|" + imagenes[1]
|
|
||||||
|
|
||||||
elif len(imagenes) == 3:
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart and imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2]
|
|
||||||
else:
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[0] + "|" + imagenes[1]
|
|
||||||
elif imagenes[2] != check_fanart:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[2]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[1]
|
|
||||||
elif len(imagenes) == 2:
|
|
||||||
if imagenes[0] != check_fanart:
|
|
||||||
item.fanart = imagenes[0]
|
|
||||||
else:
|
|
||||||
item.fanart = imagenes[1]
|
|
||||||
if imagenes[1] != check_fanart and imagenes[1] != item.fanart:
|
|
||||||
item.extra = imagenes[0] + "|" + imagenes[1]
|
|
||||||
else:
|
|
||||||
item.extra = imagenes[1] + "|" + imagenes[0]
|
|
||||||
elif len(imagenes) == 1:
|
|
||||||
item.extra = imagenes[0] + "|" + imagenes[0]
|
|
||||||
else:
|
|
||||||
item.extra = item.fanart + "|" + item.fanart
|
|
||||||
item.extra = item.extra
|
|
||||||
images_fanarttv = fanartv(item, id_tvdb, id)
|
|
||||||
if images_fanarttv:
|
|
||||||
if item.contentType == "movie":
|
|
||||||
if images_fanarttv.get("moviedisc"):
|
|
||||||
item.thumbnail = images_fanarttv.get("moviedisc")[0].get("url")
|
|
||||||
elif images_fanarttv.get("hdmovielogo"):
|
|
||||||
item.thumbnail = images_fanarttv.get("hdmovielogo")[0].get("url")
|
|
||||||
elif images_fanarttv.get("moviethumb"):
|
|
||||||
item.thumbnail = images_fanarttv.get("moviethumb")[0].get("url")
|
|
||||||
elif images_fanarttv.get("moviebanner"):
|
|
||||||
item.thumbnail_ = images_fanarttv.get("moviebanner")[0].get("url")
|
|
||||||
else:
|
|
||||||
item.thumbnail = item.thumbnail
|
|
||||||
else:
|
|
||||||
|
|
||||||
if images_fanarttv.get("hdtvlogo"):
|
|
||||||
item.thumbnail = images_fanarttv.get("hdtvlogo")[0].get("url")
|
|
||||||
elif images_fanarttv.get("clearlogo"):
|
|
||||||
item.thumbnail = images_fanarttv.get("clearlogo")[0].get("url")
|
|
||||||
item.thumb_info = item.thumbnail
|
|
||||||
if images_fanarttv.get("hdclearart"):
|
|
||||||
item.thumb_art = images_fanarttv.get("hdclearart")[0].get("url")
|
|
||||||
elif images_fanarttv.get("tvbanner"):
|
|
||||||
item.thumb_art = images_fanarttv.get("tvbanner")[0].get("url")
|
|
||||||
else:
|
|
||||||
item.thumb_art = item.thumbnail
|
|
||||||
|
|
||||||
else:
|
|
||||||
item.extra = item.extra + "|" + item.thumbnail
|
|
||||||
|
|
||||||
|
|
||||||
def get_year(url):
|
def get_year(url):
|
||||||
data = httptools.downloadpage(url).data
|
data = httptools.downloadpage(url).data
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
|
||||||
|
|||||||
@@ -84,13 +84,13 @@ def menu_genero(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
# TODO: SOLO FUNCIONA POR AHORA A PARTIR DE KODI 17
|
||||||
httptools.downloadpage("https://kproxy.com/")
|
# httptools.downloadpage("https://kproxy.com/")
|
||||||
url = "https://kproxy.com/doproxy.jsp"
|
# url = "https://kproxy.com/doproxy.jsp"
|
||||||
post = "page=%s&x=34&y=14" % urllib.quote(host + "/principal")
|
# post = "page=%s&x=34&y=14" % urllib.quote(host + "/principal")
|
||||||
response = httptools.downloadpage(url, post, follow_redirects=False).data
|
# response = httptools.downloadpage(url, post, follow_redirects=False).data
|
||||||
url = scrapertools.find_single_match(response, '<meta http-equiv="refresh".*?url=([^"]+)"')
|
# url = scrapertools.find_single_match(response, '<meta http-equiv="refresh".*?url=([^"]+)"')
|
||||||
data = httptools.downloadpage(url).data
|
data = httptools.downloadpage(host + "/principal").data
|
||||||
|
|
||||||
data = re.sub(r"\n|\r|\t|\s{2}| |<Br>|<BR>|<br>|<br/>|<br />|-\s", "", data)
|
data = re.sub(r"\n|\r|\t|\s{2}| |<Br>|<BR>|<br>|<br/>|<br />|-\s", "", data)
|
||||||
|
|
||||||
@@ -108,13 +108,13 @@ def menu_genero(item):
|
|||||||
def series(item):
|
def series(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
# TODO: SOLO FUNCIONA POR AHORA A PARTIR DE KODI 17
|
||||||
httptools.downloadpage("https://kproxy.com/")
|
# httptools.downloadpage("https://kproxy.com/")
|
||||||
url = "https://kproxy.com/doproxy.jsp"
|
# url = "https://kproxy.com/doproxy.jsp"
|
||||||
post = "page=%s&x=34&y=14" % urllib.quote(item.url)
|
# post = "page=%s&x=34&y=14" % urllib.quote(item.url)
|
||||||
response = httptools.downloadpage(url, post, follow_redirects=False).data
|
# response = httptools.downloadpage(url, post, follow_redirects=False).data
|
||||||
url = scrapertools.find_single_match(response, '<meta http-equiv="refresh".*?url=([^"]+)"')
|
# url = scrapertools.find_single_match(response, '<meta http-equiv="refresh".*?url=([^"]+)"')
|
||||||
data = httptools.downloadpage(url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
|
|
||||||
lista = jsontools.load(data)
|
lista = jsontools.load(data)
|
||||||
if item.extra == "next":
|
if item.extra == "next":
|
||||||
@@ -165,13 +165,13 @@ def series(item):
|
|||||||
def episodios(item):
|
def episodios(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
# TODO: SOLO FUNCIONA POR AHORA A PARTIR DE KODI 17
|
||||||
httptools.downloadpage("https://kproxy.com/")
|
# httptools.downloadpage("https://kproxy.com/")
|
||||||
url = "https://kproxy.com/doproxy.jsp"
|
# url = "https://kproxy.com/doproxy.jsp"
|
||||||
post = "page=%s&x=34&y=14" % urllib.quote(item.url)
|
# post = "page=%s&x=34&y=14" % urllib.quote(item.url)
|
||||||
response = httptools.downloadpage(url, post, follow_redirects=False).data
|
# response = httptools.downloadpage(url, post, follow_redirects=False).data
|
||||||
url = scrapertools.find_single_match(response, '<meta http-equiv="refresh".*?url=([^"]+)"')
|
# url = scrapertools.find_single_match(response, '<meta http-equiv="refresh".*?url=([^"]+)"')
|
||||||
data = httptools.downloadpage(url).data
|
# data = httptools.downloadpage(item.url).data
|
||||||
|
|
||||||
data = jsontools.load(data)
|
data = jsontools.load(data)
|
||||||
|
|
||||||
@@ -237,13 +237,13 @@ def pelis(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
# TODO: SOLO FUNCIONA POR AHORA A PARTIR DE KODI 17
|
||||||
httptools.downloadpage("https://kproxy.com/")
|
# httptools.downloadpage("https://kproxy.com/", add_referer=True)
|
||||||
url = "https://kproxy.com/doproxy.jsp"
|
# url = "https://kproxy.com/doproxy.jsp"
|
||||||
post = "page=%s&x=34&y=14" % urllib.quote(item.url)
|
# post = "page=%s&x=34&y=14" % urllib.quote(item.url)
|
||||||
response = httptools.downloadpage(url, post, follow_redirects=False).data
|
# response = httptools.downloadpage(url, post, follow_redirects=False).data
|
||||||
url = scrapertools.find_single_match(response, '<meta http-equiv="refresh".*?url=([^"]+)"')
|
# url = scrapertools.find_single_match(response, '<meta http-equiv="refresh".*?url=([^"]+)"')
|
||||||
data = httptools.downloadpage(url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
|
|
||||||
lista = jsontools.load(data)
|
lista = jsontools.load(data)
|
||||||
if item.extra == "next":
|
if item.extra == "next":
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
{
|
||||||
|
"id": "pelisultra",
|
||||||
|
"name": "PelisUltra",
|
||||||
|
"active": true,
|
||||||
|
"adult": false,
|
||||||
|
"language": ["lat"],
|
||||||
|
"thumbnail": "https://s17.postimg.org/ft51srhjj/logoultra.png",
|
||||||
|
"categories": ["movie", "tvshow"],
|
||||||
|
"settings": [
|
||||||
|
{
|
||||||
|
"id": "include_in_global_search",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en busqueda global",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "include_in_newest_peliculas",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en Novedades - Peliculas",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "include_in_newest_series",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en Novedades - Series",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "include_in_newest_terror",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en Novedades - terror",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "include_in_newest_latino",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en Novedades - Latino",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "perfil",
|
||||||
|
"type": "list",
|
||||||
|
"label": "Perfil de color",
|
||||||
|
"default": 2,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true,
|
||||||
|
"lvalues": [
|
||||||
|
"Perfil 3",
|
||||||
|
"Perfil 2",
|
||||||
|
"Perfil 1",
|
||||||
|
"Ninguno"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "episodios_x_pag",
|
||||||
|
"type": "list",
|
||||||
|
"label": "Episodios por página",
|
||||||
|
"default": 2,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true,
|
||||||
|
"lvalues": [
|
||||||
|
"10",
|
||||||
|
"15",
|
||||||
|
"20",
|
||||||
|
"25",
|
||||||
|
"30"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "temporada_o_todos",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Mostrar temporadas",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,282 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from core import httptools
|
||||||
|
from core import scrapertools
|
||||||
|
from core import servertools
|
||||||
|
from core import tmdb
|
||||||
|
from core.item import Item
|
||||||
|
from platformcode import config, logger
|
||||||
|
|
||||||
|
__perfil__ = int(config.get_setting('perfil', 'pelisultra'))
|
||||||
|
|
||||||
|
# Fijar perfil de color
|
||||||
|
perfil = [['0xFFFFE6CC', '0xFFFFCE9C', '0xFF994D00'],
|
||||||
|
['0xFFA5F6AF', '0xFF5FDA6D', '0xFF11811E'],
|
||||||
|
['0xFF58D3F7', '0xFF2E9AFE', '0xFF2E64FE']]
|
||||||
|
|
||||||
|
if __perfil__ < 3:
|
||||||
|
color1, color2, color3 = perfil[__perfil__]
|
||||||
|
else:
|
||||||
|
color1 = color2 = color3 = ""
|
||||||
|
|
||||||
|
host="http://www.pelisultra.com"
|
||||||
|
|
||||||
|
def mainlist(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
item.thumbnail = "https://github.com/master-1970/resources/raw/master/images/genres/0/Directors%20Chair.png"
|
||||||
|
itemlist.append(item.clone(title="Películas:", folder=False, text_color="0xFFD4AF37", text_bold=True))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = " Novedades", action = "peliculas", url = host))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = " Estrenos", action = "peliculas", url = host + "/genero/estrenos/" ))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = " Por género", action = "genero", url = host + "/genero/" ))
|
||||||
|
item.thumbnail = "https://github.com/master-1970/resources/raw/master/images/genres/0/TV%20Series.png"
|
||||||
|
itemlist.append(item.clone(title="Series:", folder=False, text_color="0xFFD4AF37", text_bold=True))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = " Todas las series", action = "series", url = host + "/series/" ))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = " Nuevos episodios", action = "nuevos_episodios", url = host + "/episodio/" ))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Buscar...", action = "search", url = host, text_color="red", text_bold=True))
|
||||||
|
itemlist.append(item.clone(title="Configurar canal...", text_color="green", action="configuracion", text_bold=True))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def configuracion(item):
|
||||||
|
from platformcode import platformtools
|
||||||
|
ret = platformtools.show_channel_settings()
|
||||||
|
platformtools.itemlist_refresh()
|
||||||
|
return ret
|
||||||
|
|
||||||
|
def newest(categoria):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
item = Item()
|
||||||
|
try:
|
||||||
|
if categoria in ["peliculas", "latino"]:
|
||||||
|
item.url = host
|
||||||
|
itemlist = peliculas(item)
|
||||||
|
elif categoria == 'terror':
|
||||||
|
item.url = host + '/genero/terror/'
|
||||||
|
itemlist = peliculas(item)
|
||||||
|
elif categoria == "series":
|
||||||
|
item.url = host + "/episodio/"
|
||||||
|
itemlist = nuevos_episodios(item)
|
||||||
|
if "Pagina" in itemlist[-1].title:
|
||||||
|
itemlist.pop()
|
||||||
|
|
||||||
|
# Se captura la excepción, para no interrumpir al canal novedades si un canal falla
|
||||||
|
except:
|
||||||
|
import sys
|
||||||
|
for line in sys.exc_info():
|
||||||
|
logger.error("{0}".format(line))
|
||||||
|
return []
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def peliculas(item):
|
||||||
|
#logger.info()
|
||||||
|
logger.info(item)
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
|
||||||
|
data2 = scrapertools.find_single_match(data,'(?s)<div class="item_1.*?>(.*?)id="paginador">')
|
||||||
|
|
||||||
|
# Se saca la info
|
||||||
|
#(?s)class="ml-item.*?a href="([^"]+).*?img src="([^"]+).*?alt="([^"]+).*?class="year">(\d{4})</span>(.*?)<div
|
||||||
|
patron = '(?s)class="ml-item.*?' # base
|
||||||
|
patron += 'a href="([^"]+).*?' # url
|
||||||
|
patron += 'img src="([^"]+).*?' # imagen
|
||||||
|
patron += 'alt="([^"]+).*?' # titulo
|
||||||
|
patron += 'class="year">(\d{4})' # año
|
||||||
|
patron += '</span>(.*?)<div' # calidad
|
||||||
|
matches = scrapertools.find_multiple_matches(data2, patron)
|
||||||
|
|
||||||
|
scrapertools.printMatches(matches)
|
||||||
|
for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedyear, scrapedquality in matches:
|
||||||
|
if not "/series/" in scrapedurl:
|
||||||
|
scrapedquality = scrapertools.find_single_match(scrapedquality, '<span class="calidad2">(.*?)</span>')
|
||||||
|
itemlist.append(Item(action = "findvideos", channel = item.channel, title = scrapedtitle + " (" + scrapedyear + ") [" + scrapedquality + "]", contentTitle=scrapedtitle, thumbnail = scrapedthumbnail, url = scrapedurl, quality=scrapedquality, infoLabels={'year':scrapedyear}))
|
||||||
|
else:
|
||||||
|
if item.action == "search":
|
||||||
|
itemlist.append(Item(action = "temporadas", channel = item.channel, title = scrapedtitle + " (" + scrapedyear + ")", contentSerieName=scrapedtitle, contentType="tvshow", thumbnail = scrapedthumbnail, url = scrapedurl, infoLabels={'year':scrapedyear}))
|
||||||
|
|
||||||
|
|
||||||
|
# InfoLabels:
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
|
||||||
|
# Pagina siguiente
|
||||||
|
patron_siguiente='class="pag_b"><a href="([^"]+)'
|
||||||
|
url_pagina_siguiente=scrapertools.find_single_match(data, patron_siguiente)
|
||||||
|
|
||||||
|
if url_pagina_siguiente != "":
|
||||||
|
pagina = ">>> Pagina: " + scrapertools.find_single_match(url_pagina_siguiente, '\d+')
|
||||||
|
itemlist.append(Item(channel = item.channel, action = "peliculas", title = pagina, url = url_pagina_siguiente))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def genero(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
# Delimita la búsqueda a la lista donde estan los géneros
|
||||||
|
data = scrapertools.find_single_match(data,'(?s)<ul id="menu-generos" class="">(.*?)</ul>')
|
||||||
|
# Extrae la url y el género
|
||||||
|
patron = '<a href="(.*?)">(.*?)</a></li>'
|
||||||
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
|
# Se quita "Estrenos" de la lista porque tiene su propio menu
|
||||||
|
matches.pop(0)
|
||||||
|
|
||||||
|
for scrapedurl, scrapedtitle in matches:
|
||||||
|
itemlist.append(Item(action = "peliculas", channel = item.channel, title = scrapedtitle, url = scrapedurl))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def series(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
# Se saca la info
|
||||||
|
patron = '(?s)class="ml-item.*?' # base
|
||||||
|
patron += 'a href="([^"]+).*?' # url
|
||||||
|
patron += 'img src="([^"]+).*?' # imagen
|
||||||
|
patron += 'alt="([^"]+).*?' # titulo
|
||||||
|
patron += 'class="year">(\d{4})' # año
|
||||||
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
|
|
||||||
|
#if config.get_setting('temporada_o_todos', 'pelisultra') == 0:
|
||||||
|
if config.get_setting('temporada_o_todos', 'pelisultra'):
|
||||||
|
accion="temporadas"
|
||||||
|
else:
|
||||||
|
accion="episodios"
|
||||||
|
|
||||||
|
for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedyear in matches:
|
||||||
|
itemlist.append(Item(action = accion, channel = item.channel, title = scrapedtitle + " (" + scrapedyear + ")", contentSerieName=scrapedtitle, contentType="tvshow", thumbnail = scrapedthumbnail, url = scrapedurl, infoLabels={'year':scrapedyear}))
|
||||||
|
|
||||||
|
# InfoLabels:
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
|
||||||
|
# Pagina siguiente
|
||||||
|
patron_siguiente='class="pag_b"><a href="([^"]+)'
|
||||||
|
url_pagina_siguiente=scrapertools.find_single_match(data, patron_siguiente)
|
||||||
|
|
||||||
|
if url_pagina_siguiente != "":
|
||||||
|
pagina = ">>> Pagina: " + scrapertools.find_single_match(url_pagina_siguiente, '\d+')
|
||||||
|
itemlist.append(Item(channel = item.channel, action = "series", title = pagina, url = url_pagina_siguiente))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def temporadas(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
# Extrae las temporadas
|
||||||
|
patron = '<span class="se-t.*?>(.*?)</span>'
|
||||||
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
|
|
||||||
|
# Excepción para la serie Sin Límites
|
||||||
|
if item.contentTitle == 'Amar sin límites':
|
||||||
|
item.contentSerieName = "limitless"
|
||||||
|
item.infoLabels['tmdb_id']=''
|
||||||
|
|
||||||
|
for scrapedseason in matches:
|
||||||
|
itemlist.append(item.clone(action = "episodios", title = "Temporada " + scrapedseason, contentSeason=scrapedseason))
|
||||||
|
|
||||||
|
# InfoLabels:
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def episodios(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
patron = '(?s)class="episodiotitle">.*?a href="(.*?)">(.*?)</a>'
|
||||||
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
|
|
||||||
|
for scrapedurl, scrapedtitle in matches:
|
||||||
|
# Saco el numero de capitulo de la url
|
||||||
|
numero_capitulo=scrapertools.get_season_and_episode(scrapedurl)
|
||||||
|
if numero_capitulo != "":
|
||||||
|
temporada=numero_capitulo.split("x")[0]
|
||||||
|
capitulo=numero_capitulo.split("x")[1]
|
||||||
|
else:
|
||||||
|
temporada="_"
|
||||||
|
capitulo="_"
|
||||||
|
|
||||||
|
if item.contentSeason and str(item.contentSeason) != temporada:
|
||||||
|
continue
|
||||||
|
|
||||||
|
itemlist.append(item.clone(action = "findvideos", title = numero_capitulo + " - " + scrapedtitle.strip(), url = scrapedurl, contentSeason=temporada, contentEpisodeNumber=capitulo))
|
||||||
|
|
||||||
|
# if item.contentTitle.startswith('Temporada'):
|
||||||
|
# if str(item.contentSeason) == temporada:
|
||||||
|
# itemlist.append(item.clone(action = "findvideos", title = numero_capitulo + " - " + scrapedtitle.strip(), url = scrapedurl, contentSeason=temporada, contentEpisodeNumber=capitulo))
|
||||||
|
# else:
|
||||||
|
# itemlist.append(item.clone(action = "findvideos", title = numero_capitulo + " - " + scrapedtitle.strip(), url = scrapedurl, contentSeason=temporada, contentEpisodeNumber=capitulo))
|
||||||
|
|
||||||
|
#episodios_por_pagina=20
|
||||||
|
# if config.get_setting('episodios_x_pag', 'pelisultra').isdigit():
|
||||||
|
# episodios_por_pagina=int(config.get_setting('episodios_x_pag', 'pelisultra'))
|
||||||
|
# else:
|
||||||
|
# episodios_por_pagina=20
|
||||||
|
# config.set_setting('episodios_x_pag', '20', 'pelisultra')
|
||||||
|
|
||||||
|
episodios_por_pagina= int(config.get_setting('episodios_x_pag', 'pelisultra')) * 5 + 10
|
||||||
|
|
||||||
|
if not item.page:
|
||||||
|
item.page = 0
|
||||||
|
|
||||||
|
itemlist_page = itemlist[item.page: item.page + episodios_por_pagina]
|
||||||
|
|
||||||
|
if len(itemlist) > item.page + episodios_por_pagina:
|
||||||
|
itemlist_page.append(item.clone(title = ">>> Pagina siguiente", page = item.page + episodios_por_pagina))
|
||||||
|
|
||||||
|
# InfoLabels:
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist_page, seekTmdb=True)
|
||||||
|
|
||||||
|
return itemlist_page
|
||||||
|
|
||||||
|
def nuevos_episodios(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
patron = '(?s)<td class="bb">.*?' # base
|
||||||
|
patron += '<a href="(.*?)">' # url
|
||||||
|
patron += '(.*?)</a>.*?' # nombre_serie
|
||||||
|
patron += '<img src="(.*?)>.*?' # imagen
|
||||||
|
patron += '<h2>(.*?)</h2>' # titulo
|
||||||
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
|
|
||||||
|
for scrapedurl, scrapedseriename, scrapedthumbnail, scrapedtitle in matches:
|
||||||
|
numero_capitulo=scrapertools.get_season_and_episode(scrapedurl)
|
||||||
|
if numero_capitulo != "":
|
||||||
|
temporada=numero_capitulo.split("x")[0]
|
||||||
|
capitulo=numero_capitulo.split("x")[1]
|
||||||
|
else:
|
||||||
|
temporada="_"
|
||||||
|
capitulo="_"
|
||||||
|
|
||||||
|
itemlist.append(Item(channel = item.channel, action = "findvideos", title = scrapedseriename +": " + numero_capitulo + " - " + scrapedtitle.strip(), url = scrapedurl, thumbnail = scrapedthumbnail, contentSerieName=scrapedseriename, contentSeason=temporada, contentEpisodeNumber=capitulo))
|
||||||
|
|
||||||
|
# InfoLabels:
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
|
||||||
|
# Pagina siguiente
|
||||||
|
patron_siguiente='class="pag_b"><a href="([^"]+)'
|
||||||
|
url_pagina_siguiente=scrapertools.find_single_match(data, patron_siguiente)
|
||||||
|
|
||||||
|
if url_pagina_siguiente != "":
|
||||||
|
pagina = ">>> Pagina: " + scrapertools.find_single_match(url_pagina_siguiente, '\d+')
|
||||||
|
itemlist.append(Item(channel = item.channel, action = "nuevos_episodios", title = pagina, url = url_pagina_siguiente))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def search(item, texto):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
texto = texto.replace(" ", "+")
|
||||||
|
try:
|
||||||
|
item.url = host + "/?s=%s" % texto
|
||||||
|
itemlist.extend(peliculas(item))
|
||||||
|
return itemlist
|
||||||
|
# Se captura la excepción, para no interrumpir al buscador global si un canal falla
|
||||||
|
except:
|
||||||
|
import sys
|
||||||
|
for line in sys.exc_info():
|
||||||
|
logger.error("%s" % line)
|
||||||
|
return []
|
||||||
@@ -5,7 +5,8 @@ import os
|
|||||||
|
|
||||||
from core import channeltools
|
from core import channeltools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode.unify import thumb_dict
|
||||||
|
from platformcode import config, logger, unify
|
||||||
|
|
||||||
|
|
||||||
def getmainlist(view="thumb_"):
|
def getmainlist(view="thumb_"):
|
||||||
@@ -199,14 +200,24 @@ def filterchannels(category, view="thumb_"):
|
|||||||
return channelslist
|
return channelslist
|
||||||
|
|
||||||
|
|
||||||
def get_thumb(thumb_name, view="thumb_"):
|
def get_thumb(thumb_name, view="thumb_", auto=False):
|
||||||
|
|
||||||
icon_pack_name = config.get_setting('icon_set', default="default")
|
if auto:
|
||||||
if icon_pack_name == "default":
|
thumbnail = ''
|
||||||
resource_path = os.path.join(config.get_runtime_path(), "resources", "media", "themes")
|
|
||||||
|
thumb_name = unify.set_genre(unify.simplify(thumb_name))
|
||||||
|
|
||||||
|
|
||||||
|
if thumb_name in thumb_dict:
|
||||||
|
thumbnail = thumb_dict[thumb_name]
|
||||||
|
return thumbnail
|
||||||
else:
|
else:
|
||||||
resource_path = "https://raw.githubusercontent.com/alfa-addon/media/master/themes/"
|
icon_pack_name = config.get_setting('icon_set', default="default")
|
||||||
|
if icon_pack_name == "default":
|
||||||
|
resource_path = os.path.join(config.get_runtime_path(), "resources", "media", "themes")
|
||||||
|
else:
|
||||||
|
resource_path = "https://raw.githubusercontent.com/alfa-addon/media/master/themes/"
|
||||||
|
|
||||||
media_path = os.path.join(resource_path, icon_pack_name)
|
media_path = os.path.join(resource_path, icon_pack_name)
|
||||||
|
|
||||||
return os.path.join(media_path, view + thumb_name)
|
return os.path.join(media_path, view + thumb_name)
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import xbmc
|
|||||||
import xbmcgui
|
import xbmcgui
|
||||||
import xbmcplugin
|
import xbmcplugin
|
||||||
from channelselector import get_thumb
|
from channelselector import get_thumb
|
||||||
|
from platformcode import unify
|
||||||
|
from core import channeltools
|
||||||
from core import trakt_tools
|
from core import trakt_tools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
@@ -118,8 +120,18 @@ def render_items(itemlist, parent_item):
|
|||||||
if not len(itemlist):
|
if not len(itemlist):
|
||||||
itemlist.append(Item(title="No hay elementos que mostrar"))
|
itemlist.append(Item(title="No hay elementos que mostrar"))
|
||||||
|
|
||||||
|
genre = False
|
||||||
|
if 'nero' in parent_item.title:
|
||||||
|
genre = True
|
||||||
|
anime = False
|
||||||
|
if 'anime' in channeltools.get_channel_parameters(parent_item.channel)['categories']:
|
||||||
|
anime = True
|
||||||
|
|
||||||
# Recorremos el itemlist
|
# Recorremos el itemlist
|
||||||
|
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
|
channel_parameters = channeltools.get_channel_parameters(item.channel)
|
||||||
|
#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 == "":
|
||||||
item.category = parent_item.category
|
item.category = parent_item.category
|
||||||
@@ -128,25 +140,51 @@ def render_items(itemlist, parent_item):
|
|||||||
if item.fanart == "":
|
if item.fanart == "":
|
||||||
item.fanart = parent_item.fanart
|
item.fanart = parent_item.fanart
|
||||||
|
|
||||||
# Formatear titulo
|
|
||||||
if item.text_color:
|
if genre:
|
||||||
item.title = '[COLOR %s]%s[/COLOR]' % (item.text_color, item.title)
|
|
||||||
if item.text_bold:
|
valid_genre = True
|
||||||
item.title = '[B]%s[/B]' % item.title
|
thumb = get_thumb(item.title, auto=True)
|
||||||
if item.text_italic:
|
if thumb != '':
|
||||||
item.title = '[I]%s[/I]' % item.title
|
item.thumbnail = thumb
|
||||||
|
valid_genre = True
|
||||||
|
elif anime:
|
||||||
|
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:
|
||||||
|
# Formatear titulo con unify
|
||||||
|
item = unify.title_format(item)
|
||||||
|
else:
|
||||||
|
#Formatear titulo metodo old school
|
||||||
|
if item.text_color:
|
||||||
|
item.title = '[COLOR %s]%s[/COLOR]' % (item.text_color, item.title)
|
||||||
|
if item.text_bold:
|
||||||
|
item.title = '[B]%s[/B]' % item.title
|
||||||
|
if item.text_italic:
|
||||||
|
item.title = '[I]%s[/I]' % item.title
|
||||||
|
|
||||||
# Añade headers a las imagenes si estan en un servidor con cloudflare
|
# Añade headers a las imagenes si estan en un servidor con cloudflare
|
||||||
from core import httptools
|
from core import httptools
|
||||||
|
|
||||||
item.thumbnail = httptools.get_url_headers(item.thumbnail)
|
item.thumbnail = httptools.get_url_headers(item.thumbnail)
|
||||||
item.fanart = httptools.get_url_headers(item.fanart)
|
item.fanart = httptools.get_url_headers(item.fanart)
|
||||||
|
item.thumbnail = unify.thumbnail_type(item)
|
||||||
# IconImage para folder y video
|
# IconImage para folder y video
|
||||||
if item.folder:
|
if item.folder:
|
||||||
icon_image = "DefaultFolder.png"
|
icon_image = "DefaultFolder.png"
|
||||||
else:
|
else:
|
||||||
icon_image = "DefaultVideo.png"
|
icon_image = "DefaultVideo.png"
|
||||||
|
|
||||||
|
#if not genre or (genre and valid_genre):
|
||||||
|
# Creamos el listitem
|
||||||
|
#listitem = xbmcgui.ListItem(item.title, iconImage=icon_image, thumbnailImage=unify.thumbnail_type(item))
|
||||||
|
listitem = xbmcgui.ListItem(item.title, iconImage=icon_image, thumbnailImage=item.thumbnail)
|
||||||
# Ponemos el fanart
|
# Ponemos el fanart
|
||||||
if item.fanart:
|
if item.fanart:
|
||||||
fanart = item.fanart
|
fanart = item.fanart
|
||||||
@@ -159,7 +197,8 @@ def render_items(itemlist, parent_item):
|
|||||||
# values icon, thumb or poster are skin dependent.. so we set all to avoid problems
|
# values icon, thumb or poster are skin dependent.. so we set all to avoid problems
|
||||||
# if not exists thumb it's used icon value
|
# if not exists thumb it's used icon value
|
||||||
if config.get_platform(True)['num_version'] >= 16.0:
|
if config.get_platform(True)['num_version'] >= 16.0:
|
||||||
listitem.setArt({'icon': icon_image, 'thumb': item.thumbnail, 'poster': item.thumbnail, 'fanart': fanart})
|
listitem.setArt({'icon': icon_image, 'thumb': item.contentThumbnail, 'poster': item.thumbnail,
|
||||||
|
'fanart': fanart})
|
||||||
else:
|
else:
|
||||||
listitem.setIconImage(icon_image)
|
listitem.setIconImage(icon_image)
|
||||||
listitem.setThumbnailImage(item.thumbnail)
|
listitem.setThumbnailImage(item.thumbnail)
|
||||||
@@ -193,6 +232,7 @@ def render_items(itemlist, parent_item):
|
|||||||
listitem=listitem, isFolder=item.folder,
|
listitem=listitem, isFolder=item.folder,
|
||||||
totalItems=item.totalItems)
|
totalItems=item.totalItems)
|
||||||
|
|
||||||
|
|
||||||
# Fijar los tipos de vistas...
|
# Fijar los tipos de vistas...
|
||||||
if config.get_setting("forceview"):
|
if config.get_setting("forceview"):
|
||||||
# ...forzamos segun el viewcontent
|
# ...forzamos segun el viewcontent
|
||||||
@@ -510,7 +550,7 @@ def is_playing():
|
|||||||
def play_video(item, strm=False, force_direct=False, autoplay=False):
|
def play_video(item, strm=False, force_direct=False, autoplay=False):
|
||||||
logger.info()
|
logger.info()
|
||||||
# logger.debug(item.tostring('\n'))
|
# logger.debug(item.tostring('\n'))
|
||||||
|
logger.debug('item play: %s'%item)
|
||||||
if item.channel == 'downloads':
|
if item.channel == 'downloads':
|
||||||
logger.info("Reproducir video local: %s [%s]" % (item.title, item.url))
|
logger.info("Reproducir video local: %s [%s]" % (item.title, item.url))
|
||||||
xlistitem = xbmcgui.ListItem(path=item.url)
|
xlistitem = xbmcgui.ListItem(path=item.url)
|
||||||
@@ -890,6 +930,7 @@ def set_player(item, xlistitem, mediaurl, view, strm):
|
|||||||
if strm or item.strm_path:
|
if strm or item.strm_path:
|
||||||
from platformcode import xbmc_videolibrary
|
from platformcode import xbmc_videolibrary
|
||||||
xbmc_videolibrary.mark_auto_as_watched(item)
|
xbmc_videolibrary.mark_auto_as_watched(item)
|
||||||
|
logger.debug(item)
|
||||||
xlistitem.setPath(mediaurl)
|
xlistitem.setPath(mediaurl)
|
||||||
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xlistitem)
|
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xlistitem)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,557 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# Unify
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# Herramientas responsables de unificar diferentes tipos de
|
||||||
|
# datos obtenidos de las paginas
|
||||||
|
# ----------------------------------------------------------
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import urllib
|
||||||
|
import unicodedata
|
||||||
|
import re
|
||||||
|
|
||||||
|
import config
|
||||||
|
from core.item import Item
|
||||||
|
from core import scrapertools
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
|
thumb_dict = {"movies": "https://s10.postimg.org/fxtqzdog9/peliculas.png",
|
||||||
|
"tvshows": "https://s10.postimg.org/kxvslawe1/series.png",
|
||||||
|
"all": "https://s10.postimg.org/h1igpgw0p/todas.png",
|
||||||
|
"genres": "https://s10.postimg.org/6c4rx3x1l/generos.png",
|
||||||
|
"search": "https://s10.postimg.org/v985e2izd/buscar.png",
|
||||||
|
"quality": "https://s10.postimg.org/9bbojsbjd/calidad.png",
|
||||||
|
"audio": "https://s10.postimg.org/b34nern7d/audio.png",
|
||||||
|
"newest": "https://s10.postimg.org/g1s5tf1bt/novedades.png",
|
||||||
|
"last": "https://s10.postimg.org/i6ciuk0eh/ultimas.png",
|
||||||
|
"hot": "https://s10.postimg.org/yu40x8q2x/destacadas.png",
|
||||||
|
"year": "https://s10.postimg.org/atzrqg921/a_o.png",
|
||||||
|
"alphabet": "https://s10.postimg.org/4dy3ytmgp/a-z.png",
|
||||||
|
"recomended": "https://s10.postimg.org/7xk1oqccp/recomendadas.png",
|
||||||
|
"more watched": "https://s10.postimg.org/c6orr5neh/masvistas.png",
|
||||||
|
"more voted": "https://s10.postimg.org/c6orr5neh/masvistas.png",
|
||||||
|
"favorites": "https://s10.postimg.org/rtg147gih/favoritas.png",
|
||||||
|
"colections": "https://s10.postimg.org/ywnwjvytl/colecciones.png",
|
||||||
|
"categories": "https://s10.postimg.org/v0ako5lmh/categorias.png",
|
||||||
|
"premieres": "https://s10.postimg.org/sk8r9xdq1/estrenos.png",
|
||||||
|
"documentaries": "https://s10.postimg.org/68aygmmcp/documentales.png",
|
||||||
|
"language": "https://s10.postimg.org/6wci189ft/idioma.png",
|
||||||
|
"new episodes": "https://s10.postimg.org/fu4iwpnqh/nuevoscapitulos.png",
|
||||||
|
"country": "https://s10.postimg.org/yz0h81j15/pais.png",
|
||||||
|
"adults": "https://s10.postimg.org/s8raxc51l/adultos.png",
|
||||||
|
"recents": "https://s10.postimg.org/649u24kp5/recents.png",
|
||||||
|
"accion": "https://s14.postimg.org/sqy3q2aht/action.png",
|
||||||
|
"adolescente" : "https://s10.postimg.org/inq7u4p61/teens.png",
|
||||||
|
"adultos": "https://s10.postimg.org/s8raxc51l/adultos.png",
|
||||||
|
"animacion": "https://s14.postimg.org/vl193mupd/animation.png",
|
||||||
|
"anime" : "https://s10.postimg.org/n9mc2ikzt/anime.png",
|
||||||
|
"artes marciales" : "https://s10.postimg.org/4u1v51tzt/martial_arts.png",
|
||||||
|
"aventura": "https://s14.postimg.org/ky7fy5he9/adventure.png",
|
||||||
|
"belico": "https://s14.postimg.org/5e027lru9/war.png",
|
||||||
|
"biografia" : "https://s10.postimg.org/jq0ecjxnt/biographic.png",
|
||||||
|
"carreras": "https://s14.postimg.org/yt5qgdr69/races.png",
|
||||||
|
"ciencia ficcion": "https://s14.postimg.org/8kulr2jy9/scifi.png",
|
||||||
|
"cine negro" : "https://s10.postimg.org/6ym862qgp/noir.png",
|
||||||
|
"comedia": "https://s14.postimg.org/9ym8moog1/comedy.png",
|
||||||
|
"cortometraje" : "https://s10.postimg.org/qggvlxndl/shortfilm.png",
|
||||||
|
"crimen": "https://s14.postimg.org/duzkipjq9/crime.png",
|
||||||
|
"de la tv": "https://s10.postimg.org/94gj0iwh5/image.png",
|
||||||
|
"deporte": "https://s14.postimg.org/x1crlnnap/sports.png",
|
||||||
|
"destacadas": "https://s10.postimg.org/yu40x8q2x/destacadas.png",
|
||||||
|
"documental": "https://s10.postimg.org/68aygmmcp/documentales.png",
|
||||||
|
"drama": "https://s14.postimg.org/fzjxjtnxt/drama.png",
|
||||||
|
"erotica" : "https://s10.postimg.org/dcbb9bfx5/erotic.png",
|
||||||
|
"espanolas" : "https://s10.postimg.org/x1y6zikx5/spanish.png",
|
||||||
|
"estrenos" : "https://s10.postimg.org/sk8r9xdq1/estrenos.png",
|
||||||
|
"extranjera": "https://s10.postimg.org/f44a4eerd/foreign.png",
|
||||||
|
"familiar": "https://s14.postimg.org/jj5v9ndsx/family.png",
|
||||||
|
"fantasia": "https://s14.postimg.org/p7c60ksg1/fantasy.png",
|
||||||
|
"fantastico" : "https://s10.postimg.org/tedufx5eh/fantastic.png",
|
||||||
|
"historica": "https://s10.postimg.org/p1faxj6yh/historic.png",
|
||||||
|
"horror" : "https://s10.postimg.org/8exqo6yih/horror2.png",
|
||||||
|
"infantil": "https://s14.postimg.org/4zyq842mp/childish.png",
|
||||||
|
"intriga": "https://s14.postimg.org/5qrgdimw1/intrigue.png",
|
||||||
|
"latino" : "https://s10.postimg.org/swip0b86h/latin.png",
|
||||||
|
"mexicanas" : "https://s10.postimg.org/swip0b86h/latin.png",
|
||||||
|
"misterio": "https://s14.postimg.org/3m73cg8ep/mistery.png",
|
||||||
|
"musical": "https://s10.postimg.org/hy7fhtecp/musical.png",
|
||||||
|
"peleas" : "https://s10.postimg.org/7a3ojbjwp/Fight.png",
|
||||||
|
"policial" : "https://s10.postimg.org/wsw0wbgbd/cops.png",
|
||||||
|
"recomendadas": "https://s10.postimg.org/7xk1oqccp/recomendadas.png",
|
||||||
|
"religion" : "https://s10.postimg.org/44j2skquh/religion.png",
|
||||||
|
"romance" : "https://s10.postimg.org/yn8vdll6x/romance.png",
|
||||||
|
"romantica": "https://s14.postimg.org/8xlzx7cht/romantic.png",
|
||||||
|
"suspenso": "https://s10.postimg.org/7peybxdfd/suspense.png",
|
||||||
|
"terror": "https://s14.postimg.org/thqtvl52p/horror.png",
|
||||||
|
"thriller": "https://s14.postimg.org/uwsekl8td/thriller.png",
|
||||||
|
"western": "https://s10.postimg.org/5wc1nokjt/western.png"
|
||||||
|
}
|
||||||
|
|
||||||
|
def set_genre(string):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
genres_dict = {'accion':['accion', 'action', 'accion y aventura', 'action & adventure'],
|
||||||
|
'adultos':['adultos', 'adultos +', 'adulto'],
|
||||||
|
'animacion':['animacion', 'animacion e infantil', 'dibujos animados'],
|
||||||
|
'adolescente':['adolescente', 'adolescentes', 'adolescencia', 'adolecentes'],
|
||||||
|
'aventura':['aventura', 'aventuras'],
|
||||||
|
'belico':['belico', 'belica', 'belicas', 'guerra', 'belico guerra'],
|
||||||
|
'biografia':['biografia', 'biografias', 'biografica', 'biograficas', 'biografico'],
|
||||||
|
'ciencia ficcion':['ciencia ficcion', 'cienciaficcion', 'sci fi', 'c ficcion'],
|
||||||
|
'cine negro':['film noir', 'negro'],
|
||||||
|
'comedia':['comedia', 'comedias'],
|
||||||
|
'cortometraje':['cortometraje', 'corto', 'cortos'],
|
||||||
|
'de la tv':['de la tv', 'television', 'tv'],
|
||||||
|
'deporte':['deporte', 'deportes'],
|
||||||
|
'destacadas':['destacada', 'destacadas'],
|
||||||
|
'documental':['documental', 'documentales'],
|
||||||
|
'erotica':['erotica', 'erotica +', 'eroticas', 'eroticas +', 'erotico', 'erotico +'],
|
||||||
|
'estrenos':['estrenos', 'estrenos'],
|
||||||
|
'extranjera':['extrajera', 'extrajeras', 'foreign'],
|
||||||
|
'familiar':['familiar', 'familia'],
|
||||||
|
'fantastico':['fantastico', 'fantastica', 'fantasticas'],
|
||||||
|
'historica':['historica', 'historicas', 'historico', 'historia'],
|
||||||
|
'infantil':['infantil', 'kids'],
|
||||||
|
'musical':['musical', 'musicales', 'musica'],
|
||||||
|
'policial':['policial', 'policiaco', 'policiaca'],
|
||||||
|
'recomendadas':['recomedada', 'recomendadas'],
|
||||||
|
'religion':['religion', 'religiosa', 'religiosas'],
|
||||||
|
'romantica':['romantica', 'romanticas', 'romantico'],
|
||||||
|
'suspenso':['suspenso', 'suspense'],
|
||||||
|
'thriller':['thriller', 'thrillers'],
|
||||||
|
'western':['western', 'westerns', 'oeste western']
|
||||||
|
}
|
||||||
|
string = re.sub(r'peliculas de |pelicula de la |peli |cine ','', string)
|
||||||
|
for genre, variants in genres_dict.items():
|
||||||
|
if string in variants:
|
||||||
|
string = genre
|
||||||
|
|
||||||
|
return string
|
||||||
|
|
||||||
|
def remove_format(string):
|
||||||
|
logger.info()
|
||||||
|
#logger.debug('entra en remove: %s' % string)
|
||||||
|
string = string.rstrip()
|
||||||
|
string = re.sub(r'(\[|\[\/)(?:color|COLOR|b|B|i|I).*?\]|\[|\]|\(|\)|\:|\.', '', string)
|
||||||
|
#logger.debug('sale de remove: %s' % string)
|
||||||
|
return string
|
||||||
|
|
||||||
|
def simplify(string):
|
||||||
|
|
||||||
|
logger.info()
|
||||||
|
#logger.debug('entra en simplify: %s'%string)
|
||||||
|
string = remove_format(string)
|
||||||
|
string = string.replace('-',' ').replace('_',' ')
|
||||||
|
string = re.sub(r'\d+','', string)
|
||||||
|
string = string.strip()
|
||||||
|
string = string.decode('utf-8')
|
||||||
|
notilde = ''.join((c for c in unicodedata.normalize('NFD', unicode(string)) if unicodedata.category(c) != 'Mn'))
|
||||||
|
string = notilde.decode()
|
||||||
|
string = string.lower()
|
||||||
|
#logger.debug('sale de simplify: %s' % string)
|
||||||
|
|
||||||
|
return string
|
||||||
|
|
||||||
|
def add_languages(title, languages):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
if isinstance(languages, list):
|
||||||
|
for language in languages:
|
||||||
|
title = '%s %s' % (title, set_color(language, language))
|
||||||
|
else:
|
||||||
|
title = '%s %s' % (title, set_color(languages, languages))
|
||||||
|
return title
|
||||||
|
|
||||||
|
def set_color(title, category):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
color_scheme = {'otro': 'white'}
|
||||||
|
|
||||||
|
#logger.debug('category antes de remove: %s' % category)
|
||||||
|
category = remove_format(category).lower()
|
||||||
|
#logger.debug('category despues de remove: %s' % category)
|
||||||
|
# Lista de elementos posibles en el titulo
|
||||||
|
color_list = ['movie', 'tvshow', 'year', 'rating_1', 'rating_2', 'rating_3', 'quality', 'cast', 'lat', 'vose',
|
||||||
|
'vos', 'vo', 'server', 'library', 'update', 'no_update']
|
||||||
|
|
||||||
|
# Se verifica el estado de la opcion de colores personalizados
|
||||||
|
custom_colors = config.get_setting('title_color')
|
||||||
|
|
||||||
|
# Se Forma el diccionario de colores para cada elemento, la opcion esta activas utiliza la configuracion del
|
||||||
|
# usuario, si no pone el titulo en blanco.
|
||||||
|
if title not in ['', ' ']:
|
||||||
|
|
||||||
|
for element in color_list:
|
||||||
|
if custom_colors:
|
||||||
|
color_scheme[element] = remove_format(config.get_setting('%s_color' % element))
|
||||||
|
else:
|
||||||
|
color_scheme[element] = 'white'
|
||||||
|
if category in ['update', 'no_update']:
|
||||||
|
#logger.debug('title antes de updates: %s' % title)
|
||||||
|
title= re.sub(r'\[COLOR .*?\]','[COLOR %s]' % color_scheme[category],title)
|
||||||
|
else:
|
||||||
|
if category not in ['movie', 'tvshow', 'library', 'otro']:
|
||||||
|
title = "[COLOR %s][%s][/COLOR]"%(color_scheme[category], title)
|
||||||
|
else:
|
||||||
|
title = "[COLOR %s]%s[/COLOR]" % (color_scheme[category], title)
|
||||||
|
return title
|
||||||
|
|
||||||
|
def set_lang(language):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
cast =['castellano','espanol','cast','esp','espaol', 'es','zc', 'spa', 'spanish', 'vc']
|
||||||
|
lat=['latino','lat','la', 'espanol latino', 'espaol latino', 'zl', 'mx', 'co', 'vl']
|
||||||
|
vose=['subtitulado','subtitulada','sub','sub espanol','vose','espsub','su','subs castellano',
|
||||||
|
'sub: español', 'vs', 'zs', 'vs', 'english-spanish subs', 'ingles sub espanol']
|
||||||
|
vos=['vos', 'sub ingles', 'engsub', 'vosi','ingles subtitulado', 'sub: ingles']
|
||||||
|
vo=['ingles', 'en','vo', 'ovos', 'eng','v.o', 'english']
|
||||||
|
|
||||||
|
language = scrapertools.decodeHtmlentities(language)
|
||||||
|
old_lang = language
|
||||||
|
|
||||||
|
language = simplify(language)
|
||||||
|
|
||||||
|
#logger.debug('language before simplify: %s' % language)
|
||||||
|
#logger.debug('old language: %s' % old_lang)
|
||||||
|
if language in cast:
|
||||||
|
language = 'cast'
|
||||||
|
elif language in lat:
|
||||||
|
language = 'lat'
|
||||||
|
elif language in vose:
|
||||||
|
language = 'vose'
|
||||||
|
elif language in vos:
|
||||||
|
language = 'vos'
|
||||||
|
elif language in vo:
|
||||||
|
language = 'vo'
|
||||||
|
else:
|
||||||
|
language = 'otro'
|
||||||
|
|
||||||
|
#logger.debug('language after simplify: %s' % language)
|
||||||
|
|
||||||
|
return language
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def title_format(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
lang = False
|
||||||
|
valid = True
|
||||||
|
language_color = 'otro'
|
||||||
|
|
||||||
|
#logger.debug('item.title antes de formatear: %s' % item.title.lower())
|
||||||
|
|
||||||
|
# TODO se deberia quitar cualquier elemento que no sea un enlace de la lista de findvideos para quitar esto
|
||||||
|
|
||||||
|
#Palabras "prohibidas" en los titulos (cualquier titulo que contengas estas no se procesara en unify)
|
||||||
|
excluded_words = ['online', 'descarga', 'downloads', 'trailer', 'videoteca', 'gb', 'autoplay']
|
||||||
|
|
||||||
|
# Actions excluidos, (se define canal y action) los titulos que contengan ambos valores no se procesaran en unify
|
||||||
|
excluded_actions = [('videolibrary','get_episodes')]
|
||||||
|
|
||||||
|
# Verifica si hay marca de visto de trakt
|
||||||
|
|
||||||
|
visto = False
|
||||||
|
#logger.debug('titlo con visto? %s' % item.title)
|
||||||
|
|
||||||
|
if '[[I]v[/I]]' in item.title or '[COLOR limegreen][v][/COLOR]' in item.title:
|
||||||
|
visto = True
|
||||||
|
|
||||||
|
# Se elimina cualquier formato previo en el titulo
|
||||||
|
if item.action != '':
|
||||||
|
item.title = remove_format(item.title)
|
||||||
|
|
||||||
|
#logger.debug('visto? %s' % visto)
|
||||||
|
|
||||||
|
# Evita que aparezcan los idiomas en los mainlist de cada canal
|
||||||
|
if item.action == 'mainlist':
|
||||||
|
item.language =''
|
||||||
|
|
||||||
|
info = item.infoLabels
|
||||||
|
#logger.debug('item antes de formatear: %s'%item)
|
||||||
|
|
||||||
|
if hasattr(item,'text_color'):
|
||||||
|
item.text_color=''
|
||||||
|
|
||||||
|
#Verifica el item sea valido para ser formateado por unify
|
||||||
|
|
||||||
|
if item.channel == 'trailertools' or (item.channel.lower(), item.action.lower()) in excluded_actions or \
|
||||||
|
item.action=='':
|
||||||
|
valid = False
|
||||||
|
else:
|
||||||
|
for word in excluded_words:
|
||||||
|
if word in item.title.lower():
|
||||||
|
valid = False
|
||||||
|
break
|
||||||
|
|
||||||
|
if valid and item.unify!=False:
|
||||||
|
|
||||||
|
# Formamos el titulo para serie, se debe definir contentSerieName
|
||||||
|
# o show en el item para que esto funcione.
|
||||||
|
if item.contentSerieName:
|
||||||
|
|
||||||
|
# Si se tiene la informacion en infolabels se utiliza
|
||||||
|
if item.contentType == 'episode' and info['episode'] != '':
|
||||||
|
if info['title'] == '':
|
||||||
|
info['title'] = '%s - Episodio %s'% (info['tvshowtitle'], info['episode'])
|
||||||
|
elif 'Episode' in info['title']:
|
||||||
|
episode = info['title'].lower().replace('episode', 'episodio')
|
||||||
|
info['title'] = '%s - %s' % (info['tvshowtitle'], episode.capitalize())
|
||||||
|
elif info['episodio_titulo']!='':
|
||||||
|
#logger.debug('info[episode_titulo]: %s' % info['episodio_titulo'])
|
||||||
|
if 'episode' in info['episodio_titulo'].lower():
|
||||||
|
episode = info['episodio_titulo'].lower().replace('episode', 'episodio')
|
||||||
|
item.title = '%sx%s - %s' % (info['season'],info['episode'], episode.capitalize())
|
||||||
|
else:
|
||||||
|
item.title = '%sx%s - %s' % (info['season'], info['episode'], info['episodio_titulo'].capitalize())
|
||||||
|
else:
|
||||||
|
item.title = '%sx%s - %s' % (info['season'],info['episode'], info['title'])
|
||||||
|
item.title = set_color(item.title, 'tvshow')
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
# En caso contrario se utiliza el titulo proporcionado por el canal
|
||||||
|
#logger.debug ('color_scheme[tvshow]: %s' % color_scheme['tvshow'])
|
||||||
|
item.title = '%s' % set_color(item.title, 'tvshow')
|
||||||
|
|
||||||
|
elif item.contentTitle:
|
||||||
|
# Si el titulo no tiene contentSerieName entonces se formatea como pelicula
|
||||||
|
item.title = '%s' % set_color(item.contentTitle, 'movie')
|
||||||
|
if item.contentType=='movie':
|
||||||
|
item.context='Buscar esta pelicula en otros canales'
|
||||||
|
|
||||||
|
if 'Novedades' in item.category and item.from_channel=='news':
|
||||||
|
#logger.debug('novedades')
|
||||||
|
item.title = '%s [%s]'%(item.title, item.channel)
|
||||||
|
|
||||||
|
# Verificamos si item.language es una lista, si lo es se toma
|
||||||
|
# cada valor y se normaliza formado una nueva lista
|
||||||
|
|
||||||
|
if hasattr(item,'language') and item.language !='':
|
||||||
|
#logger.debug('tiene language: %s'%item.language)
|
||||||
|
if isinstance(item.language, list):
|
||||||
|
language_list =[]
|
||||||
|
for language in item.language:
|
||||||
|
if language != '':
|
||||||
|
lang = True
|
||||||
|
language_list.append(set_lang(remove_format(language)).upper())
|
||||||
|
#logger.debug('language_list: %s' % language_list)
|
||||||
|
simple_language = language_list
|
||||||
|
else:
|
||||||
|
# Si item.language es un string se normaliza
|
||||||
|
if item.language != '':
|
||||||
|
lang = True
|
||||||
|
simple_language = set_lang(item.language).upper()
|
||||||
|
else:
|
||||||
|
simple_language = ''
|
||||||
|
|
||||||
|
item.language = simple_language
|
||||||
|
|
||||||
|
# Damos formato al año si existiera y lo agregamos
|
||||||
|
# al titulo excepto que sea un episodio
|
||||||
|
if info and info.get("year", "") not in [""," "] and item.contentType != 'episode' and not info['season']:
|
||||||
|
try:
|
||||||
|
year = '%s' % set_color(info['year'], 'year')
|
||||||
|
item.title = item.title = '%s %s' % (item.title, year)
|
||||||
|
except:
|
||||||
|
logger.debug('infoLabels: %s'%info)
|
||||||
|
|
||||||
|
# Damos formato al puntaje si existiera y lo agregamos al titulo
|
||||||
|
if info and info['rating'] and info['rating']!='0.0' and not info['season']:
|
||||||
|
|
||||||
|
# Se normaliza el puntaje del rating
|
||||||
|
|
||||||
|
rating_value = check_rating(info['rating'])
|
||||||
|
|
||||||
|
# Asignamos el color dependiendo el puntaje, malo, bueno, muy bueno, en caso de que exista
|
||||||
|
|
||||||
|
if rating_value:
|
||||||
|
value = float(rating_value)
|
||||||
|
if value <= 3:
|
||||||
|
color_rating = 'rating_1'
|
||||||
|
elif value > 3 and value <= 7:
|
||||||
|
color_rating = 'rating_2'
|
||||||
|
else:
|
||||||
|
color_rating = 'rating_3'
|
||||||
|
|
||||||
|
rating = '%s' % rating_value
|
||||||
|
else:
|
||||||
|
rating = ''
|
||||||
|
color_rating = 'otro'
|
||||||
|
item.title = '%s %s' % (item.title, set_color(rating, color_rating))
|
||||||
|
|
||||||
|
# Damos formato a la calidad si existiera y lo agregamos al titulo
|
||||||
|
if item.quality:
|
||||||
|
quality = item.quality.strip()
|
||||||
|
item.title = '%s %s' % (item.title, set_color(quality, 'quality'))
|
||||||
|
else:
|
||||||
|
quality = ''
|
||||||
|
|
||||||
|
# Damos formato al idioma si existiera y lo agregamos al titulo
|
||||||
|
if lang:
|
||||||
|
item.title = add_languages(item.title, simple_language)
|
||||||
|
|
||||||
|
# Formato para actualizaciones de series en la videoteca sobreescribe los colores anteriores
|
||||||
|
|
||||||
|
if item.channel=='videolibrary' and item.context!='':
|
||||||
|
if item.action=='get_seasons':
|
||||||
|
if 'Desactivar' in item.context[1]['title']:
|
||||||
|
item.title= '%s' % (set_color(item.title, 'update'))
|
||||||
|
if 'Activar' in item.context[1]['title']:
|
||||||
|
item.title= '%s' % (set_color(item.title, 'no_update'))
|
||||||
|
|
||||||
|
# Damos formato al servidor si existiera
|
||||||
|
if item.server:
|
||||||
|
server = '%s' % set_color(item.server.strip().capitalize(), 'server')
|
||||||
|
|
||||||
|
# Compureba si estamos en findvideos, y si hay server, si es asi no se muestra el
|
||||||
|
# titulo sino el server, en caso contrario se muestra el titulo normalmente.
|
||||||
|
|
||||||
|
#logger.debug('item.title antes de server: %s'%item.title)
|
||||||
|
if item.action != 'play' and item.server:
|
||||||
|
item.title ='%s %s'%(item.title, server.strip())
|
||||||
|
elif item.action == 'play' and item.server:
|
||||||
|
if item.quality == 'default':
|
||||||
|
quality = ''
|
||||||
|
#logger.debug('language_color: %s'%language_color)
|
||||||
|
item.title = '%s %s' % (server, set_color(quality,'quality'))
|
||||||
|
if lang:
|
||||||
|
item.title = add_languages(item.title, simple_language)
|
||||||
|
#logger.debug('item.title: %s' % item.title)
|
||||||
|
else:
|
||||||
|
item.title = '%s' % item.title
|
||||||
|
#logger.debug('item.title despues de server: %s' % item.title)
|
||||||
|
elif 'library' in item.action:
|
||||||
|
item.title = '%s' % set_color(item.title, 'library')
|
||||||
|
elif item.action == '' and item.title !='':
|
||||||
|
item.title='**- %s -**'%item.title
|
||||||
|
else:
|
||||||
|
item.title = '%s' % set_color(item.title, 'otro')
|
||||||
|
#logger.debug('antes de salir %s' % item.title)
|
||||||
|
if visto:
|
||||||
|
try:
|
||||||
|
check = u'\u221a'
|
||||||
|
|
||||||
|
title = '[B][COLOR limegreen][%s][/COLOR][/B] %s' % (check, item.title.decode('utf-8'))
|
||||||
|
item.title = title.encode('utf-8')
|
||||||
|
except:
|
||||||
|
check = 'v'
|
||||||
|
title = '[B][COLOR limegreen][%s][/COLOR][/B] %s' % (check, item.title.decode('utf-8'))
|
||||||
|
item.title = title.encode('utf-8')
|
||||||
|
|
||||||
|
return item
|
||||||
|
|
||||||
|
def thumbnail_type(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
# Se comprueba que tipo de thumbnail se utilizara en findvideos,
|
||||||
|
# Poster o Logo del servidor
|
||||||
|
|
||||||
|
thumb_type = config.get_setting('video_thumbnail_type')
|
||||||
|
#logger.debug('thumb_type: %s' % thumb_type)
|
||||||
|
info = item.infoLabels
|
||||||
|
#logger.debug('item.thumbnail: %s'%item.thumbnail)
|
||||||
|
|
||||||
|
if info['thumbnail'] !='':
|
||||||
|
item.contentThumbnail = info['thumbnail']
|
||||||
|
else:
|
||||||
|
item.contentThumbnail = item.thumbnail
|
||||||
|
|
||||||
|
if item.action == 'play':
|
||||||
|
if thumb_type == 0:
|
||||||
|
if info and info['thumbnail'] != '':
|
||||||
|
item.thumbnail = info['thumbnail']
|
||||||
|
elif thumb_type == 1:
|
||||||
|
from core.servertools import get_server_parameters
|
||||||
|
#logger.debug('item.server: %s'%item.server)
|
||||||
|
server_parameters = get_server_parameters(item.server.lower())
|
||||||
|
item.thumbnail = server_parameters.get("thumbnail", "")
|
||||||
|
#logger.debug('thumbnail: %s' % item.thumb)
|
||||||
|
|
||||||
|
return item.thumbnail
|
||||||
|
|
||||||
|
|
||||||
|
from decimal import *
|
||||||
|
|
||||||
|
|
||||||
|
def check_rating(rating):
|
||||||
|
# logger.debug("\n\nrating %s" % rating)
|
||||||
|
|
||||||
|
def check_decimal_length(_rating):
|
||||||
|
"""
|
||||||
|
Dejamos que el float solo tenga un elemento en su parte decimal, "7.10" --> "7.1"
|
||||||
|
@param _rating: valor del rating
|
||||||
|
@type _rating: float
|
||||||
|
@return: devuelve el valor modificado si es correcto, si no devuelve None
|
||||||
|
@rtype: float|None
|
||||||
|
"""
|
||||||
|
# logger.debug("rating %s" % _rating)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# convertimos los deciamles p.e. 7.1
|
||||||
|
return "%.1f" % round(_rating, 1)
|
||||||
|
except Exception, ex_dl:
|
||||||
|
template = "An exception of type %s occured. Arguments:\n%r"
|
||||||
|
message = template % (type(ex_dl).__name__, ex_dl.args)
|
||||||
|
logger.error(message)
|
||||||
|
return None
|
||||||
|
|
||||||
|
def check_range(_rating):
|
||||||
|
"""
|
||||||
|
Comprobamos que el rango de rating sea entre 0.0 y 10.0
|
||||||
|
@param _rating: valor del rating
|
||||||
|
@type _rating: float
|
||||||
|
@return: devuelve el valor si está dentro del rango, si no devuelve None
|
||||||
|
@rtype: float|None
|
||||||
|
"""
|
||||||
|
# logger.debug("rating %s" % _rating)
|
||||||
|
# fix para comparacion float
|
||||||
|
dec = Decimal(_rating)
|
||||||
|
if 0.0 <= dec <= 10.0:
|
||||||
|
# logger.debug("estoy en el rango!")
|
||||||
|
return _rating
|
||||||
|
else:
|
||||||
|
# logger.debug("NOOO estoy en el rango!")
|
||||||
|
return None
|
||||||
|
|
||||||
|
def convert_float(_rating):
|
||||||
|
try:
|
||||||
|
return float(_rating)
|
||||||
|
except ValueError, ex_ve:
|
||||||
|
template = "An exception of type %s occured. Arguments:\n%r"
|
||||||
|
message = template % (type(ex_ve).__name__, ex_ve.args)
|
||||||
|
logger.error(message)
|
||||||
|
return None
|
||||||
|
|
||||||
|
if type(rating) != float:
|
||||||
|
# logger.debug("no soy float")
|
||||||
|
if type(rating) == int:
|
||||||
|
# logger.debug("soy int")
|
||||||
|
rating = convert_float(rating)
|
||||||
|
elif type(rating) == str:
|
||||||
|
# logger.debug("soy str")
|
||||||
|
|
||||||
|
rating = rating.replace("<", "")
|
||||||
|
rating = convert_float(rating)
|
||||||
|
|
||||||
|
if rating is None:
|
||||||
|
# logger.debug("error al convertir str, rating no es un float")
|
||||||
|
# obtenemos los valores de numericos
|
||||||
|
new_rating = scrapertools.find_single_match(rating, "(\d+)[,|:](\d+)")
|
||||||
|
if len(new_rating) > 0:
|
||||||
|
rating = convert_float("%s.%s" % (new_rating[0], new_rating[1]))
|
||||||
|
|
||||||
|
else:
|
||||||
|
logger.error("no se que soy!!")
|
||||||
|
# obtenemos un valor desconocido no devolvemos nada
|
||||||
|
return None
|
||||||
|
|
||||||
|
if rating:
|
||||||
|
rating = check_decimal_length(rating)
|
||||||
|
rating = check_range(rating)
|
||||||
|
|
||||||
|
return rating
|
||||||
@@ -51,6 +51,58 @@
|
|||||||
<category label="Opciones Visuales">
|
<category label="Opciones Visuales">
|
||||||
<setting id="icon_set" type="labelenum" label="Set de iconos" values="default|dark" default="default"/>
|
<setting id="icon_set" type="labelenum" label="Set de iconos" values="default|dark" default="default"/>
|
||||||
<setting id="infoplus_set" type="labelenum" label="Opción visual Infoplus" values="Sin animación|Con animación" default="Sin animación"/>
|
<setting id="infoplus_set" type="labelenum" label="Opción visual Infoplus" values="Sin animación|Con animación" default="Sin animación"/>
|
||||||
|
<setting id="video_thumbnail_type" type="enum" label="Thumbnail para videos" values="Poster|Logo del servidor" default="0"/>
|
||||||
|
<setting label="Opciones para Titulos" type="lsep"/>
|
||||||
|
<setting id="unify" type="bool" label="Titulos Inteligentes" default="false"/>
|
||||||
|
<setting id="title_color" type="bool" label="Colores Personalizados" default="false" visible="eq(-1,true)"/>
|
||||||
|
<setting id="movie_color" type="labelenum" label="Pelicula"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-1,true)+eq(-2,true)"/>
|
||||||
|
<setting id="tvshow_color" type="labelenum" label="Serie"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-2,true)+eq(-3,true)"/>
|
||||||
|
<setting id="year_color" type="labelenum" label="Año"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-3,true)+eq(-4,true)"/>
|
||||||
|
<setting id="rating_1_color" type="labelenum" label="Valoracion Baja"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-4,true)+eq(-5,true)"/>
|
||||||
|
<setting id="rating_2_color" type="labelenum" label="Valoracion Media"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-5,true)+eq(-6,true)"/>
|
||||||
|
<setting id="rating_3_color" type="labelenum" label="Valoracion Alta"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-6,true)+eq(-7,true)"/>
|
||||||
|
<setting id="quality_color" type="labelenum" label="Calidad"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-7,true)+eq(-8,true)"/>
|
||||||
|
<setting id="cast_color" type="labelenum" label="Castellano"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-8,true)+eq(-9,true)"/>
|
||||||
|
<setting id="lat_color" type="labelenum" label="Latino"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-9,true)+eq(-10,true)"/>
|
||||||
|
<setting id="vose_color" type="labelenum" label="VOSE (Versión Original Subtitulado Español)"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-10,true)+eq(-11,true)"/>
|
||||||
|
<setting id="vos_color" type="labelenum" label="VOS (Versión Original Subtitulado)"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-11,true)+eq(-12,true)"/>
|
||||||
|
<setting id="vo_color" type="labelenum" label="VO (Versión Original)"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-12,true)+eq(-13,true)"/>
|
||||||
|
<setting id="server_color" type="labelenum" label="Servidores"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-13,true)+eq(-14,true)"/>
|
||||||
|
<setting id="library_color" type="labelenum" label="Añadir a Videoteca"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-14,true)+eq(-15,true)"/>
|
||||||
|
<setting id="update_color" type="labelenum" label="Videoteca (Actualizar serie)"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-15,true)+eq(-16,true)"/>
|
||||||
|
<setting id="no_update_color" type="labelenum" label="Videoteca (No actualizar serie)"
|
||||||
|
lvalues="[COLOR white]white[/COLOR]|[COLOR cyan]cyan[/COLOR]|[COLOR deepskyblue]deepskyblue[/COLOR]|[COLOR firebrick]firebrick[/COLOR]|[COLOR gold]gold[/COLOR]|[COLOR goldenrod]goldenrod[/COLOR]|[COLOR hotpink]hotpink[/COLOR]|[COLOR limegreen]limegreen[/COLOR]|[COLOR orange]orange[/COLOR]|[COLOR orchid]orchid[/COLOR]|[COLOR red]red[/COLOR]|[COLOR salmon]salmon[/COLOR]|[COLOR yellow]yellow[/COLOR]"
|
||||||
|
default="white" visible="eq(-16,true)+eq(-17,true)"/>
|
||||||
</category>
|
</category>
|
||||||
<category label="Otros">
|
<category label="Otros">
|
||||||
<setting label="Info de películas/series en menú contextual" type="lsep"/>
|
<setting label="Info de películas/series en menú contextual" type="lsep"/>
|
||||||
|
|||||||
@@ -1,73 +0,0 @@
|
|||||||
{
|
|
||||||
"active": true,
|
|
||||||
"find_videos": {
|
|
||||||
"ignore_urls": [
|
|
||||||
"http://allmyvideos.net/embed-theme.html",
|
|
||||||
"http://allmyvideos.net/embed-jquery.html",
|
|
||||||
"http://allmyvideos.net/embed-s.html",
|
|
||||||
"http://allmyvideos.net/embed-images.html",
|
|
||||||
"http://allmyvideos.net/embed-faq.html",
|
|
||||||
"http://allmyvideos.net/embed-embed.html",
|
|
||||||
"http://allmyvideos.net/embed-ri.html",
|
|
||||||
"http://allmyvideos.net/embed-d.html",
|
|
||||||
"http://allmyvideos.net/embed-css.html",
|
|
||||||
"http://allmyvideos.net/embed-js.html",
|
|
||||||
"http://allmyvideos.net/embed-player.html",
|
|
||||||
"http://allmyvideos.net/embed-cgi.html",
|
|
||||||
"http://allmyvideos.net/embed-i.html",
|
|
||||||
"http://allmyvideos.net/images",
|
|
||||||
"http://allmyvideos.net/theme",
|
|
||||||
"http://allmyvideos.net/xupload",
|
|
||||||
"http://allmyvideos.net/s",
|
|
||||||
"http://allmyvideos.net/js",
|
|
||||||
"http://allmyvideos.net/jquery",
|
|
||||||
"http://allmyvideos.net/login",
|
|
||||||
"http://allmyvideos.net/make",
|
|
||||||
"http://allmyvideos.net/i",
|
|
||||||
"http://allmyvideos.net/faq",
|
|
||||||
"http://allmyvideos.net/tos",
|
|
||||||
"http://allmyvideos.net/premium",
|
|
||||||
"http://allmyvideos.net/checkfiles",
|
|
||||||
"http://allmyvideos.net/privacy",
|
|
||||||
"http://allmyvideos.net/refund",
|
|
||||||
"http://allmyvideos.net/links",
|
|
||||||
"http://allmyvideos.net/contact"
|
|
||||||
],
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"pattern": "allmyvideos.net/(?:embed-)?([a-z0-9]+)",
|
|
||||||
"url": "http://allmyvideos.net/\\1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"free": true,
|
|
||||||
"id": "allmyvideos",
|
|
||||||
"name": "allmyvideos",
|
|
||||||
"settings": [
|
|
||||||
{
|
|
||||||
"default": false,
|
|
||||||
"enabled": true,
|
|
||||||
"id": "black_list",
|
|
||||||
"label": "Incluir en lista negra",
|
|
||||||
"type": "bool",
|
|
||||||
"visible": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"default": 0,
|
|
||||||
"enabled": true,
|
|
||||||
"id": "favorites_servers_list",
|
|
||||||
"label": "Incluir en lista de favoritos",
|
|
||||||
"lvalues": [
|
|
||||||
"No",
|
|
||||||
"1",
|
|
||||||
"2",
|
|
||||||
"3",
|
|
||||||
"4",
|
|
||||||
"5"
|
|
||||||
],
|
|
||||||
"type": "list",
|
|
||||||
"visible": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"thumbnail": "server_allmyvideos.png"
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from core import scrapertools
|
|
||||||
from platformcode import logger
|
|
||||||
|
|
||||||
|
|
||||||
def test_video_exists(page_url):
|
|
||||||
logger.info("(page_url='%s')" % page_url)
|
|
||||||
|
|
||||||
# No existe / borrado: http://allmyvideos.net/8jcgbrzhujri
|
|
||||||
data = scrapertools.cache_page("http://anonymouse.org/cgi-bin/anon-www.cgi/" + page_url)
|
|
||||||
if "<b>File Not Found</b>" in data or "<b>Archivo no encontrado</b>" in data or '<b class="err">Deleted' in data \
|
|
||||||
or '<b class="err">Removed' in data or '<font class="err">No such' in data:
|
|
||||||
return False, "No existe o ha sido borrado de allmyvideos"
|
|
||||||
|
|
||||||
return True, ""
|
|
||||||
|
|
||||||
|
|
||||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
|
||||||
logger.info("url=%s" % page_url)
|
|
||||||
|
|
||||||
# Normaliza la URL
|
|
||||||
videoid = scrapertools.get_match(page_url, "http://allmyvideos.net/([a-z0-9A-Z]+)")
|
|
||||||
page_url = "http://amvtv.net/embed-" + videoid + "-728x400.html"
|
|
||||||
data = scrapertools.cachePage(page_url)
|
|
||||||
if "Access denied" in data:
|
|
||||||
geobloqueo = True
|
|
||||||
else:
|
|
||||||
geobloqueo = False
|
|
||||||
|
|
||||||
if geobloqueo:
|
|
||||||
# url = "http://www.anonymousbrowser.xyz/hide.php"
|
|
||||||
# post = "go=%s" % page_url
|
|
||||||
url = "http://www.videoproxy.co/hide.php"
|
|
||||||
post = "go=%s" % page_url
|
|
||||||
location = scrapertools.get_header_from_response(url, post=post, header_to_get="location")
|
|
||||||
# url = "http://www.anonymousbrowser.xyz/" + location
|
|
||||||
url = "http://www.videoproxy.co/" + location
|
|
||||||
data = scrapertools.cachePage(url)
|
|
||||||
|
|
||||||
# Extrae la URL
|
|
||||||
media_url = scrapertools.find_single_match(data, '"file" : "([^"]+)",')
|
|
||||||
|
|
||||||
video_urls = []
|
|
||||||
|
|
||||||
if media_url != "":
|
|
||||||
if geobloqueo:
|
|
||||||
# url = "http://www.anonymousbrowser.xyz/hide.php"
|
|
||||||
url = "http://www.videoproxy.co/hide.php"
|
|
||||||
post = "go=%s" % media_url
|
|
||||||
location = scrapertools.get_header_from_response(url, post=post, header_to_get="location")
|
|
||||||
# media_url = "http://www.anonymousbrowser.xyz/" + location + "&direct=false"
|
|
||||||
media_url = "http://www.videoproxy.co/" + location + "&direct=false"
|
|
||||||
else:
|
|
||||||
media_url += "&direct=false"
|
|
||||||
|
|
||||||
video_urls.append([scrapertools.get_filename_from_url(media_url)[-4:] + " [allmyvideos]", media_url])
|
|
||||||
|
|
||||||
for video_url in video_urls:
|
|
||||||
logger.info("%s - %s" % (video_url[0], video_url[1]))
|
|
||||||
|
|
||||||
return video_urls
|
|
||||||
@@ -13,21 +13,13 @@ from platformcode import config, logger
|
|||||||
def test_video_exists(page_url):
|
def test_video_exists(page_url):
|
||||||
logger.info("(page_url='%s')" % page_url)
|
logger.info("(page_url='%s')" % page_url)
|
||||||
|
|
||||||
data = httptools.downloadpage(page_url, cookies=False).data
|
|
||||||
if 'file was deleted' in data:
|
|
||||||
return False, "[FlashX] El archivo no existe o ha sido borrado"
|
|
||||||
elif 'File Not Found' in data:
|
|
||||||
return False, "[FlashX] El archivo no existe"
|
|
||||||
elif 'Video is processing now' in data:
|
|
||||||
return False, "[FlashX] El archivo se está procesando"
|
|
||||||
|
|
||||||
return True, ""
|
return True, ""
|
||||||
|
|
||||||
|
|
||||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||||
logger.info("url=" + page_url)
|
logger.info("url=" + page_url)
|
||||||
pfxfx = ""
|
pfxfx = ""
|
||||||
headers = {'Host': 'www.flashx.tv',
|
headers = {'Host': 'www.flashx.sx',
|
||||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36',
|
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36',
|
||||||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
||||||
'Accept-Language': 'en-US,en;q=0.5',
|
'Accept-Language': 'en-US,en;q=0.5',
|
||||||
@@ -35,11 +27,11 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
'Cookie': ''}
|
'Cookie': ''}
|
||||||
data = httptools.downloadpage(page_url, cookies=False).data
|
data = httptools.downloadpage(page_url, cookies=False).data
|
||||||
data = data.replace("\n","")
|
data = data.replace("\n","")
|
||||||
cgi_counter = scrapertools.find_single_match(data, """(?is)src=.(https://www.flashx.tv/counter.cgi.*?[^(?:'|")]+)""")
|
cgi_counter = scrapertools.find_single_match(data, """(?is)src=.(https://www.flashx.sx/counter.cgi.*?[^(?:'|")]+)""")
|
||||||
cgi_counter = cgi_counter.replace("%0A","").replace("%22","")
|
cgi_counter = cgi_counter.replace("%0A","").replace("%22","")
|
||||||
playnow = scrapertools.find_single_match(data, 'https://www.flashx.tv/dl[^"]+')
|
playnow = scrapertools.find_single_match(data, 'https://www.flashx.sx/dl[^"]+')
|
||||||
# Para obtener el f y el fxfx
|
# Para obtener el f y el fxfx
|
||||||
js_fxfx = "https://www." + scrapertools.find_single_match(data.replace("//","/"), """(?is)(flashx.tv/js\w+/c\w+.*?[^(?:'|")]+)""")
|
js_fxfx = "https://www." + scrapertools.find_single_match(data.replace("//","/"), """(?is)(flashx.sx/js\w+/c\w+.*?[^(?:'|")]+)""")
|
||||||
data_fxfx = httptools.downloadpage(js_fxfx).data
|
data_fxfx = httptools.downloadpage(js_fxfx).data
|
||||||
mfxfx = scrapertools.find_single_match(data_fxfx, 'get.*?({.*?})').replace("'","").replace(" ","")
|
mfxfx = scrapertools.find_single_match(data_fxfx, 'get.*?({.*?})').replace("'","").replace(" ","")
|
||||||
matches = scrapertools.find_multiple_matches(mfxfx, '(\w+):(\w+)')
|
matches = scrapertools.find_multiple_matches(mfxfx, '(\w+):(\w+)')
|
||||||
@@ -49,19 +41,20 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
logger.info("mfxfxfx2= %s" %pfxfx)
|
logger.info("mfxfxfx2= %s" %pfxfx)
|
||||||
if pfxfx == "":
|
if pfxfx == "":
|
||||||
pfxfx = "ss=yes&f=fail&fxfx=6"
|
pfxfx = "ss=yes&f=fail&fxfx=6"
|
||||||
coding_url = 'https://www.flashx.tv/flashx.php?%s' %pfxfx
|
coding_url = 'https://www.flashx.sx/flashx.php?%s' %pfxfx
|
||||||
# {f: 'y', fxfx: '6'}
|
# {f: 'y', fxfx: '6'}
|
||||||
flashx_id = scrapertools.find_single_match(data, 'name="id" value="([^"]+)"')
|
bloque = scrapertools.find_single_match(data, '(?s)Form method="POST" action(.*?)<!--')
|
||||||
fname = scrapertools.find_single_match(data, 'name="fname" value="([^"]+)"')
|
flashx_id = scrapertools.find_single_match(bloque, 'name="id" value="([^"]+)"')
|
||||||
hash_f = scrapertools.find_single_match(data, 'name="hash" value="([^"]+)"')
|
fname = scrapertools.find_single_match(bloque, 'name="fname" value="([^"]+)"')
|
||||||
imhuman = scrapertools.find_single_match(data, "value='([^']+)' name='imhuman'")
|
hash_f = scrapertools.find_single_match(bloque, 'name="hash" value="([^"]+)"')
|
||||||
|
imhuman = scrapertools.find_single_match(bloque, "value='([^']+)' name='imhuman'")
|
||||||
post = 'op=download1&usr_login=&id=%s&fname=%s&referer=&hash=%s&imhuman=%s' % (
|
post = 'op=download1&usr_login=&id=%s&fname=%s&referer=&hash=%s&imhuman=%s' % (
|
||||||
flashx_id, urllib.quote(fname), hash_f, imhuman)
|
flashx_id, urllib.quote(fname), hash_f, imhuman)
|
||||||
wait_time = scrapertools.find_single_match(data, "<span id='xxc2'>(\d+)")
|
wait_time = scrapertools.find_single_match(data, "<span id='xxc2'>(\d+)")
|
||||||
|
|
||||||
headers['Referer'] = "https://www.flashx.tv/"
|
headers['Referer'] = "https://www.flashx.sx/"
|
||||||
headers['Accept'] = "*/*"
|
headers['Accept'] = "*/*"
|
||||||
headers['Host'] = "www.flashx.tv"
|
headers['Host'] = "www.flashx.sx"
|
||||||
headers['X-Requested-With'] = 'XMLHttpRequest'
|
headers['X-Requested-With'] = 'XMLHttpRequest'
|
||||||
|
|
||||||
# Obligatorio descargar estos 2 archivos, porque si no, muestra error
|
# Obligatorio descargar estos 2 archivos, porque si no, muestra error
|
||||||
@@ -76,7 +69,6 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
headers.pop('X-Requested-With')
|
headers.pop('X-Requested-With')
|
||||||
headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
||||||
data = httptools.downloadpage(playnow, post).data
|
data = httptools.downloadpage(playnow, post).data
|
||||||
|
|
||||||
# Si salta aviso, se carga la pagina de comprobacion y luego la inicial
|
# Si salta aviso, se carga la pagina de comprobacion y luego la inicial
|
||||||
# LICENSE GPL3, de alfa-addon: https://github.com/alfa-addon/ ES OBLIGATORIO AÑADIR ESTAS LÍNEAS
|
# LICENSE GPL3, de alfa-addon: https://github.com/alfa-addon/ ES OBLIGATORIO AÑADIR ESTAS LÍNEAS
|
||||||
if "You try to access this video with Kodi" in data:
|
if "You try to access this video with Kodi" in data:
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
page_url = "http://www.youtube.com/watch?v=%s" % page_url
|
page_url = "http://www.youtube.com/watch?v=%s" % page_url
|
||||||
logger.info(" page_url->'%s'" % page_url)
|
logger.info(" page_url->'%s'" % page_url)
|
||||||
|
|
||||||
video_id = scrapertools.find_single_match(page_url, 'v=([A-z0-9_-]{11})')
|
video_id = scrapertools.find_single_match(page_url, '(?:v=|embed/)([A-z0-9_-]{11})')
|
||||||
video_urls = extract_videos(video_id)
|
video_urls = extract_videos(video_id)
|
||||||
video_urls.reverse()
|
video_urls.reverse()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user