fix varios
This commit is contained in:
@@ -4,6 +4,7 @@ import re
|
||||
import urlparse
|
||||
import urllib
|
||||
|
||||
from core import tmdb
|
||||
from core import servertools
|
||||
from core import httptools
|
||||
from core import scrapertools
|
||||
@@ -11,7 +12,7 @@ from core.item import Item
|
||||
from platformcode import config, logger
|
||||
from channelselector import get_thumb
|
||||
|
||||
host="http://maxipelis24.com"
|
||||
host = "http://maxipelis24.com"
|
||||
|
||||
|
||||
def mainlist(item):
|
||||
@@ -19,11 +20,11 @@ def mainlist(item):
|
||||
|
||||
itemlist = []
|
||||
|
||||
itemlist.append(Item(channel=item.channel, title="peliculas", action="movies", url=host, thumbnail=get_thumb('movies', auto=True)))
|
||||
itemlist.append(Item(channel=item.channel, action="category", title="Año de Estreno", url=host, cat='year', thumbnail=get_thumb('year', auto=True)))
|
||||
itemlist.append(Item(channel=item.channel, action="category", title="Géneros", url=host, cat='genre', thumbnail=get_thumb('genres', auto=True)))
|
||||
itemlist.append(Item(channel=item.channel, action="category", title="Calidad", url=host, cat='quality', thumbnail=get_thumb("quality", auto=True)))
|
||||
itemlist.append(Item(channel=item.channel, title="Buscar", action="search", url=host+"?s=", thumbnail=get_thumb("search", auto=True)))
|
||||
itemlist.append(Item(channel = item.channel, title = "peliculas", action = "movies", url = host, thumbnail = get_thumb('movies', auto = True)))
|
||||
itemlist.append(Item(channel = item.channel, action = "category", title = "Año de Estreno", url = host, cat = 'year', thumbnail = get_thumb('year', auto = True)))
|
||||
itemlist.append(Item(channel = item.channel, action = "category", title = "Géneros", url = host, cat = 'genre', thumbnail = get_thumb('genres', auto = True)))
|
||||
itemlist.append(Item(channel = item.channel, action = "category", title = "Calidad", url = host, cat = 'quality', thumbnail = get_thumb("quality", auto = True)))
|
||||
itemlist.append(Item(channel = item.channel, title = "Buscar", action = "search", url = host + "?s=", thumbnail = get_thumb("search", auto = True)))
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -51,8 +52,8 @@ def category(item):
|
||||
patron = 'li><a href="([^"]+)">([^<]+)<'
|
||||
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
for scrapedurl , scrapedtitle in matches:
|
||||
itemlist.append(Item(channel=item.channel, action='movies', title=scrapedtitle, url=scrapedurl, type='cat', first=0))
|
||||
for scrapedurl, scrapedtitle in matches:
|
||||
itemlist.append(Item(channel = item.channel, action = 'movies', title =scrapedtitle, url = scrapedurl, type = 'cat', first = 0))
|
||||
return itemlist
|
||||
|
||||
def movies(item):
|
||||
@@ -70,56 +71,60 @@ def movies(item):
|
||||
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
for scrapedurl, img, scrapedtitle, ranking, resto, year, quality in matches:
|
||||
scrapedtitle = re.sub(r'\d{4}|[()]','', scrapedtitle)
|
||||
plot = scrapertools.htmlclean(resto).strip()
|
||||
title = '%s [COLOR yellow](%s)[/COLOR] [COLOR red][%s][/COLOR]'% (scrapedtitle, ranking, quality)
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=title,
|
||||
url=scrapedurl,
|
||||
action="findvideos",
|
||||
plot=plot,
|
||||
thumbnail=img,
|
||||
title = ' %s [COLOR yellow](%s)[/COLOR] [COLOR red][%s][/COLOR]' % (scrapedtitle, ranking, quality)
|
||||
itemlist.append(Item(channel = item.channel,
|
||||
title = title,
|
||||
url = scrapedurl,
|
||||
action = "findvideos",
|
||||
plot = plot,
|
||||
thumbnail = img,
|
||||
contentTitle = scrapedtitle,
|
||||
contentType = "movie",
|
||||
quality=quality))
|
||||
quality = quality,
|
||||
infoLabels = {'year': year}))
|
||||
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb = True)
|
||||
#Paginacion
|
||||
next_page = '<div class="pag_.*?href="([^"]+)">Siguiente<'
|
||||
matches = re.compile(next_page, re.DOTALL).findall(data)
|
||||
matches = re.compile('<div class="pag_.*?href="([^"]+)">Siguiente<', re.DOTALL).findall(data)
|
||||
if matches:
|
||||
url = urlparse.urljoin(item.url, matches[0])
|
||||
itemlist.append(Item(channel=item.channel, action = "movies", title = "Página siguiente >>",url = url))
|
||||
itemlist.append(Item(channel = item.channel, action = "movies", title = "Página siguiente >>", url = url))
|
||||
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
logger.info()
|
||||
itemlist=[]
|
||||
itemlist = []
|
||||
|
||||
data = httptools.downloadpage(item.url).data
|
||||
|
||||
data = scrapertools.get_match(data, '<div id="contenedor">(.*?)</div></div></div>')
|
||||
|
||||
# Busca los enlaces a los videos
|
||||
listavideos = servertools.findvideos(data)
|
||||
|
||||
for video in listavideos:
|
||||
videotitle = scrapertools.unescape(video[0])
|
||||
url = video[1]
|
||||
server = video[2]
|
||||
|
||||
itemlist.append(Item(channel=item.channel, action="play", server=server, title=videotitle, url=url,
|
||||
thumbnail=item.thumbnail, plot=item.plot, fulltitle=item.title, folder=False))
|
||||
|
||||
itemlist.append(Item(channel = item.channel,
|
||||
action = "play",
|
||||
server = server,
|
||||
title = videotitle,
|
||||
url = url,
|
||||
thumbnail = item.thumbnail,
|
||||
plot = item.plot,
|
||||
contentTitle = item.contentTitle,
|
||||
infoLabels = item.infoLabels,
|
||||
folder = False))
|
||||
# Opción "Añadir esta película a la biblioteca de KODI"
|
||||
if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos':
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
title='[COLOR yellow]Añadir esta pelicula a la videoteca[/COLOR]',
|
||||
url=item.url,
|
||||
action="add_pelicula_to_library",
|
||||
extra="findvideos",
|
||||
contentTitle=item.contentTitle,
|
||||
thumbnail=item.thumbnail
|
||||
))
|
||||
itemlist.append(Item(channel = item.channel,
|
||||
title = '[COLOR yellow]Añadir esta pelicula a la videoteca[/COLOR]',
|
||||
url = item.url,
|
||||
action = "add_pelicula_to_library",
|
||||
extra = "findvideos",
|
||||
contentTitle = item.contentTitle,
|
||||
thumbnail = item.thumbnail
|
||||
))
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -57,15 +57,15 @@ def mainlist(item):
|
||||
viewcontent='movies', thumbnail=thumbnail % 'generos',
|
||||
viewmode="movie_with_plot", url=host + 'generos/'))
|
||||
|
||||
itemlist.append(Item(channel=item.channel, title="Filtrar por Idiomas",
|
||||
itemlist.append(Item(channel=item.channel, title="[COLOR yellow][Filtrar por Idiomas][/COLOR]",
|
||||
fanart=fanart_host, folder=False, text_color=color3,
|
||||
text_blod=True, thumbnail=thumbnail % 'idiomas'))
|
||||
|
||||
itemlist.append(item.clone(title="Castellano", action="peliculas", text_blod=True,
|
||||
itemlist.append(item.clone(title=" Castellano", action="peliculas", text_blod=True,
|
||||
viewcontent='movies', thumbnail=thumbnail % 'castellano',
|
||||
viewmode="movie_with_plot", url=host + 'idioma/castellano/'))
|
||||
|
||||
itemlist.append(item.clone(title="Latino", action="peliculas", text_blod=True,
|
||||
itemlist.append(item.clone(title=" Latino", action="peliculas", text_blod=True,
|
||||
viewcontent='movies', thumbnail=thumbnail % 'latino',
|
||||
viewmode="movie_with_plot", url=host + 'idioma/latino/'))
|
||||
|
||||
@@ -173,15 +173,16 @@ def peliculas(item):
|
||||
data = re.sub(r"\n|\r|\t|\(.*?\)|\s{2}| ", "", data)
|
||||
patron_todas = '<div class="home-movies">(.*?)<footer>'
|
||||
data = scrapertools.find_single_match(data, patron_todas)
|
||||
patron = 'col-sm-5"><a href="([^"]+)".+?'
|
||||
patron += 'browse-movie-link-qd.*?>([^>]+)</.+?'
|
||||
patron += '<p>([^>]+)</p>.+?'
|
||||
patron += 'title one-line">([^>]+)</h2>.+?'
|
||||
patron = 'col-sm-5".*?href="([^"]+)".+?'
|
||||
patron += 'browse-movie-link-qd.*?>([^<]+)</.+?'
|
||||
patron += '<p>([^<]+)</p>.+?'
|
||||
patron += 'title one-line">([^<]+)</h2>.+?'
|
||||
patron += 'title-category">([^<]+)</span>.*?'
|
||||
patron += 'img-responsive" src="([^"]+)".*?'
|
||||
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
|
||||
for scrapedurl, quality, year, scrapedtitle, scrapedthumbnail in matches:
|
||||
for scrapedurl, quality, year, scrapedtitle, category, scrapedthumbnail in matches:
|
||||
if '/ ' in scrapedtitle:
|
||||
scrapedtitle = scrapedtitle.partition('/ ')[2]
|
||||
title = scrapedtitle
|
||||
@@ -192,7 +193,8 @@ def peliculas(item):
|
||||
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
action="findvideos",
|
||||
title=title, url=url,
|
||||
title="%s [COLOR yellowgreen][%s][/COLOR] [COLOR violet][%s][/COLOR]" % (title, category, year),
|
||||
url=url,
|
||||
quality=quality,
|
||||
thumbnail=thumbnail,
|
||||
contentTitle=contentTitle,
|
||||
|
||||
Reference in New Issue
Block a user