Correcciones y mejoras
This commit is contained in:
@@ -703,18 +703,17 @@ def play_multi_channel(item, itemlist):
|
||||
channel_videos = []
|
||||
video_dict = dict()
|
||||
set_status(True)
|
||||
|
||||
for video_item in itemlist:
|
||||
if video_item.contentChannel != actual_channel:
|
||||
actual_channel = video_item.contentChannel
|
||||
else:
|
||||
elif is_active(actual_channel):
|
||||
channel_videos.append(video_item)
|
||||
video_dict[actual_channel] = channel_videos
|
||||
|
||||
for channel, videos in video_dict.items():
|
||||
item.contentChannel = channel
|
||||
if not PLAYED:
|
||||
item.contentChannel = channel
|
||||
if is_active(channel):
|
||||
logger.debug('esta activo en %s' % channel)
|
||||
start(videos, item)
|
||||
start(videos, item)
|
||||
else:
|
||||
break
|
||||
|
||||
@@ -30,16 +30,16 @@ def mainlist(item):
|
||||
autoplay.init(item.channel, list_servers, list_quality)
|
||||
|
||||
itemlist = list()
|
||||
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(channel=item.channel, title="Ultimas", action="list_all", url=host, thumbnail=get_thumb('last', auto=True)))
|
||||
itemlist.append(Item(channel=item.channel, title="Generos", action="section", section='genre',
|
||||
thumbnail=get_thumb('genres', auto=True)))
|
||||
itemlist.append(item.clone(title="Por Calidad", action="section", section='quality',
|
||||
itemlist.append(Item(channel=item.channel, title="Por Calidad", action="section", section='quality',
|
||||
thumbnail=get_thumb('quality', auto=True)))
|
||||
itemlist.append(item.clone(title="Por Año", action="section", section='year',
|
||||
itemlist.append(Item(channel=item.channel, title="Por Año", action="section", section='year',
|
||||
thumbnail=get_thumb('year', auto=True)))
|
||||
itemlist.append(item.clone(title="Alfabetico", action="section", section='alpha',
|
||||
itemlist.append(Item(channel=item.channel, title="Alfabetico", action="section", section='alpha',
|
||||
thumbnail=get_thumb('alphabet', auto=True)))
|
||||
itemlist.append(item.clone(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)))
|
||||
|
||||
autoplay.show_option(item.channel, itemlist)
|
||||
@@ -85,7 +85,7 @@ def list_all(item):
|
||||
|
||||
title = '%s [%s]'%(contentTitle, year)
|
||||
thumbnail = 'http:'+scrapedthumbnail
|
||||
itemlist.append(item.clone(action='findvideos',
|
||||
itemlist.append(Item(channel=item.channel, action='findvideos',
|
||||
title=title,
|
||||
url=url,
|
||||
thumbnail=thumbnail,
|
||||
@@ -98,7 +98,7 @@ def list_all(item):
|
||||
|
||||
url_next_page = scrapertools.find_single_match(full_data,'<a class=next.*?href=(.*?)>')
|
||||
if url_next_page:
|
||||
itemlist.append(item.clone(title="Siguiente >>", url=url_next_page, action='list_all'))
|
||||
itemlist.append(Item(channel=item.channel, title="Siguiente >>", url=url_next_page, action='list_all'))
|
||||
return itemlist
|
||||
|
||||
def section(item):
|
||||
@@ -147,9 +147,10 @@ def findvideos(item):
|
||||
language = opt_data[0].strip()
|
||||
quality = opt_data[1].strip()
|
||||
if url != '' and 'youtube' not in url:
|
||||
itemlist.append(item.clone(title='%s', url=url, language=IDIOMAS[language], quality=quality, action='play'))
|
||||
itemlist.append(Item(channel=item.channel, title='%s', url=url, language=IDIOMAS[language], quality=quality,
|
||||
action='play'))
|
||||
elif 'youtube' in url:
|
||||
trailer = item.clone(title='Trailer', url=url, action='play', server='youtube')
|
||||
trailer = Item(channel=item.channel, title='Trailer', url=url, action='play', server='youtube')
|
||||
|
||||
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % '%s [%s] [%s]'%(i.server.capitalize(),
|
||||
i.language, i.quality))
|
||||
|
||||
@@ -35,28 +35,28 @@ def mainlist(item):
|
||||
autoplay.init(item.channel, list_servers, list_quality)
|
||||
itemlist = []
|
||||
|
||||
itemlist.append(item.clone(title="Novedades", action="entradas", url="http://www.inkapelis.com/",
|
||||
itemlist.append(Item(channel=item.channel, title="Novedades", action="entradas", url="http://www.inkapelis.com/",
|
||||
extra="Novedades", text_color=color1, thumbnail=get_thumb('newest', auto=True)))
|
||||
#itemlist.append(item.clone(title="Estrenos", action="entradas", url="http://www.inkapelis.com/genero/estrenos/",
|
||||
#itemlist.append(Item(channel=item.channel, title="Estrenos", action="entradas", url="http://www.inkapelis.com/genero/estrenos/",
|
||||
# text_color=color1, thumbnail=get_thumb('premieres', auto=True)))
|
||||
itemlist.append(item.clone(title="Castellano", action="entradas",
|
||||
itemlist.append(Item(channel=item.channel, title="Castellano", action="entradas",
|
||||
url="https://www.inkapelis.com/?anio=&genero=&calidad=&idioma=Castellano&s=",
|
||||
extra="Buscar", text_color=color1, thumbnail=get_thumb('espanolas', auto=True)))
|
||||
|
||||
itemlist.append(item.clone(title="Latino", action="entradas",
|
||||
itemlist.append(Item(channel=item.channel, title="Latino", action="entradas",
|
||||
url="https://www.inkapelis.com/?anio=&genero=&calidad=&idioma=Latino&s=",
|
||||
extra="Buscar", text_color=color1, thumbnail=get_thumb('latino', auto=True)))
|
||||
|
||||
itemlist.append(item.clone(title="VOSE", action="entradas",
|
||||
itemlist.append(Item(channel=item.channel, title="VOSE", action="entradas",
|
||||
url="https://www.inkapelis.com/?anio=&genero=&calidad=&idioma=Subtitulada&s=",
|
||||
extra="Buscar", text_color=color1, thumbnail=get_thumb('newest', auto=True)))
|
||||
|
||||
itemlist.append(item.clone(title="Géneros", action="generos", url="http://www.inkapelis.com/", text_color=color1,
|
||||
itemlist.append(Item(channel=item.channel, title="Géneros", action="generos", url="http://www.inkapelis.com/", text_color=color1,
|
||||
thumbnail=get_thumb('genres', auto=True),))
|
||||
itemlist.append(item.clone(title="Buscar...", action="", text_color=color1))
|
||||
itemlist.append(item.clone(action="", title=""))
|
||||
itemlist.append(Item(channel=item.channel, title="Buscar...", action="", text_color=color1))
|
||||
itemlist.append(Item(channel=item.channel, action="", title=""))
|
||||
itemlist.append(
|
||||
item.clone(action="filtro", title="Filtrar películas", url="http://www.inkapelis.com/?s=", text_color=color1))
|
||||
Item(channel=item.channel, action="filtro", title="Filtrar películas", url="http://www.inkapelis.com/?s=", text_color=color1))
|
||||
# Filtros personalizados para peliculas
|
||||
for i in range(1, 4):
|
||||
filtros = config.get_setting("pers_peliculas" + str(i), item.channel)
|
||||
@@ -66,7 +66,7 @@ def mainlist(item):
|
||||
new_item.values = filtros
|
||||
itemlist.append(
|
||||
new_item.clone(action="filtro", title=title, url="http://www.inkapelis.com/?s=", text_color=color2))
|
||||
itemlist.append(item.clone(action="configuracion", title="Configurar canal...", text_color="gold", folder=False))
|
||||
itemlist.append(Item(channel=item.channel, action="configuracion", title="Configurar canal...", text_color="gold", folder=False))
|
||||
|
||||
autoplay.show_option(item.channel, itemlist)
|
||||
|
||||
@@ -284,7 +284,7 @@ def entradas(item):
|
||||
title = scrapedtitle
|
||||
calidad = calidad.strip()
|
||||
|
||||
itemlist.append(item.clone(action="findvideos", title=title, url=scrapedurl, thumbnail=thumbnail,
|
||||
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, url=scrapedurl, thumbnail=thumbnail,
|
||||
contentTitle=scrapedtitle, fulltitle=scrapedtitle,
|
||||
context=["buscar_trailer"],
|
||||
contentType="movie"))
|
||||
@@ -326,7 +326,7 @@ def entradas(item):
|
||||
filtro_list = {"poster_path": filtro_thumb}
|
||||
filtro_list = filtro_list.items()
|
||||
|
||||
itemlist.append(item.clone(action="findvideos", title=title, url=url, contentTitle=scrapedtitle,
|
||||
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, url=url, contentTitle=scrapedtitle,
|
||||
fulltitle=scrapedtitle, thumbnail=thumbnail, context=["buscar_trailer"],
|
||||
contentType="movie", infoLabels={'filtro': filtro_list}))
|
||||
|
||||
@@ -337,7 +337,7 @@ def entradas(item):
|
||||
if next_page:
|
||||
if item.extra == "Buscar":
|
||||
next_page = next_page.replace('&', '&')
|
||||
itemlist.append(item.clone(action="entradas", title="Siguiente", url=next_page, text_color=color3))
|
||||
itemlist.append(Item(channel=item.channel, action="entradas", title="Siguiente", url=next_page, text_color=color3))
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -360,13 +360,13 @@ def eroticas(item):
|
||||
title = scrapedtitle + " [" + idioma + "] [" + calidad + "]"
|
||||
thumbnail = scrapedthumbnail.replace("w185", "original")
|
||||
|
||||
itemlist.append(item.clone(action="findvideos", title=title, url=url, thumbnail=thumbnail,
|
||||
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, url=url, thumbnail=thumbnail,
|
||||
extra="eroticas"))
|
||||
|
||||
# Extrae la marca de la siguiente página
|
||||
next_page = scrapertools.find_single_match(data, '<span class="current">.*?<\/span><a href="([^"]+)"')
|
||||
if next_page:
|
||||
itemlist.append(item.clone(action="entradas", title="Siguiente", url=next_page))
|
||||
itemlist.append(Item(channel=item.channel, action="entradas", title="Siguiente", url=next_page))
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -406,7 +406,7 @@ def findvideos(item):
|
||||
if server == "Ul":
|
||||
server = "Uploaded"
|
||||
title = "%s [%s][%s]" % (server, idioma, calidad)
|
||||
itemlist.append(item.clone(action="play", title=title, url=url, language=idioma, quality=calidad,
|
||||
itemlist.append(Item(channel=item.channel, action="play", title=title, url=url, language=idioma, quality=calidad,
|
||||
server=server, infoLabels=item.infoLabels))
|
||||
|
||||
patron = 'id="(embed[0-9]*)".*?<div class="calishow">(.*?)<.*?src="([^"]+)"'
|
||||
@@ -417,7 +417,7 @@ def findvideos(item):
|
||||
title = "Directo"
|
||||
idioma = scrapertools.find_single_match(data, 'href="#%s".*?>([^<]+)<' % id_embed)
|
||||
title = "%s [%s][%s]" % (title.capitalize(), idioma, calidad)
|
||||
itemlist.append(item.clone(action="play", title=title, url=url, language=idioma, quality=calidad,
|
||||
itemlist.append(Item(channel=item.channel, action="play", title=title, url=url, language=idioma, quality=calidad,
|
||||
server=server))
|
||||
# Requerido para FilterTools
|
||||
|
||||
|
||||
@@ -22,6 +22,20 @@
|
||||
"default": true,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "filter_languages",
|
||||
"type": "list",
|
||||
"label": "Mostrar enlaces en idioma...",
|
||||
"default": 0,
|
||||
"enabled": true,
|
||||
"visible": true,
|
||||
"lvalues": [
|
||||
"No filtrar",
|
||||
"Lat",
|
||||
"Cast",
|
||||
"VOSE"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -12,8 +12,17 @@ from core import scrapertools
|
||||
from core.item import Item
|
||||
from core import servertools
|
||||
from core import httptools
|
||||
from channels import filtertools, autoplay
|
||||
from core import tmdb
|
||||
|
||||
|
||||
|
||||
IDIOMAS = {'latino':'Lat', 'castellano':'Cast', 'subtitulado':'VOSE'}
|
||||
list_language = IDIOMAS.values()
|
||||
list_quality = ['360p', '480p', '720p', '1080p']
|
||||
list_servers = ['mailru', 'openload', 'streamango', 'estream']
|
||||
|
||||
|
||||
host = 'http://pelisplus.co'
|
||||
CHANNEL_HEADERS = [
|
||||
["Host", host.replace("http://","")],
|
||||
@@ -26,6 +35,8 @@ def mainlist(item):
|
||||
|
||||
itemlist = []
|
||||
|
||||
autoplay.init(item.channel, list_servers, list_quality)
|
||||
|
||||
itemlist.append(item.clone(title="Peliculas",
|
||||
action="movie_menu",
|
||||
))
|
||||
@@ -34,6 +45,8 @@ def mainlist(item):
|
||||
action="series_menu",
|
||||
))
|
||||
|
||||
autoplay.show_option(item.channel, itemlist)
|
||||
|
||||
return itemlist
|
||||
|
||||
def movie_menu(item):
|
||||
@@ -342,6 +355,8 @@ def get_links_by_language(item, data):
|
||||
language = scrapertools.find_single_match(data, 'ul id=level\d_(.*?)\s*class=')
|
||||
patron = 'data-source=(.*?)data.*?srt=(.*?)data-iframe.*?Opci.*?<.*?hidden>[^\(]\((.*?)\)'
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
if language in IDIOMAS:
|
||||
language == IDIOMAS[language]
|
||||
|
||||
for url, sub, quality in matches:
|
||||
if 'http' not in url:
|
||||
@@ -386,6 +401,14 @@ def findvideos(item):
|
||||
|
||||
video_list = servertools.get_servers_itemlist(video_list, lambda i: i.title % (i.server.capitalize(), i.language,
|
||||
i.quality) )
|
||||
# Requerido para FilterTools
|
||||
|
||||
itemlist = filtertools.get_links(video_list, item, list_language)
|
||||
|
||||
# Requerido para AutoPlay
|
||||
|
||||
autoplay.start(video_list, item)
|
||||
|
||||
if item.contentType != 'episode':
|
||||
if config.get_videolibrary_support() and len(video_list) > 0 and item.extra != 'findvideos':
|
||||
video_list.append(
|
||||
@@ -397,5 +420,6 @@ def findvideos(item):
|
||||
contentTitle=item.contentTitle
|
||||
))
|
||||
|
||||
|
||||
return video_list
|
||||
|
||||
|
||||
@@ -125,8 +125,8 @@ def list_all(item):
|
||||
|
||||
data = get_source(item.url)
|
||||
if item.type == 'movies':
|
||||
patron = '<article id="post-\d+" class="item movies"><div class="poster"><img src="([^"]+)" alt="([^"]+)">.*?'
|
||||
patron += '"quality">([^<]+)</span><\/div><a href="([^"]+)">.*?</h3>.*?<span>([^<]+)</'
|
||||
patron = '<article id="post-\d+" class="item movies"><div class="poster">\s?<img src="([^"]+)" alt="([^"]+)">.*?'
|
||||
patron += '"quality">([^<]+)</span><\/div>\s?<a href="([^"]+)">.*?</h3>.*?<span>([^<]+)</'
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
|
||||
for scrapedthumbnail, scrapedtitle, quality, scrapedurl, year in matches:
|
||||
@@ -235,29 +235,32 @@ def episodesxseasons(item):
|
||||
def findvideos(item):
|
||||
logger.info()
|
||||
from lib import generictools
|
||||
import urllib
|
||||
itemlist = []
|
||||
data = get_source(item.url)
|
||||
patron = 'id="option-(\d+).*?rptss" src="([^"]+)" frameborder'
|
||||
patron = 'data-post="(\d+)" data-nume="(\d+)".*?img src=\'([^\']+)\''
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
for option, scrapedurl in matches:
|
||||
lang = scrapertools.find_single_match(data, 'href="#option-%s">.*?/flags/(.*?).png' % option)
|
||||
for id, option, lang in matches:
|
||||
lang = scrapertools.find_single_match(lang, '.*?/flags/(.*?).png')
|
||||
quality = ''
|
||||
|
||||
post = {'action': 'doo_player_ajax', 'post': id, 'nume': option}
|
||||
post = urllib.urlencode(post)
|
||||
test_url = 'https://pelisr.com/wp-admin/admin-ajax.php'
|
||||
new_data = httptools.downloadpage(test_url, post=post).data
|
||||
scrapedurl = scrapertools.find_single_match(new_data, "src='([^']+)'")
|
||||
|
||||
if lang not in IDIOMAS:
|
||||
lang = 'en'
|
||||
title = '%s'
|
||||
|
||||
if 'embed' in scrapedurl:
|
||||
enc_data = get_source(scrapedurl)
|
||||
if 'drive' in scrapedurl:
|
||||
enc_data = httptools.downloadpage(scrapedurl, headers = {'Referer':item.url}).data
|
||||
|
||||
dec_data = generictools.dejuice(enc_data)
|
||||
url, quality = scrapertools.find_single_match(dec_data, '"file":"(.*?)","label":"(.*?)"')
|
||||
|
||||
elif 'wd=' in scrapedurl:
|
||||
new_id = scrapertools.find_single_match(scrapedurl, 'wd=(.*?)&')
|
||||
new_id = new_id[::-1]
|
||||
new_url = 'https://pelisr.com/encri/?wr=%s' % new_id
|
||||
headers = {'Referer': scrapedurl}
|
||||
data = httptools.downloadpage(new_url, headers=headers, follow_redirects=False)
|
||||
url = data.headers['location']
|
||||
else:
|
||||
url = scrapedurl
|
||||
|
||||
itemlist.append(
|
||||
Item(channel=item.channel, url=url, title=title, action='play', quality=quality, language=IDIOMAS[lang],
|
||||
|
||||
@@ -37,51 +37,11 @@ def mainlist(item):
|
||||
return itemlist
|
||||
|
||||
|
||||
def listarpeliculas(item):
|
||||
def get_source(url):
|
||||
logger.info()
|
||||
|
||||
# Descarga la página
|
||||
data = httptools.downloadpage(item.url).data
|
||||
extra = item.extra
|
||||
|
||||
# Extrae las entradas de la pagina seleccionada
|
||||
'''<td class="DarkText" align="center" valign="top" width="100px" height="160px"
|
||||
style="background-color:#1e1e1e;" onmouseover="this.style.backgroundColor='#000000'"
|
||||
onmouseout="this.style.backgroundColor='#1e1e1e'"><p style="margin-bottom: 3px;border-bottom:#ABABAB 1px solid">
|
||||
<a href="http://www.peliculasaudiolatino.com/movies/Larry_Crowne.html"><img
|
||||
src="http://www.peliculasaudiolatino.com/poster/85x115/peliculas/movieimg/movie1317696842.jpg"
|
||||
alt="Larry Crowne" border="0" height="115" width="85"></a>'''
|
||||
patron = '<td class=.*?<a '
|
||||
patron += 'href="([^"]+)"><img src="([^"]+)" alt="([^"]+)"'
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
itemlist = []
|
||||
for match in matches:
|
||||
scrapedurl = match[0]
|
||||
scrapedtitle = match[2]
|
||||
scrapedtitle = unicode(scrapedtitle, "iso-8859-1", errors="replace").encode("utf-8")
|
||||
scrapedthumbnail = match[1]
|
||||
scrapedplot = ""
|
||||
logger.info(scrapedtitle)
|
||||
|
||||
# Añade al listado
|
||||
itemlist.append(Item(channel=item.channel, action="findvideos", title=scrapedtitle, fulltitle=scrapedtitle,
|
||||
url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, extra=extra, folder=True))
|
||||
|
||||
# Extrae la marca de siguiente página
|
||||
patron = 'Anterior.*? :: <a href="/../../.*?/page/([^"]+)">Siguiente '
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
for match in matches:
|
||||
if len(matches) > 0:
|
||||
scrapedurl = extra + match
|
||||
scrapedtitle = "!Pagina Siguiente"
|
||||
scrapedthumbnail = ""
|
||||
scrapedplot = ""
|
||||
|
||||
itemlist.append(
|
||||
Item(channel=item.channel, action="listarpeliculas", title=scrapedtitle, fulltitle=scrapedtitle,
|
||||
url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, extra=extra, folder=True))
|
||||
|
||||
return itemlist
|
||||
data = httptools.downloadpage(url).data
|
||||
data = re.sub(r'\n|\r|\t| |<br>|\s{2,}', "", data)
|
||||
return data
|
||||
|
||||
def generos(item):
|
||||
logger.info()
|
||||
@@ -187,11 +147,9 @@ def listado2(item):
|
||||
itemlist = []
|
||||
|
||||
# Descarga la página
|
||||
data = httptools.downloadpage(item.url).data
|
||||
data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data)
|
||||
|
||||
patron = '<h2 class=titpeli.*?<a href=(.*?) title=(.*?)>.*?peli_img_img>.*?<img src=(.*?) alt.*?'
|
||||
patron += '<p>(.*?)<.*?Genero.*?:.*?(\d{4})<.*?png\/>(.*?)<.*?: (.*?)<'
|
||||
data = get_source(item.url)
|
||||
patron = '<h2 class="titpeli.*?<a href="([^"]+)" title="([^"]+)">.*?peli_img_img">.*?'
|
||||
patron +='<img src="([^"]+)" alt.*?<p>([^<]+)</p>.*?Genero.*?:.*?(\d{4})<.*?png".*?\/>([^<]+)<.*?: (.*?)<'
|
||||
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedplot, year, language, quality in matches:
|
||||
@@ -214,12 +172,6 @@ def listado2(item):
|
||||
return itemlist
|
||||
|
||||
|
||||
def get_source(url):
|
||||
logger.info()
|
||||
data = httptools.downloadpage(url).data
|
||||
data = re.sub(r'\n|\r|\t| |<br>|\s{2,}', "", data)
|
||||
return data
|
||||
|
||||
def get_link(data):
|
||||
new_url = scrapertools.find_single_match(data, '(?:IFRAME|iframe) src="([^"]+)" scrolling')
|
||||
return new_url
|
||||
|
||||
@@ -18,6 +18,20 @@
|
||||
"default": true,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "filter_languages",
|
||||
"type": "list",
|
||||
"label": "Mostrar enlaces en idioma...",
|
||||
"default": 0,
|
||||
"enabled": true,
|
||||
"visible": true,
|
||||
"lvalues": [
|
||||
"No filtrar",
|
||||
"Cast",
|
||||
"Lat",
|
||||
"VOSE"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -14,11 +14,17 @@ from core import scrapertools
|
||||
from core import servertools
|
||||
from core.item import Item
|
||||
from platformcode import config, logger
|
||||
from channels import filtertools, autoplay
|
||||
from core import tmdb
|
||||
|
||||
__channel__ = "ver-peliculas"
|
||||
|
||||
host = "http://ver-peliculas.io/"
|
||||
host = "https://ver-peliculas.co/"
|
||||
|
||||
IDIOMAS = {'Latino':'Lat', 'Catellano':'Cast', 'Subtitulada':'VOSE'}
|
||||
list_language = IDIOMAS.values()
|
||||
list_quality = []
|
||||
list_servers = ['directo', 'openload', 'streamango', 'rapidvideo']
|
||||
|
||||
try:
|
||||
__modo_grafico__ = config.get_setting('modo_grafico', __channel__)
|
||||
@@ -27,7 +33,11 @@ except:
|
||||
|
||||
def mainlist(item):
|
||||
logger.info()
|
||||
|
||||
itemlist = list()
|
||||
|
||||
autoplay.init(item.channel, list_servers, list_quality)
|
||||
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
title="Peliculas",
|
||||
@@ -63,9 +73,11 @@ def mainlist(item):
|
||||
Item(channel=item.channel,
|
||||
title="Buscar",
|
||||
action="search",
|
||||
url=host + "core/ajax/suggest_search",
|
||||
url=host + "/buscar/",
|
||||
thumbnail=get_thumb("search.png")))
|
||||
|
||||
autoplay.show_option(item.channel, itemlist)
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
@@ -90,33 +102,10 @@ def categories(item):
|
||||
|
||||
def search(item, texto):
|
||||
logger.info()
|
||||
|
||||
try:
|
||||
itemlist = []
|
||||
post = "keyword=%s" % texto
|
||||
data = httptools.downloadpage(item.url, post=post).data
|
||||
data = data.replace('\\"', '"').replace('\\/', '/')
|
||||
|
||||
pattern = 'url\((.*?)\).+?<a href="([^"]+)".*?class="ss-title">(.*?)</a>'
|
||||
matches = re.compile(pattern, re.DOTALL).findall(data)
|
||||
|
||||
for thumb, url, title in matches:
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
action="findvideos",
|
||||
title=title,
|
||||
url=url,
|
||||
thumbnail=thumb
|
||||
))
|
||||
|
||||
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 []
|
||||
|
||||
texto = texto.replace(" ", "+")
|
||||
item.url = item.url + texto + '.html'
|
||||
if texto != '':
|
||||
return listado(item)
|
||||
|
||||
def listado(item):
|
||||
logger.info()
|
||||
@@ -126,7 +115,8 @@ def listado(item):
|
||||
matches = scrapertools.find_multiple_matches(data, pattern)
|
||||
for url, thumb, title in matches:
|
||||
year = scrapertools.find_single_match(url, '-(\d+)-online')
|
||||
title = title.replace("Película", "", 1).partition(" /")[0].partition(":")[0]
|
||||
#title = title.replace("Película", "", 1).partition(" /")[0].partition(":")[0]
|
||||
title = title.replace("Película", "", 1).partition(" /")[0]
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
action="findvideos",
|
||||
title=title,
|
||||
@@ -159,61 +149,70 @@ def get_source(url):
|
||||
def findvideos(item):
|
||||
logger.info()
|
||||
duplicated = []
|
||||
|
||||
itemlist = []
|
||||
data = get_source(item.url)
|
||||
video_info = scrapertools.find_single_match(data, "load_player\('([^']+).*?([^']+)")
|
||||
movie_info = scrapertools.find_single_match(item.url,
|
||||
'http:\/\/ver-peliculas\.(io|org)\/peliculas\/(\d+)-(.*?)-\d{4}-online\.')
|
||||
'http.:\/\/ver-peliculas\.(io|org|co)\/peliculas\/(\d+)-(.*?)-\d{4}-online\.')
|
||||
|
||||
if movie_info:
|
||||
movie_host = movie_info[0]
|
||||
movie_id = scrapertools.find_single_match(data,'id=idpelicula value=(.*?)>')
|
||||
movie_name = scrapertools.find_single_match(data,'id=nombreslug value=(.*?)>')
|
||||
sub = scrapertools.find_single_match(data, 'id=imdb value=(.*?)>')
|
||||
sub = '%s/subtix/%s.srt' % (movie_host, sub)
|
||||
url_base = 'https://ver-peliculas.%s/core/api.php?id=%s&slug=%s' % (movie_host, movie_id, movie_name)
|
||||
data = httptools.downloadpage(url_base).data
|
||||
json_data = jsontools.load(data)
|
||||
video_list = json_data['lista']
|
||||
for videoitem in video_list:
|
||||
video_base_url = host.replace('.io', '.%s' % movie_host) + 'core/videofinal.php'
|
||||
if video_list[videoitem] != None:
|
||||
video_lang = video_list[videoitem]
|
||||
languages = ['latino', 'spanish', 'subtitulos', 'subtitulosp']
|
||||
for lang in languages:
|
||||
if lang not in video_lang:
|
||||
continue
|
||||
if video_lang[lang] != None:
|
||||
if not isinstance(video_lang[lang], int):
|
||||
video_id = video_lang[lang][0]["video"]
|
||||
post = {"video": video_id, "sub": sub}
|
||||
post = urllib.urlencode(post)
|
||||
data = httptools.downloadpage(video_base_url, post=post).data
|
||||
playlist = jsontools.load(data)
|
||||
sources = playlist[['playlist'][0]]
|
||||
server = playlist['server']
|
||||
for video_link in sources:
|
||||
url = video_link['sources']
|
||||
if url not in duplicated and server!='drive':
|
||||
|
||||
movie_host = movie_info[0]
|
||||
movie_id = scrapertools.find_single_match(data,'id=idpelicula value=(.*?)>')
|
||||
movie_name = scrapertools.find_single_match(data,'id=nombreslug value=(.*?)>')
|
||||
sub = scrapertools.find_single_match(data, 'id=imdb value=(.*?)>')
|
||||
sub = '%s/subtix/%s.srt' % (movie_host, sub)
|
||||
url_base = 'http://ver-peliculas.%s/core/api.php?id=%s&slug=%s' % (movie_host, movie_id, movie_name)
|
||||
data = httptools.downloadpage(url_base).data
|
||||
json_data = jsontools.load(data)
|
||||
video_list = json_data['lista']
|
||||
itemlist = []
|
||||
for videoitem in video_list:
|
||||
video_base_url = host + '/core/videofinal.php'
|
||||
if video_list[videoitem] != None:
|
||||
video_lang = video_list[videoitem]
|
||||
languages = ['latino', 'spanish', 'subtitulos', 'subtitulosp']
|
||||
for lang in languages:
|
||||
if lang not in video_lang:
|
||||
continue
|
||||
if video_lang[lang] != None:
|
||||
if not isinstance(video_lang[lang], int):
|
||||
video_id = video_lang[lang][0]["video"]
|
||||
post = {"video": video_id, "sub": sub}
|
||||
post = urllib.urlencode(post)
|
||||
data = httptools.downloadpage(video_base_url, post=post).data
|
||||
playlist = jsontools.load(data)
|
||||
sources = playlist[['playlist'][0]]
|
||||
server = playlist['server']
|
||||
for video_link in sources:
|
||||
url = video_link['sources']
|
||||
if url not in duplicated and server!='drive':
|
||||
|
||||
if lang == 'spanish':
|
||||
lang = 'Español'
|
||||
elif 'sub' in lang:
|
||||
lang = 'Subtitulada'
|
||||
lang = lang.capitalize()
|
||||
title = 'Ver en %s [' + lang + ']'
|
||||
thumbnail = servertools.guess_server_thumbnail(server)
|
||||
itemlist.append(item.clone(title=title,
|
||||
url=url,
|
||||
thumbnail=thumbnail,
|
||||
action='play',
|
||||
language=lang
|
||||
|
||||
))
|
||||
duplicated.append(url)
|
||||
if lang == 'spanish':
|
||||
lang = 'Castellano'
|
||||
elif 'sub' in lang:
|
||||
lang = 'Subtitulada'
|
||||
lang = lang.capitalize()
|
||||
title = 'Ver en %s [' + lang + ']'
|
||||
thumbnail = servertools.guess_server_thumbnail(server)
|
||||
itemlist.append(item.clone(title=title,
|
||||
url=url,
|
||||
thumbnail=thumbnail,
|
||||
action='play',
|
||||
language=IDIOMAS[lang]
|
||||
))
|
||||
duplicated.append(url)
|
||||
tmdb.set_infoLabels(itemlist, __modo_grafico__)
|
||||
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
||||
|
||||
itemlist = sorted(itemlist, key=lambda i: i.language)
|
||||
|
||||
# Requerido para FilterTools
|
||||
|
||||
itemlist = filtertools.get_links(itemlist, item, list_language)
|
||||
|
||||
# Requerido para AutoPlay
|
||||
|
||||
autoplay.start(itemlist, item)
|
||||
|
||||
if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos':
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
|
||||
Reference in New Issue
Block a user