correcciones e info para los canales

This commit is contained in:
Unknown
2018-08-08 15:41:07 -03:00
parent f7135427e6
commit 86e85362c8
7 changed files with 344 additions and 247 deletions

View File

@@ -8,6 +8,7 @@
"banner": "https://imgur.com/B1IOAu4.png", "banner": "https://imgur.com/B1IOAu4.png",
"categories": [ "categories": [
"movie", "movie",
"tvshow" "tvshow",
"vos"
] ]
} }

View File

@@ -6,6 +6,7 @@ import urlparse
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 import tmdb
from core.item import Item from core.item import Item
from platformcode import config, logger from platformcode import config, logger
@@ -17,15 +18,21 @@ def mainlist(item):
itemlist = list() itemlist = list()
itemlist.append(Item(channel=item.channel, action="estrenos", title="Estrenos", url=host))
itemlist.append(Item(channel=item.channel, action="lista", title="Peliculas", itemlist.append(Item(channel=item.channel, action="lista", title="Peliculas",
url=urlparse.urljoin(host, "p/peliculas.html"))) url=urlparse.urljoin(host, "p/peliculas.html"), type='pl', first=0))
itemlist.append(Item(channel=item.channel, action="lista", title="Series", itemlist.append(Item(channel=item.channel, action="lista", title="Series",
url=urlparse.urljoin(host, "p/series.html"))) url=urlparse.urljoin(host, "p/series.html"), type='sr', first=0))
itemlist.append(Item(channel=item.channel, action="category", title="Orden Alfabético", url=host))
itemlist.append(Item(channel=item.channel, action="category", title="Géneros", url=host)) itemlist.append(Item(channel=item.channel, action="category", title="Géneros", url=host, cat='genre'))
itemlist.append(Item(channel=item.channel, action="category", title="Año de Estreno", url=host))
#itemlist.append(Item(channel=item.channel, title="Buscar", action="search", url=urlparse.urljoin(host, "/search?q="))) itemlist.append(Item(channel=item.channel, action="category", title="Calidad", url=host, cat='quality'))
itemlist.append(Item(channel=item.channel, action="category", title="Orden Alfabético", url=host, cat='abc'))
itemlist.append(Item(channel=item.channel, action="category", title="Año de Estreno", url=host, cat='year'))
itemlist.append(Item(channel=item.channel, title="Buscar", action="search", url=host+"/search?q="))
return itemlist return itemlist
@@ -34,155 +41,175 @@ def category(item):
itemlist = list() itemlist = list()
data = httptools.downloadpage(host).data data = httptools.downloadpage(host).data
data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) data = re.sub(r"\n|\r|\t|\s{2}| ", "", data)
patron_generos = "<h2 class='title'>"+item.title+"<\/h2><div class='.+?'><ul class='.+?'><(.+?)><\/ul><\/div>"
data_generos = scrapertools.find_single_match(data, patron_generos) if item.cat == 'abc':
patron = "<a href='(.+?)'>(.+?)<\/a>" data = scrapertools.find_single_match(data, '<span>Orden Alfabético</span>.*?</ul>')
matches = scrapertools.find_multiple_matches(data_generos, patron) elif item.cat == 'genre':
for scrapedurl, scrapedtitle in matches: data = scrapertools.find_single_match(data, '<span>Géneros</span>.*?</ul>')
elif item.cat == 'year':
data = scrapertools.find_single_match(data, '<span>Año</span>.*?</ul>')
elif item.cat == 'quality':
data = scrapertools.find_single_match(data, '<span>Calidad</span>.*?</ul>')
patron = "<li>([^<]+)<a href='([^']+)'>"
matches = re.compile(patron, re.DOTALL).findall(data)
for scrapedtitle, scrapedurl in matches:
if scrapedtitle != 'Próximas Películas': if scrapedtitle != 'Próximas Películas':
itemlist.append(item.clone(action='lista', title=scrapedtitle, url=host+scrapedurl)) itemlist.append(item.clone(action='lista', title=scrapedtitle, url=host+scrapedurl, type='cat', first=0))
return itemlist return itemlist
def search_results(item):
logger.info()
itemlist = []
data = httptools.downloadpage(item.url).data
data = re.sub(r"\n|\r|\t|\s{2}|&nbsp;", "", data)
patron = '<span class=.post-labels.>([^<]+)</span>.*?class="poster-bg" src="([^"]+)"/>.*?<h4>.*?'
patron +=">(\d{4})</a>.*?<h6>([^<]+)<a href='([^']+)"
matches = scrapertools.find_multiple_matches(data, patron)
for scrapedtype, scrapedthumbnail, scrapedyear, scrapedtitle ,scrapedurl in matches:
title="%s [%s]" % (scrapedtitle,scrapedyear)
new_item= Item(channel=item.channel, title=title, url=scrapedurl, thumbnail=scrapedthumbnail)
if scrapedtype.strip() == 'Serie':
new_item.contentSerieName = scrapedtitle
new_item.action = 'episodios'
new_item.type = 'sr'
else:
new_item.contentTitle = scrapedtitle
new_item.action = 'findvideos'
new_item.type = 'pl'
itemlist.append(new_item)
return itemlist
def search(item, texto): def search(item, texto):
logger.info() logger.info()
texto = texto.replace(" ", "+") texto = texto.replace(" ", "+")
item.url = item.url + texto item.url = item.url + texto
if texto != '': if texto != '':
return lista(item) return search_results(item)
def estrenos(item): def episodios(item):
logger.info()
itemlist = list()
data = httptools.downloadpage(host).data
data = re.sub(r"\n|\r|\t|\s{2}|&nbsp;", "", data)
patron_estre = "<div class='widget HTML' data-version='1' id='HTML9'><h2 class='title'>(.+?)<\/a><\/li><\/ul>"
data_estre = scrapertools.find_single_match(data, patron_estre)
patron = '<i class="([^"]+)"><\/i><div class="calidad">.+?' #serie o peli
patron +='<img src="([^"]+)"\/>' #scrapedthumbnail
patron +='<h4>([^"]+)<\/h4>.+?' #scrapedtitle
patron +='<a href="([^"]+)">' #scrapedurl
matches = scrapertools.find_multiple_matches(data_estre, patron)
for scrapedtype, scrapedthumbnail,scrapedtitle,scrapedurl in matches:
title = "%s [%s]" % (scrapedtitle, scrapedtype)
if scrapedtype == "pelicula":
itemlist.append(item.clone(title=title, url=host+scrapedurl, action="findvideos", extra=scrapedtype,
show=scrapedtitle, thumbnail=scrapedthumbnail, contentType="movie",
context=["buscar_trailer"]))
else:
itemlist.append(item.clone(title=title, url=host+scrapedurl, show=scrapedtitle,
thumbnail=scrapedthumbnail, action="capitulos"))
return itemlist
def capitulos(item):
logger.info() logger.info()
itemlist = list() itemlist = list()
data = httptools.downloadpage(item.url).data data = httptools.downloadpage(item.url).data
data = re.sub(r"\n|\r|\t|\s{2}|&nbsp;", "", data) data = re.sub(r"\n|\r|\t|\s{2}|&nbsp;", "", data)
patron_datos='<div class="output">(.+?)><\/section>' patron ='<div id="ep(\d+)" class="eps"> <section class="section-post online"><div class="player">.*?'
data_caps = scrapertools.find_single_match(data, patron_datos) patron += 'src="([^"]+)"/><a href="([^"]+)" target='
patron_caps='<img alt=".+?" src="(.+?)"\/><a href="http:\/\/bit.ly\/(.+?)"'
matches = scrapertools.find_multiple_matches(data_caps, patron_caps) matches = re.compile(patron,re.DOTALL).findall(data)
cap=0
for scrapedthumbnail,scrapedurl in matches: for scrapedepi, scrapedthumbnail, scrapedurl in matches:
link = scrapedurl url = scrapedurl
cap=cap+1 title="1x%s - %s" % (scrapedepi, item.contentSerieName)
link="http://www.trueurl.net/?q=http%3A%2F%2Fbit.ly%2F"+link+"&lucky=on&Uncloak=Find+True+URL" itemlist.append(item.clone(action='findvideos', title=title, url=url, thumbnail=scrapedthumbnail, type=item.type,
data_other = httptools.downloadpage(link).data infoLabels=item.infoLabels))
data_other = re.sub(r"\n|\r|\t|\s{2}|&nbsp;", "", data_other)
patron='<A title="http:\/\/privatelink.de\/\?(.+?)"'
url = scrapertools.find_single_match(data_other, patron)
title="%s%s - %s" % (title,str(cap).zfill(2),item.show)
itemlist.append(item.clone(action='findvideos', title=title,
url=url,show=item.show,thumbnail=scrapedthumbnail))
if config.get_videolibrary_support() and len(itemlist) > 0: if config.get_videolibrary_support() and len(itemlist) > 0:
itemlist.append(Item(channel=item.channel, title="[COLOR yellow]Añadir esta serie a la videoteca[/COLOR]", url=item.url, itemlist.append(Item(channel=item.channel, title="[COLOR yellow]Añadir esta serie a la videoteca[/COLOR]",
action="add_serie_to_library", extra="episodios", show=item.show)) url=item.url, action="add_serie_to_library", extra="episodios",
contentSerieName=item.contentSerieName))
return itemlist return itemlist
def bitly(item):
logger.info()
itemlist = list()
data = httptools.downloadpage(item.url).data
data = re.sub(r"\n|\r|\t|\s{2}|&nbsp;", "", data)
patron = '<a href="http:\/\/bit.ly\/(.+?)"'
link = scrapertools.find_single_match(data, patron)
link="http://www.trueurl.net/?q=http%3A%2F%2Fbit.ly%2F"+link+"&lucky=on&Uncloak=Find+True+URL"
data_other = httptools.downloadpage(link).data
data_other = re.sub(r"\n|\r|\t|\s{2}|&nbsp;", "", data_other)
patron='<A title="http:\/\/privatelink.de\/\?(.+?)"'
url = scrapertools.find_single_match(data_other, patron)
if item.contentType=="movie":
contentType="movie"
else:
contentType="serie"
item=(item.clone(action='findvideos',url=url,show=item.show, thumbnail=item.thumbnail, contentType=contentType))
return item
def lista(item): def lista(item):
logger.info() logger.info()
next = True
itemlist = [] itemlist = []
data = httptools.downloadpage(item.url).data data = httptools.downloadpage(item.url).data
data = re.sub(r"\n|\r|\t|\s{2}|&nbsp;", "", data) data = re.sub(r"\n|\r|\t|\s{2}|&nbsp;", "", data)
data = scrapertools.find_single_match(data, "itemprop='headline'>.*?</h2>.*?</ul>")
patron = '<i class="(.+?)"><\/i>' # scrapedtype
patron +='<div class="calidad">(.+?)<\/div>' # scrapedquality patron = '<span class="([^"]+)">.*?<figure class="poster-bg"><header><span>(\d{4})</span></header><img src="([^"]+)" />'
patron += '<img src="(.+?)"\/>' # scrapedthumbnail patron += '<footer>(.*?)</footer></figure><h6>([^<]+)</h6><a href="([^"]+)"></a>'
patron += '<h4>(.+?)<\/h4>' # scrapedtitle
patron += "<h5>(.+?)<\/h5>" # scrapedyear
patron += '<a href="(.+?)"' # scrapedurl
#patron += "<\/a>.+?<div class='item-snippet'>(.+?)<" # scrapedplot
if item.title!="Prueba":
pat='<div id="tab-1"><ul class="post-gallery">(.+?)<\/ul><\/div>'
data=scrapertools.find_single_match(data, pat)
matches = scrapertools.find_multiple_matches(data, patron) matches = scrapertools.find_multiple_matches(data, patron)
for scrapedtype,scrapedquality,scrapedthumbnail,scrapedtitle,scrapedyear,scrapedurl in matches:
first = int(item.first)
last = first + 19
if last > len(matches):
last = len(matches)
next = False
for scrapedtype, scrapedyear, scrapedthumbnail, scrapedquality, scrapedtitle ,scrapedurl in matches[first:last]:
patron_quality="<span>(.+?)</span>" patron_quality="<span>(.+?)</span>"
quality = scrapertools.find_multiple_matches(scrapedquality, patron_quality) quality = scrapertools.find_multiple_matches(scrapedquality, patron_quality)
qual="" qual=""
for calidad in quality: for calidad in quality:
qual=qual+"["+calidad+"] " qual=qual+"["+calidad+"] "
title="%s [%s] %s" % (scrapedtitle,scrapedyear,qual) title="%s [%s] %s" % (scrapedtitle,scrapedyear,qual)
if item.title =="Series": new_item= Item(channel=item.channel, title=title, url=host+scrapedurl, thumbnail=scrapedthumbnail,
itemlist.append(item.clone(title=title, url=host+scrapedurl, extra=scrapedtitle, plot=scrapedtitle, type=scrapedtype, infoLabels={'year':scrapedyear})
show=scrapedtitle, thumbnail=scrapedthumbnail, contentType="serie", action="capitulos")) if scrapedtype.strip() == 'sr':
elif scrapedtype != 'serie': new_item.contentSerieName = scrapedtitle
itemlist.append( new_item.action = 'episodios'
item.clone(title=title, url=host+scrapedurl, action="findvideos", extra=scrapedtype, plot=scrapedtitle, else:
show=scrapedtitle, thumbnail=scrapedthumbnail, contentType="movie", context=["buscar_trailer"])) new_item.contentTitle = scrapedtitle
new_item.action = 'findvideos'
# Paginacion if scrapedtype == item.type or item.type == 'cat':
patron_genero = '<h1>([^"]+)<\/h1>' itemlist.append(new_item)
genero = scrapertools.find_single_match(data, patron_genero)
if genero == "Romance" or genero == "Drama":
patron = "<a rel='nofollow' class=previouspostslink' href='([^']+)'>Siguiente "
else:
patron = "<span class='current'>.+?href='(.+?)'>"
next_page_url = scrapertools.find_single_match(data, patron) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
#pagination
url_next_page = item.url
first = last
if next:
itemlist.append(item.clone(title="Siguiente >>", url=url_next_page, action='lista', first=first))
if next_page_url != "":
item.url = next_page_url
itemlist.append(Item(channel=item.channel, action="lista", title=">> Página siguiente", url=next_page_url,
thumbnail='https://s32.postimg.cc/4zppxf5j9/siguiente.png'))
return itemlist return itemlist
def findvideos(item): def findvideos(item):
logger.info() logger.info()
itemlist = [] itemlist = []
dl_links = []
if item.extra == 'pelicula':
item = bitly(item)
data = httptools.downloadpage(item.url).data data = httptools.downloadpage(item.url).data
itemlist.extend(servertools.find_video_items(data=data)) data = re.sub(r"\n|\r|\t|\s{2}|&nbsp;", "", data)
show = item.show
for videoitem in itemlist:
videoitem.channel = item.channel
if config.get_videolibrary_support() and len(itemlist) > 0 and item.contentType=="movie" and item.contentChannel!='videolibrary':
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=show))
return itemlist ### obtiene los gvideo
patron = 'class="Button Sm fa fa-download mg"></a><a target="_blank" rel="nofollow" href="([^"]+)"'
matches = re.compile(patron, re.DOTALL).findall(data)
for dl_url in matches:
g_data = httptools.downloadpage(dl_url).data
video_id = scrapertools.find_single_match(g_data, 'jfk-button jfk-button-action" href="([^"]+)">')
g_url = '%s%s' % ('https://drive.google.com', video_id)
g_url = g_url.replace('&amp;', '&')
g_data = httptools.downloadpage(g_url, follow_redirects=False, only_headers=True).headers
url = g_data['location']
dl_links.append(Item(channel=item.channel, title='%s', url=url, action='play', infoLabels=item.infoLabels))
if item.type == 'pl':
new_url = scrapertools.find_single_match(data, '<div class="player">.*?<a href="([^"]+)" target')
data = httptools.downloadpage(new_url).data
data = re.sub(r"\n|\r|\t|\s{2}|&nbsp;", "", data)
patron = '<li class="btn.*?" data-video="([^"]+)">'
matches = re.compile(patron, re.DOTALL).findall(data)
for video_id in matches:
url_data = httptools.downloadpage('https://tinyurl.com/%s' % video_id, follow_redirects=False)
url = url_data.headers['location']
itemlist.append(Item(channel=item.channel, title = '%s', url=url, action='play', infoLabels=item.infoLabels))
itemlist.extend(dl_links)
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
return itemlist

