@@ -19,14 +19,20 @@ def mainlist(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
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, title="Peliculas",
|
||||||
itemlist.append(Item(channel = item.channel, action = "category", title = "Año de Estreno", url = host, cat = 'year', thumbnail = get_thumb('year', auto = True)))
|
action="movies", url=host, page=0, thumbnail=get_thumb('movies', 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="Año de Estreno",
|
||||||
itemlist.append(Item(channel = item.channel, action = "category", title = "Calidad", url = host, cat = 'quality', thumbnail = get_thumb("quality", auto = True)))
|
url=host, cat='year', page=0, thumbnail=get_thumb('year', 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, action="category", title="Géneros",
|
||||||
|
url=host, cat='genre', page=0, thumbnail=get_thumb('genres', auto=True)))
|
||||||
|
itemlist.append(Item(channel=item.channel, action="category", title="Calidad",
|
||||||
|
url=host, cat='quality', page=0, thumbnail=get_thumb("quality", auto=True)))
|
||||||
|
itemlist.append(Item(channel=item.channel, title="Buscar", action="search",
|
||||||
|
url=host + "?s=", page=0, thumbnail=get_thumb("search", auto=True)))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
logger.info()
|
logger.info()
|
||||||
texto = texto.replace(" ", "+")
|
texto = texto.replace(" ", "+")
|
||||||
@@ -34,62 +40,72 @@ def search(item, texto):
|
|||||||
if texto != '':
|
if texto != '':
|
||||||
return movies(item)
|
return movies(item)
|
||||||
|
|
||||||
|
|
||||||
def category(item):
|
def category(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.cat == 'genre':
|
if item.cat == 'genre':
|
||||||
data = scrapertools.find_single_match(data, '<h3>Géneros <span class="icon-sort">.*?</ul>')
|
data = scrapertools.find_single_match(
|
||||||
|
data, '<h3>Géneros <span class="icon-sort">.*?</ul>')
|
||||||
patron = '<li class="cat-item cat-item.*?<a href="([^"]+)" >([^<]+)<'
|
patron = '<li class="cat-item cat-item.*?<a href="([^"]+)" >([^<]+)<'
|
||||||
elif item.cat == 'year':
|
elif item.cat == 'year':
|
||||||
data = scrapertools.find_single_match(data, '<h3>Año de estreno.*?</div>')
|
data = scrapertools.find_single_match(
|
||||||
|
data, '<h3>Año de estreno.*?</div>')
|
||||||
patron = 'li><a href="([^"]+)">([^<]+).*?<'
|
patron = 'li><a href="([^"]+)">([^<]+).*?<'
|
||||||
elif item.cat == 'quality':
|
elif item.cat == 'quality':
|
||||||
data = scrapertools.find_single_match(data, '<h3>Calidad.*?</div>')
|
data = scrapertools.find_single_match(data, '<h3>Calidad.*?</div>')
|
||||||
patron = 'li><a href="([^"]+)">([^<]+)<'
|
patron = 'li><a href="([^"]+)">([^<]+)<'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
for scrapedurl, scrapedtitle in matches:
|
for scrapedurl, scrapedtitle in matches:
|
||||||
itemlist.append(Item(channel = item.channel, action = 'movies', title =scrapedtitle, url = scrapedurl, type = 'cat', first = 0))
|
itemlist.append(Item(channel=item.channel, action='movies',
|
||||||
|
title=scrapedtitle, url=scrapedurl, type='cat', page=0))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def movies(item):
|
def movies(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)
|
||||||
patron = '<div id="mt.+?href="([^"]+)".+?'
|
patron = '<div id="mt.+?href="([^"]+)".+?'
|
||||||
patron += '<img src="([^"]+)" alt="([^"]+)".+?'
|
patron += '<img src="([^"]+)" alt="([^"]+)".+?'
|
||||||
patron += '<span class="ttx">([^<]+).*?'
|
patron += '<span class="ttx">([^<]+).*?'
|
||||||
patron += 'class="year">([^<]+).+?class="calidad2">([^<]+)<'
|
patron += 'class="year">([^<]+).+?class="calidad2">([^<]+)<'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
for scrapedurl, img, scrapedtitle, resto, year, quality in matches:
|
for scrapedurl, img, scrapedtitle, resto, year, quality in matches[item.page:item.page + 30]:
|
||||||
scrapedtitle = re.sub(r'\d{4}|[()]','', scrapedtitle)
|
scrapedtitle = re.sub(r' \((\d+)\)', '', scrapedtitle)
|
||||||
plot = scrapertools.htmlclean(resto).strip()
|
plot = scrapertools.htmlclean(resto).strip()
|
||||||
title = ' %s [COLOR red][%s][/COLOR]' % (scrapedtitle, quality)
|
title = ' %s [COLOR red][%s][/COLOR]' % (scrapedtitle, quality)
|
||||||
itemlist.append(Item(channel = item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
title = title,
|
title=title,
|
||||||
url = scrapedurl,
|
url=scrapedurl,
|
||||||
action = "findvideos",
|
action="findvideos",
|
||||||
plot = plot,
|
plot=plot,
|
||||||
thumbnail = img,
|
thumbnail=img,
|
||||||
contentTitle = scrapedtitle,
|
contentTitle=scrapedtitle,
|
||||||
contentType = "movie",
|
contentType="movie",
|
||||||
quality = quality,
|
quality=quality,
|
||||||
infoLabels = {'year': year}))
|
infoLabels={'year': year}))
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb = True)
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
#Paginacion
|
# Paginacion
|
||||||
matches = re.compile('class="respo_pag"><div class="pag.*?<a href="([^"]+)" >Siguiente</a><', re.DOTALL).findall(data)
|
if item.page + 30 < len(matches):
|
||||||
if matches:
|
itemlist.append(item.clone(page=item.page + 30, title=">> Siguiente"))
|
||||||
url = urlparse.urljoin(item.url, matches[0])
|
else:
|
||||||
itemlist.append(Item(channel = item.channel, action = "movies", title = "Página siguiente >>", url = url))
|
next_page = scrapertools.find_single_match(
|
||||||
|
data, 'class="respo_pag"><div class="pag.*?<a href="([^"]+)" >Siguiente</a><')
|
||||||
|
if next_page:
|
||||||
|
itemlist.append(item.clone(
|
||||||
|
url=next_page, page=0, title=">> Siguiente"))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(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)
|
||||||
patron = '<div id="div.*?<div class="movieplay".*?(?:iframe.*?src|IFRAME SRC)="([^&]+)&'
|
patron = '<div id="div.*?<div class="movieplay".*?(?:iframe.*?src|IFRAME SRC)="([^&]+)&'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
for link in matches:
|
for link in matches:
|
||||||
@@ -110,14 +126,16 @@ def findvideos(item):
|
|||||||
id_type = 'ed'
|
id_type = 'ed'
|
||||||
ir_type = 'er'
|
ir_type = 'er'
|
||||||
id = scrapertools.find_single_match(link, '%s=(.*)' % id_type)
|
id = scrapertools.find_single_match(link, '%s=(.*)' % id_type)
|
||||||
base_link = scrapertools.find_single_match(link, '(.*?)%s=' % id_type)
|
base_link = scrapertools.find_single_match(
|
||||||
|
link, '(.*?)%s=' % id_type)
|
||||||
ir = id[::-1]
|
ir = id[::-1]
|
||||||
referer = base_link+'%s=%s&/' % (id_type, ir)
|
referer = base_link+'%s=%s&/' % (id_type, ir)
|
||||||
video_data = httptools.downloadpage('%s%s=%s' % (base_link, ir_type, ir), headers={'Referer':referer},
|
video_data = httptools.downloadpage('%s%s=%s' % (base_link, ir_type, ir), headers={'Referer': referer},
|
||||||
follow_redirects=False)
|
follow_redirects=False)
|
||||||
url = video_data.headers['location']
|
url = video_data.headers['location']
|
||||||
title = '%s'
|
title = '%s'
|
||||||
new_item = Item(channel=item.channel, title=title, url=url, action='play', language = '', infoLabels=item.infoLabels)
|
new_item = Item(channel=item.channel, title=title, url=url,
|
||||||
|
action='play', language='', infoLabels=item.infoLabels)
|
||||||
itemlist.append(new_item)
|
itemlist.append(new_item)
|
||||||
else:
|
else:
|
||||||
patron = '<div id="div.*?<div class="movieplay".*?(?:iframe.*?src|IFRAME SRC)="([^"]+)"'
|
patron = '<div id="div.*?<div class="movieplay".*?(?:iframe.*?src|IFRAME SRC)="([^"]+)"'
|
||||||
@@ -125,14 +143,16 @@ def findvideos(item):
|
|||||||
for link in matches:
|
for link in matches:
|
||||||
url = link
|
url = link
|
||||||
title = '%s'
|
title = '%s'
|
||||||
new_item = Item(channel=item.channel, title=title, url=url, action='play', language = '', infoLabels=item.infoLabels)
|
new_item = Item(channel=item.channel, title=title, url=url,
|
||||||
|
action='play', language='', infoLabels=item.infoLabels)
|
||||||
itemlist.append(new_item)
|
itemlist.append(new_item)
|
||||||
itemlist = servertools.get_servers_itemlist(itemlist, lambda x: x.title % x.server.capitalize())
|
itemlist = servertools.get_servers_itemlist(
|
||||||
|
itemlist, lambda x: x.title % x.server.capitalize())
|
||||||
if itemlist:
|
if itemlist:
|
||||||
if config.get_videolibrary_support():
|
if config.get_videolibrary_support():
|
||||||
itemlist.append(Item(channel = item.channel, action = ""))
|
itemlist.append(Item(channel=item.channel, action=""))
|
||||||
itemlist.append(Item(channel=item.channel, title="Añadir a la videoteca", text_color="green",
|
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,
|
action="add_pelicula_to_library", url=item.url, thumbnail=item.thumbnail,
|
||||||
contentTitle = item.contentTitle
|
contentTitle=item.contentTitle
|
||||||
))
|
))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
Reference in New Issue
Block a user