View File

@@ -252,10 +252,8 @@ def ultimas(item):
itemlist = [] itemlist = []
data = httptools.downloadpage(item.url).data data = httptools.downloadpage(item.url).data
data = re.sub(r"\n|\r|\t|&nbsp;|<br>", "", data) data = re.sub(r"\n|\r|\t|&nbsp;|<br>", "", data)
data = data.decode('cp1252')
realplot = '' realplot = ''
patron = '<a href="([^"]+)" title="([^"]+)"><img src="([^"]+)" alt=.*? style="width:105px; height:160px; ' \ patron = '<a href="([^"]+)" title="([^"]+)"> <img src="([^"]+)".*?solid'
'border:1px solid #999"\/><\/a>'
matches = re.compile(patron, re.DOTALL).findall(data) matches = re.compile(patron, re.DOTALL).findall(data)
@@ -312,10 +310,7 @@ def letras(item):
itemlist = [] itemlist = []
data = httptools.downloadpage(item.url).data data = httptools.downloadpage(item.url).data
data = re.sub(r"\n|\r|\t|&nbsp;|<br>", "", data) data = re.sub(r"\n|\r|\t|&nbsp;|<br>", "", data)
data = data.decode('cp1252') patron = '<li><a href="([^"]+)" title="Letra.*?">([^<]+)<\/a><\/li>'
data = scrapertools.find_single_match(data, '<\/form><\/table><\/div>.*?<\/ul>')
patron = '<li><a href="(.*?)" title="Letra.*?">(.*?)<\/a><\/li>'
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:
@@ -356,36 +351,40 @@ def findvideos(item):
logger.info() logger.info()
itemlist = [] itemlist = []
new_url = get_link(get_source(item.url)) try:
new_url = get_link(get_source(new_url)) new_url = get_link(get_source(item.url))
video_id = scrapertools.find_single_match(new_url, 'http.*?h=(\w+)') new_url = get_link(get_source(new_url))
new_url = '%s%s' % (host, 'playeropstream/api.php') video_id = scrapertools.find_single_match(new_url, 'http.*?h=(\w+)')
post = {'h': video_id} new_url = '%s%s' % (host, 'playeropstream/api.php')
post = urllib.urlencode(post) post = {'h': video_id}
data = httptools.downloadpage(new_url, post=post).data post = urllib.urlencode(post)
json_data = jsontools.load(data) data = httptools.downloadpage(new_url, post=post).data
url = json_data['url'] json_data = jsontools.load(data)
server = servertools.get_server_from_url(url) url = json_data['url']
title = '%s [%s]' % (server, item.language) server = servertools.get_server_from_url(url)
itemlist.append(Item(channel=item.channel, title=title, url=url, action='play', language=item.language, title = '%s [%s]' % (server, item.language)
server=server, infoLabels=item.infoLabels)) itemlist.append(Item(channel=item.channel, title=title, url=url, action='play', language=item.language,
server=server, infoLabels=item.infoLabels))
# Requerido para FilterTools # Requerido para FilterTools
itemlist = filtertools.get_links(itemlist, item, list_language) itemlist = filtertools.get_links(itemlist, item, list_language)
# Requerido para AutoPlay # Requerido para AutoPlay
autoplay.start(itemlist, item) autoplay.start(itemlist, item)
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
))
except:
pass
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
))
return itemlist return itemlist

View File

@@ -72,7 +72,7 @@ def menu_movies(item):
def get_source(url): def get_source(url):
logger.info() logger.info()
data = httptools.downloadpage(url).data data = httptools.downloadpage(url).data
data = re.sub(r'"|\n|\r|\t|&nbsp;|<br>|\s{2,}', "", data) data = re.sub(r'\n|\r|\t|&nbsp;|<br>|\s{2,}', "", data)
return data return data
@@ -93,9 +93,9 @@ def section(item):
duplicados=[] duplicados=[]
data = get_source(host+'/'+item.type) data = get_source(host+'/'+item.type)
if 'Genero' in item.title: if 'Genero' in item.title:
patron = '<li class=cat-item cat-item-\d+><a href=(.*?) >(.*?)/i>' patron = '<li class="cat-item cat-item-\d+"><a href="([^"]+)" >(.*?)</i'
elif 'Año' in item.title: elif 'Año' in item.title:
patron = '<li><a href=(.*?release.*?)>(.*?)</a>' patron = '<li><a href="(.*?release.*?)">([^<]+)<'
elif 'Calidad' in item.title: elif 'Calidad' in item.title:
patron = 'menu-item-object-dtquality menu-item-\d+><a href=(.*?)>(.*?)</a>' patron = 'menu-item-object-dtquality menu-item-\d+><a href=(.*?)>(.*?)</a>'
@@ -105,8 +105,8 @@ def section(item):
title = scrapedtitle title = scrapedtitle
plot='' plot=''
if 'Genero' in item.title: if 'Genero' in item.title:
quantity = scrapertools.find_single_match(scrapedtitle,'</a> <i>(.*?)<') quantity = scrapertools.find_single_match(scrapedtitle,'</a> <i>([^<]+)<')
title = scrapertools.find_single_match(scrapedtitle,'(.*?)</') title = scrapertools.find_single_match(scrapedtitle,'([^<]+)</')
title = title title = title
plot = '%s elementos' % quantity.replace('.','') plot = '%s elementos' % quantity.replace('.','')
else: else:
@@ -124,33 +124,31 @@ def list_all(item):
itemlist = [] itemlist = []
data = get_source(item.url) data = get_source(item.url)
if item.type == 'movies': if item.type == 'movies':
patron = '<article id=post-\d+ class=item movies><div class=poster><img src=(.*?) alt=(.*?)>.*?quality>(.*?)' patron = '<article id="post-\d+" class="item movies"><div class="poster"><img src="([^"]+)" alt="([^"]+)">.*?'
patron += '</span><\/div><a href=(.*?)>.*?<\/h3><span>(.*?)<\/span><\/div>.*?flags(.*?)metadata' patron += '"quality">([^<]+)</span><\/div><a href="([^"]+)">.*?</h3>.*?<span>([^<]+)</'
matches = re.compile(patron, re.DOTALL).findall(data) matches = re.compile(patron, re.DOTALL).findall(data)
for scrapedthumbnail, scrapedtitle, quality, scrapedurl, year, lang_data in matches: for scrapedthumbnail, scrapedtitle, quality, scrapedurl, year in matches:
title = '%s [%s] [%s]' % (scrapedtitle, year, quality) title = '%s [%s] [%s]' % (scrapedtitle, year, quality)
contentTitle = scrapedtitle contentTitle = scrapedtitle
thumbnail = scrapedthumbnail thumbnail = scrapedthumbnail
url = scrapedurl url = scrapedurl
language = get_language(lang_data) #language = get_language(lang_data)
itemlist.append(item.clone(action='findvideos', itemlist.append(item.clone(action='findvideos',
title=title, title=title,
url=url, url=url,
thumbnail=thumbnail, thumbnail=thumbnail,
contentTitle=contentTitle, contentTitle=contentTitle,
language=language,
quality=quality, quality=quality,
infoLabels={'year':year})) infoLabels={'year':year}))
elif item.type == 'tvshows': elif item.type == 'tvshows':
patron = '<article id=post-\d+ class=item tvshows><div class=poster><img src=(.*?) alt=(.*?)>.*?' patron = '<article id="post-\d+" class="item tvshows"><div class="poster"><img src="([^"]+)" alt="([^"]+)">.*?'
patron += '<a href=(.*?)>.*?<\/h3><span>(.*?)<\/span><\/div>' patron += '<a href="([^"]+)">.*?<span>(\d{4})<'
matches = re.compile(patron, re.DOTALL).findall(data) matches = re.compile(patron, re.DOTALL).findall(data)
for scrapedthumbnail, scrapedtitle, scrapedurl, year in matches: for scrapedthumbnail, scrapedtitle, scrapedurl, year in matches:
@@ -170,7 +168,7 @@ def list_all(item):
# Paginación # Paginación
#url_next_page = scrapertools.find_single_match(data,"<a class='arrow_pag' href=([^>]+)><i id='nextpagination'") #url_next_page = scrapertools.find_single_match(data,"<a class='arrow_pag' href=([^>]+)><i id='nextpagination'")
url_next_page = scrapertools.find_single_match(data,"<link rel=next href=([^ ]+) />") url_next_page = scrapertools.find_single_match(data,'<link rel="next" href="([^ ]+)" />')
if url_next_page: if url_next_page:
itemlist.append(item.clone(title="Siguiente >>", url=url_next_page, action='list_all')) itemlist.append(item.clone(title="Siguiente >>", url=url_next_page, action='list_all'))
@@ -216,7 +214,7 @@ def episodesxseasons(item):
itemlist = [] itemlist = []
data=get_source(item.url) data=get_source(item.url)
patron='class=numerando>%s - (\d+)</div><div class=episodiotitle><a href=(.*?)>(.*?)<' % item.infoLabels['season'] patron='class="numerando">%s - (\d+)</div><div class="episodiotitle"><a href="([^"]+)">([^<]+)<' % item.infoLabels['season']
matches = re.compile(patron, re.DOTALL).findall(data) matches = re.compile(patron, re.DOTALL).findall(data)
infoLabels = item.infoLabels infoLabels = item.infoLabels
@@ -239,10 +237,10 @@ def findvideos(item):
from lib import generictools from lib import generictools
itemlist = [] itemlist = []
data = get_source(item.url) data = get_source(item.url)
patron = 'id=option-(\d+).*?rptss src=(.*?) frameborder' patron = 'id="option-(\d+).*?rptss" src="([^"]+)" frameborder'
matches = re.compile(patron, re.DOTALL).findall(data) matches = re.compile(patron, re.DOTALL).findall(data)
for option, scrapedurl in matches: for option, scrapedurl in matches:
lang = scrapertools.find_single_match(data, 'href=#option-%s>.*?/flags/(.*?).png' % option) lang = scrapertools.find_single_match(data, 'href="#option-%s">.*?/flags/(.*?).png' % option)
quality = '' quality = ''
if lang not in IDIOMAS: if lang not in IDIOMAS:
lang = 'en' lang = 'en'
@@ -306,7 +304,8 @@ def search_results(item):
itemlist=[] itemlist=[]
data=get_source(item.url) data=get_source(item.url)
patron = '<article>.*?<a href=(.*?)><img src=(.*?) alt=(.*?) />.*?meta.*?year>(.*?)<(.*?)<p>(.*?)</p>' patron = '<article>.*?<a href="([^"]+)"><img src="([^"]+)" alt="([^"]+)" />.*?"meta".*?'
patron += '"year">([^<]+)<(.*?)<p>([^<]+)</p>'
matches = re.compile(patron, re.DOTALL).findall(data) matches = re.compile(patron, re.DOTALL).findall(data)
for scrapedurl, scrapedthumb, scrapedtitle, year, lang_data, scrapedplot in matches: for scrapedurl, scrapedthumb, scrapedtitle, year, lang_data, scrapedplot in matches:

View File

@@ -10,6 +10,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 channels import filtertools
from channels import autoplay from channels import autoplay
IDIOMAS = {'latino': 'Latino'} IDIOMAS = {'latino': 'Latino'}
@@ -97,7 +98,6 @@ def episodios(item):
patron_caps = '<li><span>Capitulo (\d+).*?</span><a href="(.*?)">(.*?)</a></li>' patron_caps = '<li><span>Capitulo (\d+).*?</span><a href="(.*?)">(.*?)</a></li>'
matches = scrapertools.find_multiple_matches(data, patron_caps) matches = scrapertools.find_multiple_matches(data, patron_caps)
# data_info = scrapertools.find_single_match(data, '<div class="info">.+?<\/div><\/div>')
patron_info = '<img src="([^"]+)">.+?</span>(.*?)</p>.*?<h2>Reseña:</h2><p>(.*?)</p>' patron_info = '<img src="([^"]+)">.+?</span>(.*?)</p>.*?<h2>Reseña:</h2><p>(.*?)</p>'
scrapedthumbnail, show, scrapedplot = scrapertools.find_single_match(data, patron_info) scrapedthumbnail, show, scrapedplot = scrapertools.find_single_match(data, patron_info)
scrapedthumbnail = host + scrapedthumbnail scrapedthumbnail = host + scrapedthumbnail
@@ -142,66 +142,73 @@ def episodios(item):
return itemlist return itemlist
def findvideos(item): def findvideos(item):
logger.info()
import base64 import base64
logger.info()
itemlist = [] itemlist = []
url_server = "https://openload.co/embed/%s/"
url_api_get_key = "https://serieslan.com/idx.php?i=%s&k=%s"
def txc(key, _str):
s = range(256)
j = 0
res = ''
for i in range(256):
j = (j + s[i] + ord(key[i % len(key)])) % 256
x = s[i]
s[i] = s[j]
s[j] = x
i = 0
j = 0
for y in range(len(_str)):
i = (i + 1) % 256
j = (j + s[i]) % 256
x = s[i]
s[i] = s[j]
s[j] = x
res += chr(ord(_str[y]) ^ s[(s[i] + s[j]) % 256])
return res
data = httptools.downloadpage(item.url).data data = httptools.downloadpage(item.url).data
pattern = "<script type=.+?>.+?\['(.+?)','(.+?)','.+?'\]"
idv, ide = scrapertools.find_single_match(data, pattern)
thumbnail = scrapertools.find_single_match(data,
'<div id="tab-1" class="tab-content current">.+?<img src="([^"]*)">')
show = scrapertools.find_single_match(data, '<span>Episodio: <\/span>([^"]*)<\/p><p><span>Idioma')
thumbnail = host + thumbnail
data = httptools.downloadpage(url_api_get_key % (idv, ide), headers={'Referer': item.url}).data
data = eval(data)
if type(data) == list: _sa = scrapertools.find_single_match(data, 'var _sa = (true|false);')
video_url = url_server % (txc(ide, base64.decodestring(data[2]))) _sl = scrapertools.find_single_match(data, 'var _sl = ([^;]+);')
server = "openload" sl = eval(_sl)
if " SUB" in item.title:
lang = "VOS"
elif " Sub" in item:
lang = "VOS"
else:
lang = "Latino"
title = "Enlace encontrado en " + server + " [" + lang + "]"
if item.contentChannel=='videolibrary':
itemlist.append(item.clone(channel=item.channel, action="play", url=video_url,
thumbnail=thumbnail, server=server, folder=False))
else:
itemlist.append(Item(channel=item.channel, action="play", title=title, show=show, url=video_url, plot=item.plot,
thumbnail=thumbnail, server=server, folder=False))
autoplay.start(itemlist, item) buttons = scrapertools.find_multiple_matches(data, '<button href="" class="selop" sl="([^"]+)">([^<]+)</button>')
return itemlist for id, title in buttons:
else: new_url = golink(int(id), _sa, sl)
return [] data = httptools.downloadpage(new_url).data
_x0x = scrapertools.find_single_match(data, 'var x0x = ([^;]+);')
x0x = eval(_x0x)
url = resolve(x0x[4], base64.b64decode(x0x[1]))
if 'download' in url:
url = url.replace('download', 'preview')
title = '%s'
itemlist.append(Item(channel=item.channel, title=title, url=url, action='play', language='latino',
infoLabels=item.infoLabels))
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
# Requerido para FilterTools
itemlist = filtertools.get_links(itemlist, item, list_language)
# Requerido para AutoPlay
autoplay.start(itemlist, item)
return itemlist
def golink (num, sa, sl):
import urllib
b = [3, 10, 5, 22, 31]
d = ''
for i in range(len(b)):
d += sl[2][b[i]+num:b[i]+num+1]
SVR = "https://viteca.stream" if sa == 'true' else "http://serieslan.com"
TT = "/" + urllib.quote_plus(sl[3].replace("/", "><")) if num == 0 else ""
return SVR + "/el/" + sl[0] + "/" + sl[1] + "/" + str(num) + "/" + sl[2] + d + TT
def resolve(value1, value2):
reto = ''
lista = range(256)
j = 0
for i in range(256):
j = (j + lista[i] + ord(value1[i % len(value1)])) % 256
k = lista[i]
lista[i] = lista[j]
lista[j] = k
m = 0;
j = 0;
for i in range(len(value2)):
m = (m + 1) % 256
j = (j + lista[m]) % 256
k = lista[m]
lista[m] = lista[j]
lista[j] = k
reto += chr(ord(value2[i]) ^ lista[(lista[m] + lista[j]) % 256])
return reto

63
plugin.video.alfa/channels/vepelis.py Executable file → Normal file
View File

@@ -2,10 +2,12 @@
import re import re
import urlparse import urlparse
import urllib
from core import scrapertools from core import scrapertools
from core import httptools from core import httptools
from core import servertools from core import servertools
from core import jsontools
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
@@ -81,24 +83,6 @@ def listarpeliculas(item):
return itemlist return itemlist
def findvideos(item):
logger.info()
# Descarga la página
itemlist = []
data = httptools.downloadpage(item.url).data
itemlist.extend(servertools.find_video_items(data=data))
for videoitem in itemlist:
videoitem.channel = item.channel
videoitem.quality = item.quality
videoitem.language = item.language
videoitem.action = 'play'
return itemlist
def generos(item): def generos(item):
logger.info() logger.info()
itemlist = [] itemlist = []
@@ -230,6 +214,46 @@ def listado2(item):
return itemlist return itemlist
def get_source(url):
logger.info()
data = httptools.downloadpage(url).data
data = re.sub(r'\n|\r|\t|&nbsp;|<br>|\s{2,}', "", data)
return data
def get_link(data):
new_url = scrapertools.find_single_match(data, '(?:IFRAME|iframe) src="([^"]+)" scrolling')
return new_url
def findvideos(item):
logger.info()
host = 'https://www.locopelis.tv/'
itemlist = []
new_url = get_link(get_source(item.url))
new_url = get_link(get_source(new_url))
video_id = scrapertools.find_single_match(new_url, 'http.*?h=(\w+)')
new_url = '%s%s' % (host, 'playeropstream/api.php')
post = {'h': video_id}
post = urllib.urlencode(post)
data = httptools.downloadpage(new_url, post=post).data
json_data = jsontools.load(data)
url = json_data['url']
server = servertools.get_server_from_url(url)
title = '%s' % server
itemlist.append(Item(channel=item.channel, title=title, url=url, action='play',
server=server, infoLabels=item.infoLabels))
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.fulltitle
))
return itemlist
def search(item, texto): def search(item, texto):
logger.info() logger.info()
itemlist = [] itemlist = []
@@ -277,3 +301,6 @@ def newest(categoria):
return [] return []
return itemlist return itemlist

View File

@@ -63,6 +63,11 @@ def getchanneltypes(view="thumb_"):
# Lista de categorias # Lista de categorias
channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "direct", "torrent"] channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "direct", "torrent"]
dict_types_lang = {'movie': config.get_localized_string(30122), 'tvshow': config.get_localized_string(30123),
'anime': config.get_localized_string(30124), 'documentary': config.get_localized_string(30125),
'vos': config.get_localized_string(30136), 'adult': config.get_localized_string(30126),
'direct': config.get_localized_string(30137)}
if config.get_setting("adult_mode") != 0: if config.get_setting("adult_mode") != 0:
channel_types.append("adult") channel_types.append("adult")
@@ -78,7 +83,7 @@ def getchanneltypes(view="thumb_"):
for channel_type in channel_types: for channel_type in channel_types:
logger.info("channel_type=%s" % channel_type) logger.info("channel_type=%s" % channel_type)
title = config.get_localized_category(channel_type) title = dict_types_lang.get(channel_type, channel_type)
itemlist.append(Item(title=title, channel="channelselector", action="filterchannels", category=title, itemlist.append(Item(title=title, channel="channelselector", action="filterchannels", category=title,
channel_type=channel_type, viewmode="thumbnails", channel_type=channel_type, viewmode="thumbnails",
thumbnail=get_thumb("channels_%s.png" % channel_type, view))) thumbnail=get_thumb("channels_%s.png" % channel_type, view)))
@@ -169,10 +174,11 @@ def filterchannels(category, view="thumb_"):
context.append({"title": "Configurar canal", "channel": "setting", "action": "channel_config", context.append({"title": "Configurar canal", "channel": "setting", "action": "channel_config",
"config": channel_parameters["channel"]}) "config": channel_parameters["channel"]})
channel_info = set_channel_info(channel_parameters)
# Si ha llegado hasta aquí, lo añade # Si ha llegado hasta aquí, lo añade
channelslist.append(Item(title=channel_parameters["title"], channel=channel_parameters["channel"], channelslist.append(Item(title=channel_parameters["title"], channel=channel_parameters["channel"],
action="mainlist", thumbnail=channel_parameters["thumbnail"], action="mainlist", thumbnail=channel_parameters["thumbnail"],
fanart=channel_parameters["fanart"], category=channel_parameters["title"], fanart=channel_parameters["fanart"], plot=channel_info, category=channel_parameters["title"],
language=channel_parameters["language"], viewmode="list", context=context)) language=channel_parameters["language"], viewmode="list", context=context))
except: except:
@@ -232,3 +238,34 @@ def get_thumb(thumb_name, view="thumb_", auto=False):
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)
def set_channel_info(parameters):
logger.info()
info = ''
language = ''
content = ''
langs = parameters['language']
lang_dict = {'lat':'Latino', 'cast':'Castellano', '*':'Latino, Castellano, VOSE, VO'}
for lang in langs:
if 'vos' in parameters['categories']:
lang = '*'
if lang in lang_dict:
if language != '' and language != '*' and not parameters['adult']:
language = '%s, %s' % (language, lang_dict[lang])
elif not parameters['adult']:
language = lang_dict[lang]
if lang == '*':
break
categories = parameters['categories']
for cat in categories:
if content != '':
content = '%s, %s' % (content, config.get_localized_category(cat))
else:
content = config.get_localized_category(cat)
info = '[COLOR yellow]Tipo de contenido:[/COLOR] %s\n\n[COLOR yellow]Idiomas:[/COLOR] %s' % (content, language)
return info