Merge remote-tracking branch 'alfa-addon/master' into fixes
This commit is contained in:
+10
-11
@@ -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.5.15" provider-name="Alfa Addon">
|
<addon id="plugin.video.alfa" name="Alfa" version="2.5.16" 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"/>
|
||||||
@@ -18,17 +18,16 @@
|
|||||||
<screenshot>resources/media/themes/ss/4.jpg</screenshot>
|
<screenshot>resources/media/themes/ss/4.jpg</screenshot>
|
||||||
</assets>
|
</assets>
|
||||||
<news>[B]Estos son los cambios para esta versión:[/B]
|
<news>[B]Estos son los cambios para esta versión:[/B]
|
||||||
» dailymotion » ver-peliculas
|
[COLOR green][B]Canales agregados y arreglos[/B][/COLOR]
|
||||||
» poseidonhd » cinedetodo
|
» clipwatching » vidup
|
||||||
» wikiseries » uptobox
|
» allcalidad » descargacineclasico
|
||||||
» allpeliculas » gounlimited
|
» mastorrent » tiotorrent
|
||||||
» pepecine » descargas2020
|
» animeshd » filebebo
|
||||||
» mejortorrent » mispelisyseries
|
» cuevana2 » Cuevana2español
|
||||||
» torrentlocura » torrentrapid
|
» seriesverde » flashx
|
||||||
» tumejortorrent » tvsinpagar
|
|
||||||
» elitetorrent » netutv
|
|
||||||
¤ arreglos internos
|
¤ arreglos internos
|
||||||
¤ Agradecimientos a @angedam, @alaquepasa por colaborar con ésta versión.
|
|
||||||
|
¤ Agradecimientos a @angedam, @alaquepasa, @mrgaturus, @axlt2002 por colaborar con ésta versión.
|
||||||
|
|
||||||
</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>
|
||||||
|
|||||||
@@ -161,8 +161,8 @@ def findvideos(item):
|
|||||||
title = titulo,
|
title = titulo,
|
||||||
url = url
|
url = url
|
||||||
))
|
))
|
||||||
tmdb.set_infoLabels(itemlist, __modo_grafico__)
|
|
||||||
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())
|
||||||
|
tmdb.set_infoLabels(itemlist, __modo_grafico__)
|
||||||
# Requerido para FilterTools
|
# Requerido para FilterTools
|
||||||
itemlist = filtertools.get_links(itemlist, item, list_language)
|
itemlist = filtertools.get_links(itemlist, item, list_language)
|
||||||
|
|
||||||
|
|||||||
@@ -8,5 +8,38 @@
|
|||||||
"banner": "https://s4.postimg.cc/lulxulmql/animeshd-banner.png",
|
"banner": "https://s4.postimg.cc/lulxulmql/animeshd-banner.png",
|
||||||
"categories": [
|
"categories": [
|
||||||
"anime"
|
"anime"
|
||||||
|
],
|
||||||
|
"settings": [
|
||||||
|
{
|
||||||
|
"id": "include_in_global_search",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en busqueda global",
|
||||||
|
"default": false,
|
||||||
|
"enabled": false,
|
||||||
|
"visible": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "filter_languages",
|
||||||
|
"type": "list",
|
||||||
|
"label": "Mostrar enlaces en idioma...",
|
||||||
|
"default": 0,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true,
|
||||||
|
"lvalues": [
|
||||||
|
"No filtrar",
|
||||||
|
"LAT",
|
||||||
|
"CAST",
|
||||||
|
"VOSE"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "comprueba_enlaces_num",
|
||||||
|
"type": "list",
|
||||||
|
"label": "Número de enlaces a verificar",
|
||||||
|
"default": 1,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": "eq(-1,true)",
|
||||||
|
"lvalues": [ "5", "10", "15", "20" ]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ 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
|
||||||
|
from channels import autoplay
|
||||||
|
from channels import filtertools
|
||||||
|
|
||||||
tgenero = {"Comedia": "https://s7.postimg.cc/ne9g9zgwb/comedia.png",
|
tgenero = {"Comedia": "https://s7.postimg.cc/ne9g9zgwb/comedia.png",
|
||||||
"Drama": "https://s16.postimg.cc/94sia332d/drama.png",
|
"Drama": "https://s16.postimg.cc/94sia332d/drama.png",
|
||||||
@@ -31,42 +33,60 @@ tgenero = {"Comedia": "https://s7.postimg.cc/ne9g9zgwb/comedia.png",
|
|||||||
|
|
||||||
host = "http://www.animeshd.tv"
|
host = "http://www.animeshd.tv"
|
||||||
|
|
||||||
headers = [['User-Agent', 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'],
|
__comprueba_enlaces__ = config.get_setting('comprueba_enlaces', 'poseidonhd')
|
||||||
['Referer', host]]
|
__comprueba_enlaces_num__ = config.get_setting('comprueba_enlaces_num', 'poseidonhd')
|
||||||
|
|
||||||
|
|
||||||
|
IDIOMAS = {'Castellano':'CAST','Latino': 'LAT', 'Subtitulado': 'VOSE'}
|
||||||
|
list_language = IDIOMAS.values()
|
||||||
|
list_quality = []
|
||||||
|
list_servers = ['rapidvideo', 'openload', 'gvideo', 'streamango']
|
||||||
|
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
|
autoplay.init(item.channel, list_servers, list_quality)
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Ultimas",
|
|
||||||
|
itemlist.append(item.clone(title="Castellano",
|
||||||
action="lista",
|
action="lista",
|
||||||
thumbnail=get_thumb('last', auto=True),
|
thumbnail=get_thumb('channels_spanish.png'),
|
||||||
fanart='https://s22.postimg.cc/cb7nmhwv5/ultimas.png',
|
fanart='https://s18.postimg.cc/fwvaeo6qh/todas.png',
|
||||||
url=host + '/ultimos'
|
url=host + '/castellano'))
|
||||||
))
|
|
||||||
|
itemlist.append(item.clone(title="Latino",
|
||||||
|
action="lista",
|
||||||
|
thumbnail=get_thumb('channels_latino.png'),
|
||||||
|
fanart='https://s18.postimg.cc/fwvaeo6qh/todas.png',
|
||||||
|
url=host + '/latino'))
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Todas",
|
itemlist.append(item.clone(title="Todas",
|
||||||
action="lista",
|
action="lista",
|
||||||
thumbnail=get_thumb('all', auto=True),
|
thumbnail=get_thumb('all', auto=True),
|
||||||
fanart='https://s18.postimg.cc/fwvaeo6qh/todas.png',
|
fanart='https://s18.postimg.cc/fwvaeo6qh/todas.png',
|
||||||
url=host + '/buscar?t=todos&q='
|
url=host + '/buscar?t=todo&q='))
|
||||||
))
|
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Generos",
|
itemlist.append(item.clone(title="Generos",
|
||||||
action="generos",
|
action="generos",
|
||||||
url=host,
|
url=host,
|
||||||
thumbnail=get_thumb('genres', auto=True),
|
thumbnail=get_thumb('genres', auto=True),
|
||||||
fanart='https://s3.postimg.cc/5s9jg2wtf/generos.png'
|
fanart='https://s3.postimg.cc/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=todo&q=',
|
||||||
thumbnail=get_thumb('search', auto=True),
|
thumbnail=get_thumb('search', auto=True),
|
||||||
fanart='https://s30.postimg.cc/pei7txpa9/buscar.png'
|
fanart='https://s30.postimg.cc/pei7txpa9/buscar.png'
|
||||||
))
|
))
|
||||||
|
|
||||||
|
itemlist = filtertools.show_option(itemlist, item.channel, list_language, list_quality)
|
||||||
|
|
||||||
|
autoplay.show_option(item.channel, itemlist)
|
||||||
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -98,21 +118,22 @@ def lista(item):
|
|||||||
title=title,
|
title=title,
|
||||||
url=url,
|
url=url,
|
||||||
thumbnail=thumbnail,
|
thumbnail=thumbnail,
|
||||||
contentSerieName=title
|
contentSerieName=title,
|
||||||
|
context=filtertools.context(item, list_language, list_quality)
|
||||||
))
|
))
|
||||||
|
|
||||||
# Paginacion
|
# Paginacion
|
||||||
next_page = scrapertools.find_single_match(data,
|
next_page = scrapertools.find_single_match(data,
|
||||||
'<li class=active><span>.*?<\/span><\/li><li><a href=(.*?)>.*?<\/a><\/li>')
|
'<a href=([^ ]+) rel=next>»</a>')
|
||||||
next_page_url = scrapertools.decodeHtmlentities(next_page)
|
next_page_url = scrapertools.decodeHtmlentities(next_page)
|
||||||
if next_page_url != "":
|
if next_page_url != "":
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
action="lista",
|
action="lista",
|
||||||
title=">> Página siguiente",
|
title=">> Página siguiente",
|
||||||
url=next_page_url,
|
url=host+next_page_url,
|
||||||
thumbnail='https://s16.postimg.cc/9okdu7hhx/siguiente.png'
|
thumbnail='https://s16.postimg.cc/9okdu7hhx/siguiente.png'
|
||||||
))
|
))
|
||||||
tmdb.set_infoLabels(itemlist)
|
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -137,7 +158,7 @@ def generos(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
data = get_source(item.url)
|
data = get_source(item.url)
|
||||||
patron = '<li class=><a href=http:\/\/www\.animeshd\.tv\/genero\/(.*?)>(.*?)<\/a><\/li>'
|
patron = '<li class=><a href=https:\/\/www\.animeshd\.tv\/genero\/(.*?)>(.*?)<\/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:
|
||||||
@@ -159,16 +180,59 @@ def episodios(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
data = get_source(item.url)
|
data = get_source(item.url)
|
||||||
patron = '<li id=epi-.*? class=list-group-item ><a href=(.*?) class=badge.*?width=25 title=(.*?)> <\/span>(.*?) (\d+)<\/li>'
|
patron = '<li id=epi-.*? class=list-group-item.*?><a href=(.*?) class=badge.*?width=25 title=(.*?)>.*?<\/span>(' \
|
||||||
|
'.*?) (\d+)<\/li>'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
|
infoLabels = item.infoLabels
|
||||||
for scrapedurl, scrapedlang, scrapedtitle, episode in matches:
|
for scrapedurl, scrapedlang, scrapedtitle, episode in matches:
|
||||||
language = scrapedlang
|
language = scrapedlang
|
||||||
title = scrapedtitle + " " + "1x" + episode
|
title = scrapedtitle + " " + "1x" + episode
|
||||||
url = scrapedurl
|
url = scrapedurl
|
||||||
itemlist.append(item.clone(title=title, url=url, action='findvideos', language=language))
|
infoLabels['season'] ='1'
|
||||||
|
infoLabels['episode'] = episode
|
||||||
|
|
||||||
|
itemlist.append(Item(channel=item.channel, title=title, contentSerieName=item.contentSerieName, url=url,
|
||||||
|
action='findvideos', language=IDIOMAS[language], infoLabels=infoLabels))
|
||||||
|
|
||||||
if config.get_videolibrary_support():
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
itemlist.append(Item(channel=item.channel, title="Añadir serie a la biblioteca", url=item.url, action="add_serie_to_library", extra="episodios", fanart=item.thumbnail, thumbnail=item.thumbnail, contentTitle=item.show, show=item.show))
|
|
||||||
|
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,
|
||||||
|
action="add_serie_to_library", extra="episodios", contentSerieName=item.contentSerieName,
|
||||||
|
extra1='library'))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
def findvideos(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
data = get_source(item.url)
|
||||||
|
patron = "<option value=(.*?) data-content=.*?width='16'> (.*?) <span class='text-muted'>"
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
|
for scrapedurl, language in matches:
|
||||||
|
if 'jpg' in scrapedurl:
|
||||||
|
vip_data = httptools.downloadpage(scrapedurl, follow_redirects=False)
|
||||||
|
scrapedurl = vip_data.headers['location']
|
||||||
|
title = '%s [%s]'
|
||||||
|
itemlist.append(item.clone(title=title, url=scrapedurl.strip(), action='play',
|
||||||
|
language=IDIOMAS[language]))
|
||||||
|
|
||||||
|
itemlist = servertools.get_servers_itemlist(itemlist, lambda x: x.title % (x.server.capitalize(), x.language))
|
||||||
|
|
||||||
|
if __comprueba_enlaces__:
|
||||||
|
itemlist = servertools.check_list_links(itemlist, __comprueba_enlaces_num__)
|
||||||
|
|
||||||
|
# Requerido para FilterTools
|
||||||
|
|
||||||
|
itemlist = filtertools.get_links(itemlist, item, list_language)
|
||||||
|
|
||||||
|
# Requerido para AutoPlay
|
||||||
|
|
||||||
|
autoplay.start(itemlist, item)
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"id": "cuevana2",
|
||||||
|
"name": "Cuevana2",
|
||||||
|
"active": true,
|
||||||
|
"adult": false,
|
||||||
|
"language": ["en"],
|
||||||
|
"thumbnail": "cuevana2.png",
|
||||||
|
"categories": [
|
||||||
|
"movie",
|
||||||
|
"tvshow",
|
||||||
|
"vos"
|
||||||
|
],
|
||||||
|
"settings": [
|
||||||
|
{
|
||||||
|
"id": "modo_grafico",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Buscar información extra",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "include_in_global_search",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en busqueda global",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,290 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import urllib
|
||||||
|
from channelselector import get_thumb
|
||||||
|
|
||||||
|
from core.item import Item
|
||||||
|
from core import httptools
|
||||||
|
from core import jsontools
|
||||||
|
from core import scrapertools
|
||||||
|
from core import servertools
|
||||||
|
from platformcode import config, logger
|
||||||
|
from channels import autoplay
|
||||||
|
|
||||||
|
host = "http://www.cuevana2.com/"
|
||||||
|
list_quality = []
|
||||||
|
list_servers = ['rapidvideo', 'streamango', 'directo', 'yourupload', 'openload', 'dostream']
|
||||||
|
|
||||||
|
### MENUS ###
|
||||||
|
|
||||||
|
def mainlist(item):
|
||||||
|
logger.info()
|
||||||
|
autoplay.init(item.channel, list_servers, list_quality)
|
||||||
|
itemlist = []
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Peliculas", action = "movies_menu",
|
||||||
|
url = host + "pelicula", thumbnail = get_thumb("movies", auto = True)))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Series", action = "shows_menu",
|
||||||
|
url = host + "pelicula", thumbnail = get_thumb("tvshows", auto = True) ))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Buscar...", action = "search",
|
||||||
|
url = host + "search/", thumbnail = get_thumb("search", auto = True)))
|
||||||
|
autoplay.show_option(item.channel, itemlist)
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def movies_menu(item):
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Novedades", action = "movies",
|
||||||
|
url = host + "pelicula", thumbnail = get_thumb("newest", auto = True)))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Por género", action = "genre",
|
||||||
|
url = host + "pelicula", thumbnail = get_thumb("genres", auto = True) ))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Por año", action = "age",
|
||||||
|
url = host + "pelicula", thumbnail = get_thumb("year", auto = True)))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Favoritas", action = "movies",
|
||||||
|
url = host + "peliculas-destacadas", thumbnail = get_thumb("favorites", auto = True) ))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = ""))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Buscar...", action = "search",
|
||||||
|
url = host + "search/", thumbnail = get_thumb("search", auto = True)))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def shows_menu(item):
|
||||||
|
itemlist = []
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Todas las Series", action = "shows",
|
||||||
|
url = host + "listar-series", thumbnail = get_thumb("tvshows", auto = True)))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Buscar...", action = "search", extra='1',
|
||||||
|
url = host + "listar-series", thumbnail = get_thumb("search", auto = True)))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
### FIN MENUS ###
|
||||||
|
def inArray(arr, arr2):
|
||||||
|
for word in arr:
|
||||||
|
if word not in arr2:
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
def load_data(url):
|
||||||
|
data = httptools.downloadpage(url).data
|
||||||
|
data = re.sub(r"\n|\r|\t| |<br>", "", data)
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
def put_movies(itemlist, item, data, pattern):
|
||||||
|
matches = scrapertools.find_multiple_matches(data, pattern)
|
||||||
|
for link, img, title, rating, plot in matches:
|
||||||
|
if 'pelicula' in link:
|
||||||
|
itemTitle = "%s [COLOR yellow](%s/100)[/COLOR]" % (title, rating)
|
||||||
|
itemlist.append(Item(channel = item.channel, title=itemTitle, fulltitle=title, thumbnail=img,
|
||||||
|
url=link, plot=plot, action="findvideos"))
|
||||||
|
logger.info(link)
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def put_episodes(itemlist, item, text):
|
||||||
|
pattern = '<li>.*?ref="([^"]+).*?"tit">(.*?)</span>'
|
||||||
|
|
||||||
|
matches = scrapertools.find_multiple_matches(text, pattern)
|
||||||
|
for link, title in matches:
|
||||||
|
itemlist.append(item.clone(title=title, fulltitle=item.title, url=link, action='findvideos', extra=1))
|
||||||
|
|
||||||
|
def episodes(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
data = load_data(item.url)
|
||||||
|
seasonsPattern = '"#episodios(\d+)".*?>(.*?)</a>'
|
||||||
|
episodesPattern = 'id="episodios%s">(.*?)</ul>'
|
||||||
|
|
||||||
|
matches = scrapertools.find_multiple_matches(data, seasonsPattern)
|
||||||
|
for season, title in matches:
|
||||||
|
itemlist.append(Item(channel = item.channel, title="[COLOR blue]%s[/COLOR]" % title))
|
||||||
|
episodeMatches = scrapertools.find_single_match(data, episodesPattern % season)
|
||||||
|
put_episodes(itemlist, item, episodeMatches)
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def shows(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
data = load_data(item.url)
|
||||||
|
pattern = '"in"><a href="([^"]+)">(.*?)</a>'
|
||||||
|
|
||||||
|
matches = scrapertools.find_multiple_matches(data, pattern)
|
||||||
|
for link, title in matches:
|
||||||
|
itemlist.append(Item(channel = item.channel, title=title, url=host + link, action="episodes"))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def movies(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
#descarga la pagina html
|
||||||
|
data = load_data(item.url)
|
||||||
|
|
||||||
|
#patron para buscar las peliculas
|
||||||
|
pattern = '<a href="([^"]+)"><div class="img">' #link
|
||||||
|
pattern += '<img width="120" height="160" src="([^"]+)" class="attachment-thumbnail wp-post-image" alt="([^"]+)".*?' #img and title
|
||||||
|
pattern += '<span style="width:([0-9]+)%">.*?'
|
||||||
|
pattern += '"txt">(.*?)</div>' # text
|
||||||
|
|
||||||
|
put_movies(itemlist, item, data, pattern)
|
||||||
|
|
||||||
|
next_page = scrapertools.find_single_match(data, '<a class="nextpostslink" rel="next" href="([^"]+)">')
|
||||||
|
if next_page:
|
||||||
|
itemlist.append(Item(channel = item.channel, title='Siguiente Pagina', url=next_page, action="movies"))
|
||||||
|
|
||||||
|
#coloca las peliculas encontradas en la lista
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def searchShows(itemlist, item, texto):
|
||||||
|
texto = texto.lower().split()
|
||||||
|
data = load_data(item.url)
|
||||||
|
|
||||||
|
pattern = '"in"><a href="([^"]+)">(.*?)</a>'
|
||||||
|
|
||||||
|
matches = scrapertools.find_multiple_matches(data, pattern)
|
||||||
|
for link, title in matches:
|
||||||
|
keywords = title.lower().split()
|
||||||
|
logger.info(keywords)
|
||||||
|
logger.info(texto)
|
||||||
|
|
||||||
|
if inArray(texto, keywords):
|
||||||
|
itemlist.append(Item(channel = item.channel, title=title, url=host + link, action="episodes"))
|
||||||
|
|
||||||
|
def searchMovies(itemlist, item, texto):
|
||||||
|
texto = texto.replace(' ', '+').lower()
|
||||||
|
data = load_data(item.url + texto)
|
||||||
|
#patron para buscar las peliculas
|
||||||
|
pattern = '<a href="([^"]+)"><div class="img">' #link
|
||||||
|
pattern += '<img width="120" height="160" src="([^"]+)" class="attachment-thumbnail wp-post-image" alt="([^"]+)".*?' #img and title
|
||||||
|
pattern += '<span style="width:([0-9]+)%">.*?'
|
||||||
|
pattern += '"txt">(.*?)</div>' # text
|
||||||
|
|
||||||
|
#coloca las peliculas encontradas en la lista, improvisando do while
|
||||||
|
next_page = True
|
||||||
|
while next_page:
|
||||||
|
put_movies(itemlist, data, pattern)
|
||||||
|
next_page = scrapertools.find_single_match(data, '<a class="nextpostslink" rel="next" href="([^"]+)">')
|
||||||
|
|
||||||
|
if next_page:
|
||||||
|
data = load_data(next_page)
|
||||||
|
|
||||||
|
def search(item, texto):
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
if item.extra:
|
||||||
|
searchShows(itemlist, item, texto)
|
||||||
|
else:
|
||||||
|
searchMovies(itemlist, item, texto)
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def by(item, pattern):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
#descarga la pagina html
|
||||||
|
data = load_data(item.url)
|
||||||
|
|
||||||
|
#patron para buscar en la pagina
|
||||||
|
pattern = '<li class="cat-item cat-item-\d+"><a href="([^"]+)" >&&</a>'.replace('&&', pattern)
|
||||||
|
|
||||||
|
matches = scrapertools.find_multiple_matches(data, pattern)
|
||||||
|
for link, genre in matches:
|
||||||
|
itemlist.append(Item(channel = item.channel, title=genre, url=link, action="movies"))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def genre(item):
|
||||||
|
return by(item, '(\D+)')
|
||||||
|
|
||||||
|
def age(item):
|
||||||
|
return by(item, '(\d+)')
|
||||||
|
|
||||||
|
def GKPluginLink(hash):
|
||||||
|
hashdata = urllib.urlencode({r'link':hash})
|
||||||
|
json = httptools.downloadpage('https://player4.cuevana2.com/plugins/gkpluginsphp.php', post=hashdata).data
|
||||||
|
return jsontools.load(json)['link'] if json else ''
|
||||||
|
|
||||||
|
#el pattern esta raro para eliminar los duplicados, de todas formas asi es un lenguaje de programacion verificando su sintaxis
|
||||||
|
def getContentMovie(data, item):
|
||||||
|
item.infoLabels["year"] = scrapertools.find_single_match(data, 'rel="tag">(\d+)</a>')
|
||||||
|
genre = ''
|
||||||
|
for found_genre in scrapertools.find_multiple_matches(data, 'genero/.*?">(.*?)</a>(?=.*?</p>)'):
|
||||||
|
genre += found_genre + ', '
|
||||||
|
item.infoLabels["genre"] = genre.strip(', ')
|
||||||
|
|
||||||
|
director = ''
|
||||||
|
for found_director in scrapertools.find_multiple_matches(data, 'director/.*?">(.*?)</a>(?=.*?</p>)'):
|
||||||
|
director += found_director + ', '
|
||||||
|
item.infoLabels["director"] = director.strip(', ')
|
||||||
|
|
||||||
|
item.infoLabels["cast"] = tuple(found_cast for found_cast in scrapertools.find_multiple_matches(
|
||||||
|
data, 'reparto/.*?">(.*?)</a>(?=.*?</p>)'))
|
||||||
|
|
||||||
|
def getContentShow(data, item):
|
||||||
|
item.thumbnail = scrapertools.find_single_match(data, 'width="120" height="160" src="([^"]+)"')
|
||||||
|
item.infoLabels['genre'] = scrapertools.find_single_match(data, '-4px;">(.*?)</div>')
|
||||||
|
|
||||||
|
def findvideos(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
data = load_data(item.url)
|
||||||
|
if item.extra:
|
||||||
|
getContentShow(data, item)
|
||||||
|
else:
|
||||||
|
getContentMovie(data, item)
|
||||||
|
pattern = '<iframe width="650" height="450" scrolling="no" src="([^"]+)'
|
||||||
|
subtitles = scrapertools.find_single_match(data, '<iframe width="650" height="450" scrolling="no" src=".*?sub=([^"]+)"')
|
||||||
|
|
||||||
|
#itemlist.append(Item(channel = item.channel, title=item.url))
|
||||||
|
for link in scrapertools.find_multiple_matches(data, pattern):
|
||||||
|
#php.*?=(\w+)&
|
||||||
|
#url=(.*?)&
|
||||||
|
if 'player4' in link:
|
||||||
|
if r'ir.php' in link:
|
||||||
|
link = scrapertools.find_single_match(link, 'php\?url=(.*?)&').replace('%3A', ':').replace('%2F', '/')
|
||||||
|
logger.info("CUEVANA IR %s" % link)
|
||||||
|
elif r'gdv.php' in link:
|
||||||
|
# google drive hace lento la busqueda de links, ademas no es tan buena opcion y es el primero que eliminan
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
link = scrapertools.find_single_match(link, 'php.*?=(\w+)&')
|
||||||
|
link = GKPluginLink(link)
|
||||||
|
if not link:
|
||||||
|
continue
|
||||||
|
|
||||||
|
title = "[COLOR blue]Servidor [%s][/COLOR]"
|
||||||
|
elif 'youtube' in link:
|
||||||
|
title = "[COLOR yellow]Ver Trailer (%s)[/COLOR]"
|
||||||
|
else: # En caso de que exista otra cosa no implementada, reportar si no aparece pelicula
|
||||||
|
continue
|
||||||
|
|
||||||
|
# GKplugin puede devolver multiples links con diferentes calidades, si se pudiera colocar una lista de opciones
|
||||||
|
# personalizadas para Directo, se agradece, por ahora solo devuelve el primero que encuentre
|
||||||
|
if type(link) is list:
|
||||||
|
link = link[0]['link']
|
||||||
|
if r'chomikuj.pl' in link:
|
||||||
|
# En algunas personas la opcion CH les da error 401
|
||||||
|
link += "|Referer=https://player4.cuevana2.com/plugins/gkpluginsphp.php"
|
||||||
|
|
||||||
|
itemlist.append(
|
||||||
|
item.clone(
|
||||||
|
channel = item.channel,
|
||||||
|
title=title,
|
||||||
|
url=link, action='play',
|
||||||
|
subtitle=subtitles))
|
||||||
|
|
||||||
|
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
||||||
|
autoplay.start(itemlist, item)
|
||||||
|
|
||||||
|
if config.get_videolibrary_support() and len(itemlist):
|
||||||
|
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.fulltitle
|
||||||
|
))
|
||||||
|
return itemlist
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"id": "cuevana2espanol",
|
||||||
|
"name": "Cuevana2español",
|
||||||
|
"active": true,
|
||||||
|
"adult": false,
|
||||||
|
"language": ["lat"],
|
||||||
|
"thumbnail": "cuevana2espanol.png",
|
||||||
|
"categories": [
|
||||||
|
"movie"
|
||||||
|
],
|
||||||
|
"settings": [
|
||||||
|
{
|
||||||
|
"id": "modo_grafico",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Buscar información extra",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "include_in_global_search",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en busqueda global",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import re
|
||||||
|
import urllib
|
||||||
|
from channelselector import get_thumb
|
||||||
|
|
||||||
|
from core.item import Item
|
||||||
|
from core import httptools
|
||||||
|
from core import jsontools
|
||||||
|
from core import scrapertools
|
||||||
|
from core import servertools
|
||||||
|
from platformcode import config, logger
|
||||||
|
from channels import autoplay
|
||||||
|
|
||||||
|
host = "http://cuevana2espanol.com/"
|
||||||
|
list_quality = []
|
||||||
|
list_servers = ['rapidvideo', 'streamango', 'directo', 'yourupload', 'openload', 'dostream']
|
||||||
|
|
||||||
|
def load_data(url):
|
||||||
|
data = httptools.downloadpage(url).data
|
||||||
|
data = re.sub(r"\n|\r|\t| |<br>", "", data)
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
def mainlist(item):
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
autoplay.init(item.channel, list_servers, list_quality)
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Novedades", action = "movies",
|
||||||
|
url = host + "ver-pelicula-online", thumbnail = get_thumb("newest", auto = True)))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Favoritas", action = "movies",
|
||||||
|
url = host + "calificaciones", thumbnail = get_thumb("favorites", auto = True) ))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Destacadas", action = "movies",
|
||||||
|
url = host + "tendencias", thumbnail = get_thumb("hot", auto = True)))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Ranking IMDB", action = "moviesIMDB",
|
||||||
|
url = host + "raking-imdb", thumbnail = get_thumb("hot", auto = True) ))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = ""))
|
||||||
|
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)
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def movies(item):
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
data = load_data(item.url)
|
||||||
|
pattern = 'class="poster"><img src="([^"]+)" alt="([^"]+)".*?'
|
||||||
|
pattern += '</span> (.*?)</div>.*?'
|
||||||
|
pattern += 'href="([^"]+)".*?'
|
||||||
|
pattern += '<span>(\d+)</span>.*?'
|
||||||
|
|
||||||
|
matches = scrapertools.find_multiple_matches(data, pattern)
|
||||||
|
for img, title, ranking, link, age in matches:
|
||||||
|
itemTitle = "%s [COLOR yellow](%s)[/COLOR] [COLOR blue](%s)[/COLOR]" % (title, ranking, age)
|
||||||
|
itemlist.append(Item(channel = item.channel, title=itemTitle, fulltitle=title, thumbnail=img,
|
||||||
|
url=link, action="findvideos"))
|
||||||
|
|
||||||
|
next_page = scrapertools.find_single_match(data, 'href="([^"]+)" ><span class="icon-chevron-right">')
|
||||||
|
if next_page:
|
||||||
|
itemlist.append(Item(channel = item.channel, title="Siguiente Pagina",
|
||||||
|
url=next_page, action="movies"))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def moviesIMDB(item):
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
data = load_data(item.url)
|
||||||
|
pattern = '"poster"><a href="([^"]+)"><img src="([^"]+)".*?'
|
||||||
|
pattern += 'class="puesto">(\d+)</div>.*?'
|
||||||
|
pattern += '"rating">(.*?)</div>.*?'
|
||||||
|
pattern += '"title">.*?>(.*?)</a>'
|
||||||
|
|
||||||
|
matches = scrapertools.find_multiple_matches(data, pattern)
|
||||||
|
for link, img, rank, rating, title in matches:
|
||||||
|
itemTitle = "%s [COLOR blue](#%s)[/COLOR] [COLOR yellow](%s)[/COLOR]" % (title, rank, rating)
|
||||||
|
img = img.replace('-90x135', '')
|
||||||
|
|
||||||
|
itemlist.append(Item(channel = item.channel, title=itemTitle, fulltitle=title, thumbnail=img,
|
||||||
|
url=link, action="findvideos"))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def searchMovies(item):
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
data = load_data(item.url)
|
||||||
|
pattern = 'class="image">.*?href="([^"]+)".*?'
|
||||||
|
pattern += 'src="([^"]+)" alt="([^"]+)".*?'
|
||||||
|
pattern += 'class="year">(\d+)</span>.*?'
|
||||||
|
pattern += '<p>(.*?)</p>'
|
||||||
|
|
||||||
|
matches = scrapertools.find_multiple_matches(data, pattern)
|
||||||
|
for link, img, title, year, plot in matches:
|
||||||
|
itemTitle = "%s [COLOR blue](%s)[/COLOR]" % (title, year)
|
||||||
|
|
||||||
|
itemlist.append(Item(channel = item.channel, title=itemTitle, fulltitle=title, thumbnail=img,
|
||||||
|
url=link, plot=plot, action="findvideos"))
|
||||||
|
|
||||||
|
next_page = scrapertools.find_single_match(data, 'href="([^"]+)" ><span class="icon-chevron-right">')
|
||||||
|
if next_page:
|
||||||
|
itemlist.append(Item(channel = item.channel, title="Siguiente Pagina",
|
||||||
|
url=next_page, action="searchMovies"))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def search(item, text):
|
||||||
|
text = text.lower().replace(' ', '+')
|
||||||
|
item.url += text
|
||||||
|
|
||||||
|
return searchMovies(item)
|
||||||
|
|
||||||
|
def GKPluginLink(hash):
|
||||||
|
hashdata = urllib.urlencode({r'link':hash})
|
||||||
|
json = httptools.downloadpage('https://player4.cuevana2.com/plugins/gkpluginsphp.php', post=hashdata).data
|
||||||
|
return jsontools.load(json)['link'] if json else ''
|
||||||
|
|
||||||
|
def getContent(item, data):
|
||||||
|
item.infoLabels["year"] = scrapertools.find_single_match(data, 'class="date">.*?(\d+)</span>')
|
||||||
|
item.plot = scrapertools.find_single_match(data, 'class="wp-content"><p>(.*?)</p>')
|
||||||
|
genres = ''
|
||||||
|
for genre in scrapertools.find_multiple_matches(data, '/genero/.*?"tag">(.*?)</a>'):
|
||||||
|
genres += genre + ', '
|
||||||
|
|
||||||
|
item.infoLabels['genre'] = genres.strip(', ')
|
||||||
|
|
||||||
|
def findvideos(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
data = load_data(item.url)
|
||||||
|
getContent(item, data)
|
||||||
|
"""
|
||||||
|
if item.extra:
|
||||||
|
getContentShow(data, item)
|
||||||
|
else:
|
||||||
|
getContentMovie(data, item)
|
||||||
|
"""
|
||||||
|
pattern = '<iframe class="metaframe rptss" src="([^"]+)"'
|
||||||
|
|
||||||
|
#itemlist.append(Item(channel = item.channel, title=item.url))
|
||||||
|
for link in scrapertools.find_multiple_matches(data, pattern):
|
||||||
|
#php.*?=(\w+)&
|
||||||
|
#url=(.*?)&
|
||||||
|
if 'player4' in link:
|
||||||
|
logger.info("CUEVANA LINK %s" % link)
|
||||||
|
if r'ir.php' in link:
|
||||||
|
link = scrapertools.find_single_match(link, 'php.*?=(.*)').replace('%3A', ':').replace('%2F', '/')
|
||||||
|
logger.info("CUEVANA IR %s" % link)
|
||||||
|
elif r'gdv.php' in link:
|
||||||
|
# google drive hace lento la busqueda de links, ademas no es tan buena opcion y es el primero que eliminan
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
link = scrapertools.find_single_match(link, 'php.*?=(\w+)')
|
||||||
|
link = GKPluginLink(link)
|
||||||
|
if not link:
|
||||||
|
continue
|
||||||
|
|
||||||
|
title = "[COLOR blue]Servidor [%s][/COLOR]"
|
||||||
|
elif 'youtube' in link:
|
||||||
|
title = "[COLOR yellow]Ver Trailer (%s)[/COLOR]"
|
||||||
|
else: # En caso de que exista otra cosa no implementada, reportar si no aparece pelicula
|
||||||
|
continue
|
||||||
|
|
||||||
|
# GKplugin puede devolver multiples links con diferentes calidades, si se pudiera colocar una lista de opciones
|
||||||
|
# personalizadas para Directo, se agradece, por ahora solo devuelve el primero que encuentre
|
||||||
|
if type(link) is list:
|
||||||
|
link = link[0]['link']
|
||||||
|
if r'chomikuj.pl' in link:
|
||||||
|
# En algunas personas la opcion CH les da error 401
|
||||||
|
link += "|Referer=https://player4.cuevana2.com/plugins/gkpluginsphp.php"
|
||||||
|
|
||||||
|
itemlist.append(
|
||||||
|
item.clone(
|
||||||
|
channel = item.channel,
|
||||||
|
title=title,
|
||||||
|
url=link, action='play'))
|
||||||
|
|
||||||
|
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
||||||
|
autoplay.start(itemlist, item)
|
||||||
|
|
||||||
|
if config.get_videolibrary_support() and len(itemlist):
|
||||||
|
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.fulltitle
|
||||||
|
))
|
||||||
|
return itemlist
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from channelselector import get_thumb
|
from channelselector import get_thumb
|
||||||
from platformcode import logger
|
from platformcode import logger, config
|
||||||
from core import scrapertools, httptools
|
from core import scrapertools, httptools
|
||||||
from core import servertools
|
from core import servertools
|
||||||
from core import tmdb
|
from core import tmdb
|
||||||
@@ -86,7 +86,6 @@ def agregadas(item):
|
|||||||
thumbnail=thumbnail,
|
thumbnail=thumbnail,
|
||||||
plot=plot,
|
plot=plot,
|
||||||
show=title) )
|
show=title) )
|
||||||
scrapertools.printMatches(itemlist)
|
|
||||||
tmdb.set_infoLabels(itemlist)
|
tmdb.set_infoLabels(itemlist)
|
||||||
# Paginación
|
# Paginación
|
||||||
try:
|
try:
|
||||||
@@ -116,8 +115,20 @@ def findvideos(item):
|
|||||||
itemlist.append( item.clone(action="play",
|
itemlist.append( item.clone(action="play",
|
||||||
title=title,
|
title=title,
|
||||||
url=scrapedurl) )
|
url=scrapedurl) )
|
||||||
tmdb.set_infoLabels(itemlist)
|
|
||||||
itemlist = servertools.get_servers_itemlist(itemlist)
|
itemlist = servertools.get_servers_itemlist(itemlist)
|
||||||
|
tmdb.set_infoLabels(itemlist)
|
||||||
|
if itemlist:
|
||||||
|
itemlist.append(Item(channel = item.channel))
|
||||||
|
itemlist.append(item.clone(channel="trailertools", title="Buscar Tráiler", action="buscartrailer", context="",
|
||||||
|
text_color="magenta"))
|
||||||
|
# Opción "Añadir esta película a la biblioteca de KODI"
|
||||||
|
if item.extra != "library":
|
||||||
|
if config.get_videolibrary_support():
|
||||||
|
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,
|
||||||
|
contentTitle = item.contentTitle
|
||||||
|
))
|
||||||
|
return itemlist
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ from core import jsontools
|
|||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
from platformcode import platformtools
|
from platformcode import platformtools
|
||||||
|
from core import channeltools
|
||||||
|
|
||||||
TAG_TVSHOW_FILTER = "TVSHOW_FILTER"
|
TAG_TVSHOW_FILTER = "TVSHOW_FILTER"
|
||||||
TAG_NAME = "name"
|
TAG_NAME = "name"
|
||||||
@@ -405,74 +406,87 @@ def config_item(item):
|
|||||||
dict_series = jsontools.get_node_from_file(item.from_channel, TAG_TVSHOW_FILTER)
|
dict_series = jsontools.get_node_from_file(item.from_channel, TAG_TVSHOW_FILTER)
|
||||||
|
|
||||||
tvshow = item.show.lower().strip()
|
tvshow = item.show.lower().strip()
|
||||||
|
default_lang = ''
|
||||||
|
|
||||||
lang_selected = dict_series.get(tvshow, {}).get(TAG_LANGUAGE, 'Español')
|
channel_parameters = channeltools.get_channel_parameters(item.from_channel)
|
||||||
list_quality = dict_series.get(tvshow, {}).get(TAG_QUALITY_ALLOWED, [x.lower() for x in item.list_quality])
|
list_language = channel_parameters["filter_languages"]
|
||||||
# logger.info("lang selected {}".format(lang_selected))
|
try:
|
||||||
# logger.info("list quality {}".format(list_quality))
|
if channel_parameters["filter_languages"] != '' and len(list_language) > 0:
|
||||||
|
default_lang = list_language[1]
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
active = True
|
if default_lang == '':
|
||||||
custom_button = {'visible': False}
|
platformtools.dialog_notification("FilterTools", "No hay idiomas definidos")
|
||||||
allow_option = False
|
return
|
||||||
if item.show.lower().strip() in dict_series:
|
else:
|
||||||
allow_option = True
|
lang_selected = dict_series.get(tvshow, {}).get(TAG_LANGUAGE, default_lang)
|
||||||
active = dict_series.get(item.show.lower().strip(), {}).get(TAG_ACTIVE, False)
|
list_quality = dict_series.get(tvshow, {}).get(TAG_QUALITY_ALLOWED, [x.lower() for x in item.list_quality])
|
||||||
custom_button = {'label': 'Borrar', 'function': 'delete', 'visible': True, 'close': True}
|
# logger.info("lang selected {}".format(lang_selected))
|
||||||
|
# logger.info("list quality {}".format(list_quality))
|
||||||
|
|
||||||
list_controls = []
|
active = True
|
||||||
|
custom_button = {'visible': False}
|
||||||
|
allow_option = False
|
||||||
|
if item.show.lower().strip() in dict_series:
|
||||||
|
allow_option = True
|
||||||
|
active = dict_series.get(item.show.lower().strip(), {}).get(TAG_ACTIVE, False)
|
||||||
|
custom_button = {'label': 'Borrar', 'function': 'delete', 'visible': True, 'close': True}
|
||||||
|
|
||||||
if allow_option:
|
list_controls = []
|
||||||
active_control = {
|
|
||||||
"id": "active",
|
|
||||||
"type": "bool",
|
|
||||||
"label": "¿Activar/Desactivar filtro?",
|
|
||||||
"color": "",
|
|
||||||
"default": active,
|
|
||||||
"enabled": allow_option,
|
|
||||||
"visible": allow_option,
|
|
||||||
}
|
|
||||||
list_controls.append(active_control)
|
|
||||||
|
|
||||||
language_option = {
|
if allow_option:
|
||||||
"id": "language",
|
active_control = {
|
||||||
"type": "list",
|
"id": "active",
|
||||||
"label": "Idioma",
|
|
||||||
"color": "0xFFee66CC",
|
|
||||||
"default": item.list_language.index(lang_selected),
|
|
||||||
"enabled": True,
|
|
||||||
"visible": True,
|
|
||||||
"lvalues": item.list_language
|
|
||||||
}
|
|
||||||
list_controls.append(language_option)
|
|
||||||
|
|
||||||
if item.list_quality:
|
|
||||||
list_controls_calidad = [
|
|
||||||
{
|
|
||||||
"id": "textoCalidad",
|
|
||||||
"type": "label",
|
|
||||||
"label": "Calidad permitida",
|
|
||||||
"color": "0xffC6C384",
|
|
||||||
"enabled": True,
|
|
||||||
"visible": True,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
for element in sorted(item.list_quality, key=str.lower):
|
|
||||||
list_controls_calidad.append({
|
|
||||||
"id": element,
|
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"label": element,
|
"label": "¿Activar/Desactivar filtro?",
|
||||||
"default": (False, True)[element.lower() in list_quality],
|
"color": "",
|
||||||
"enabled": True,
|
"default": active,
|
||||||
"visible": True,
|
"enabled": allow_option,
|
||||||
})
|
"visible": allow_option,
|
||||||
|
}
|
||||||
|
list_controls.append(active_control)
|
||||||
|
|
||||||
# concatenamos list_controls con list_controls_calidad
|
language_option = {
|
||||||
list_controls.extend(list_controls_calidad)
|
"id": "language",
|
||||||
|
"type": "list",
|
||||||
|
"label": "Idioma",
|
||||||
|
"color": "0xFFee66CC",
|
||||||
|
"default": item.list_language.index(lang_selected),
|
||||||
|
"enabled": True,
|
||||||
|
"visible": True,
|
||||||
|
"lvalues": item.list_language
|
||||||
|
}
|
||||||
|
list_controls.append(language_option)
|
||||||
|
|
||||||
title = "Filtrado de enlaces para: [COLOR %s]%s[/COLOR]" % (COLOR.get("selected", "auto"), item.show)
|
if item.list_quality:
|
||||||
|
list_controls_calidad = [
|
||||||
|
{
|
||||||
|
"id": "textoCalidad",
|
||||||
|
"type": "label",
|
||||||
|
"label": "Calidad permitida",
|
||||||
|
"color": "0xffC6C384",
|
||||||
|
"enabled": True,
|
||||||
|
"visible": True,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
for element in sorted(item.list_quality, key=str.lower):
|
||||||
|
list_controls_calidad.append({
|
||||||
|
"id": element,
|
||||||
|
"type": "bool",
|
||||||
|
"label": element,
|
||||||
|
"default": (False, True)[element.lower() in list_quality],
|
||||||
|
"enabled": True,
|
||||||
|
"visible": True,
|
||||||
|
})
|
||||||
|
|
||||||
platformtools.show_channel_settings(list_controls=list_controls, callback='save', item=item,
|
# concatenamos list_controls con list_controls_calidad
|
||||||
caption=title, custom_button=custom_button)
|
list_controls.extend(list_controls_calidad)
|
||||||
|
|
||||||
|
title = "Filtrado de enlaces para: [COLOR %s]%s[/COLOR]" % (COLOR.get("selected", "auto"), item.show)
|
||||||
|
|
||||||
|
platformtools.show_channel_settings(list_controls=list_controls, callback='save', item=item,
|
||||||
|
caption=title, custom_button=custom_button)
|
||||||
|
|
||||||
|
|
||||||
def delete(item, dict_values):
|
def delete(item, dict_values):
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"id": "mastorrents",
|
||||||
|
"name": "MasTorrents",
|
||||||
|
"active": true,
|
||||||
|
"adult": false,
|
||||||
|
"language": ["cast","lat"],
|
||||||
|
"thumbnail": "https://s33.postimg.cc/3y8720l9b/mastorrents.png",
|
||||||
|
"banner": "",
|
||||||
|
"version": 1,
|
||||||
|
"categories": [
|
||||||
|
"movie",
|
||||||
|
"tvshow",
|
||||||
|
"torrent"
|
||||||
|
],
|
||||||
|
"settings": [
|
||||||
|
{
|
||||||
|
"id": "include_in_newest_peliculas",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en Novedades - Peliculas",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "include_in_newest_torrent",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en Novedades - Torrent",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,323 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# -*- Channel MasTorrents -*-
|
||||||
|
# -*- Created for Alfa-addon -*-
|
||||||
|
# -*- By the Alfa Develop Group -*-
|
||||||
|
|
||||||
|
import re
|
||||||
|
from channelselector import get_thumb
|
||||||
|
from platformcode import logger
|
||||||
|
from platformcode import config
|
||||||
|
from core import scrapertools
|
||||||
|
from core.item import Item
|
||||||
|
from core import servertools
|
||||||
|
from core import httptools
|
||||||
|
from core import tmdb
|
||||||
|
|
||||||
|
host = 'http://www.mastorrents.com/'
|
||||||
|
|
||||||
|
def mainlist(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
itemlist.append(item.clone(title="Peliculas",
|
||||||
|
action="movie_list",
|
||||||
|
thumbnail=get_thumb("channels_movie.png")
|
||||||
|
))
|
||||||
|
|
||||||
|
itemlist.append(item.clone(title="Series",
|
||||||
|
action="series_list",
|
||||||
|
thumbnail=get_thumb("channels_tvshow.png")
|
||||||
|
))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def movie_list(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
itemlist.append(item.clone(title="Todas",
|
||||||
|
action="lista",
|
||||||
|
url=host+'peliculas',
|
||||||
|
extra='movie',
|
||||||
|
thumbnail=get_thumb('all', auto=True)
|
||||||
|
))
|
||||||
|
|
||||||
|
itemlist.append(item.clone(title="Generos",
|
||||||
|
action="genres",
|
||||||
|
url=host,
|
||||||
|
extra='movie',
|
||||||
|
thumbnail=get_thumb('genres', auto=True)
|
||||||
|
))
|
||||||
|
|
||||||
|
itemlist.append(item.clone(title="Buscar",
|
||||||
|
action="search",
|
||||||
|
url=host + '?pTit=', thumbnail=get_thumb('search', auto=True),
|
||||||
|
extra='movie'
|
||||||
|
))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def series_list(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
itemlist.append(item.clone(title="Todas",
|
||||||
|
action="lista",
|
||||||
|
url=host + 'series',
|
||||||
|
extra='serie',
|
||||||
|
thumbnail=get_thumb('all', auto=True)
|
||||||
|
))
|
||||||
|
|
||||||
|
itemlist.append(item.clone(title="Generos",
|
||||||
|
action="genres",
|
||||||
|
url=host + 'series/',
|
||||||
|
extra='serie',
|
||||||
|
thumbnail=get_thumb('genres', auto=True)
|
||||||
|
))
|
||||||
|
|
||||||
|
itemlist.append(item.clone(title="Buscar",
|
||||||
|
action="search",
|
||||||
|
url=host + 'series/?pTit=',
|
||||||
|
extra='serie',
|
||||||
|
thumbnail=get_thumb('search', auto=True)
|
||||||
|
))
|
||||||
|
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 lista (item):
|
||||||
|
logger.info ()
|
||||||
|
itemlist = []
|
||||||
|
infoLabels = dict()
|
||||||
|
data = get_source(item.url)
|
||||||
|
patron = "<div class=moviesbox>.*?</div><a href=(.*?)><div class=moviesbox_img style=background-image:url\('("
|
||||||
|
patron += ".*?)'\)>.*?tooltipbox>(.*?)(?: <i>| <br /><i>)(.*?)<"
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
|
for scrapedurl, scrapedthumbnail, scrapedtitle, extra_data in matches:
|
||||||
|
extra_data = extra_data.replace('(','').replace(')','')
|
||||||
|
url = scrapedurl
|
||||||
|
thumbnail = scrapedthumbnail
|
||||||
|
contentTitle = scrapedtitle.decode('latin1').encode('utf8')
|
||||||
|
title = contentTitle
|
||||||
|
|
||||||
|
tvshow = False
|
||||||
|
if 'x' in extra_data:
|
||||||
|
tvshow = True
|
||||||
|
filtro_thumb = scrapedthumbnail.replace("https://image.tmdb.org/t/p/w200_and_h300_bestv2", "")
|
||||||
|
filtro_list = {"poster_path": filtro_thumb}
|
||||||
|
filtro_list = filtro_list.items()
|
||||||
|
infoLabels['filtro']= filtro_list
|
||||||
|
else:
|
||||||
|
infoLabels['year']=extra_data
|
||||||
|
new_item=(Item(channel=item.channel,
|
||||||
|
action='findvideos',
|
||||||
|
title=title,
|
||||||
|
url=url,
|
||||||
|
thumbnail=thumbnail,
|
||||||
|
infoLabels=infoLabels,
|
||||||
|
extra=item.extra
|
||||||
|
))
|
||||||
|
if tvshow:
|
||||||
|
new_item.contentSerieName = contentTitle
|
||||||
|
new_item.action = 'seasons'
|
||||||
|
else:
|
||||||
|
new_item.contentTitle = contentTitle
|
||||||
|
new_item.action = 'findvideos'
|
||||||
|
itemlist.append(new_item)
|
||||||
|
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb =True)
|
||||||
|
#Paginacion
|
||||||
|
|
||||||
|
if itemlist !=[]:
|
||||||
|
actual_page_url = item.url
|
||||||
|
next_page = scrapertools.find_single_match(data,'<span class=pagination_next><a href=(.*?)>')
|
||||||
|
import inspect
|
||||||
|
if next_page !='':
|
||||||
|
itemlist.append(item.clone(action = "lista",
|
||||||
|
title = 'Siguiente >>>',
|
||||||
|
url = next_page
|
||||||
|
))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def genres(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
data = get_source(item.url)
|
||||||
|
data = scrapertools.find_single_match(data,'Géneros</option>(.+)</select></div>')
|
||||||
|
|
||||||
|
patron = '<option value=(.*?)>(.*?)</option>'
|
||||||
|
|
||||||
|
matches = re.compile(patron,re.DOTALL).findall(data)
|
||||||
|
|
||||||
|
for value, title in matches:
|
||||||
|
url = item.url + value
|
||||||
|
title = title.decode('latin1').encode('utf8')
|
||||||
|
itemlist.append(Item(channel=item.channel, title=title, url=url, action='lista'))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def search(item, texto):
|
||||||
|
logger.info()
|
||||||
|
texto = texto.replace(" ", "+")
|
||||||
|
item.url = item.url + texto
|
||||||
|
|
||||||
|
if texto != '':
|
||||||
|
return lista(item)
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
def seasons(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist=[]
|
||||||
|
infoLabels = item.infoLabels
|
||||||
|
data=get_source(item.url)
|
||||||
|
patron ='href=javascript:showSeasson\(.*?\); id=.*?>Temporada (.*?)<\/a>'
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
|
for season in matches:
|
||||||
|
title='Temporada %s' % season
|
||||||
|
infoLabels['season'] = season
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title= title,
|
||||||
|
url=item.url,
|
||||||
|
action='episodesxseasons',
|
||||||
|
contentSeasonNumber=season,
|
||||||
|
contentSerieName=item.contentSerieName,
|
||||||
|
infoLabels=infoLabels
|
||||||
|
))
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
itemlist = itemlist[::-1]
|
||||||
|
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,
|
||||||
|
action="add_serie_to_library", extra="all_episodes", contentSerieName=item.contentSerieName))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def all_episodes(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
templist = seasons(item)
|
||||||
|
for tempitem in templist:
|
||||||
|
itemlist += episodesxseasons(tempitem)
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def episodesxseasons(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
itemlist=[]
|
||||||
|
|
||||||
|
data=get_source(item.url)
|
||||||
|
patron = "<div class=corner-episode>%sx(.\d+)<\/div><a href=(.*?)>.*?" % item.contentSeasonNumber
|
||||||
|
patron += "image:url\('(.*?)'.*?href.*?>(%s)<" % item.contentSerieName
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
infoLabels=item.infoLabels
|
||||||
|
for episode, scrapedurl, scrapedthumbnail, scrapedtitle in matches:
|
||||||
|
contentEpisodeNumber=episode
|
||||||
|
season = item.contentSeasonNumber
|
||||||
|
url=scrapedurl
|
||||||
|
thumbnail=scrapedthumbnail
|
||||||
|
infoLabels['episode']=episode
|
||||||
|
title = '%sx%s - %s' % (season, episode, item.contentSerieName)
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
action='findvideos',
|
||||||
|
title=title,
|
||||||
|
url=url,
|
||||||
|
thumbnail=thumbnail,
|
||||||
|
contentSerieName=item.contentSerieName,
|
||||||
|
contentEpisodeNumber=contentEpisodeNumber,
|
||||||
|
infoLabels=infoLabels
|
||||||
|
))
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
|
||||||
|
return itemlist[::-1]
|
||||||
|
|
||||||
|
|
||||||
|
def findvideos(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist=[]
|
||||||
|
data = get_source(item.url)
|
||||||
|
patron = "showDownload\(([^\)]+)\);.*?alt=.*?torrent (.*?) "
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
|
for extra_info, quality in matches:
|
||||||
|
extra_info= extra_info.replace(",'",'|')
|
||||||
|
extra_info= extra_info.split('|')
|
||||||
|
title = '%s [%s]' % ('Torrent', quality.strip())
|
||||||
|
if item.extra == 'movie':
|
||||||
|
url = extra_info[2].strip("'")
|
||||||
|
else:
|
||||||
|
url = extra_info[3].strip("'")
|
||||||
|
server = 'torrent'
|
||||||
|
|
||||||
|
if not '.torrent' in url:
|
||||||
|
if 'tvsinpagar' in url:
|
||||||
|
url = url.replace('http://','http://www.')
|
||||||
|
try:
|
||||||
|
from_web = httptools.downloadpage(url, follow_redirects=False)
|
||||||
|
url = from_web.headers['location']
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if '.torrent' in url:
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title=title,
|
||||||
|
contentTitle= item.title,
|
||||||
|
url=url,
|
||||||
|
action='play',
|
||||||
|
quality=quality,
|
||||||
|
server=server,
|
||||||
|
thumbnail = item.infoLabels['thumbnail'],
|
||||||
|
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.contentTitle
|
||||||
|
))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def newest(category):
|
||||||
|
logger.info()
|
||||||
|
item = Item()
|
||||||
|
try:
|
||||||
|
if category in ['peliculas', 'torrent']:
|
||||||
|
item.url = host + 'estrenos-de-cine'
|
||||||
|
item.extra='movie'
|
||||||
|
itemlist = lista(item)
|
||||||
|
if itemlist[-1].title == 'Siguiente >>>':
|
||||||
|
itemlist.pop()
|
||||||
|
if category == 'torrent':
|
||||||
|
|
||||||
|
item.url = host+'series'
|
||||||
|
item.extra = 'serie'
|
||||||
|
itemlist.extend(lista(item))
|
||||||
|
|
||||||
|
if itemlist[-1].title == 'Siguiente >>>':
|
||||||
|
itemlist.pop()
|
||||||
|
except:
|
||||||
|
import sys
|
||||||
|
for line in sys.exc_info():
|
||||||
|
logger.error("%s" % line)
|
||||||
|
return []
|
||||||
|
|
||||||
|
return itemlist
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"id": "seriesverde",
|
||||||
|
"name": "SeriesVerde",
|
||||||
|
"active": true,
|
||||||
|
"adult": false,
|
||||||
|
"language": ["cast", "lat"],
|
||||||
|
"thumbnail": "https://s33.postimg.cc/96dhv4trj/seriesverde.png",
|
||||||
|
"banner": "",
|
||||||
|
"categories": [
|
||||||
|
"tvshow"
|
||||||
|
],
|
||||||
|
"settings": [
|
||||||
|
{
|
||||||
|
"id": "include_in_global_search",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en busqueda global",
|
||||||
|
"default": false,
|
||||||
|
"enabled": false,
|
||||||
|
"visible": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "filter_languages",
|
||||||
|
"type": "list",
|
||||||
|
"label": "Mostrar enlaces en idioma...",
|
||||||
|
"default": 0,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true,
|
||||||
|
"lvalues": [
|
||||||
|
"No filtrar",
|
||||||
|
"Cast",
|
||||||
|
"Lat",
|
||||||
|
"VOSE",
|
||||||
|
"VO"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,312 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# -*- Channel SeriesVerde -*-
|
||||||
|
# -*- Created for Alfa-addon -*-
|
||||||
|
# -*- By the Alfa Develop Group -*-
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
from channels import autoplay
|
||||||
|
from channels import filtertools
|
||||||
|
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
|
||||||
|
from channelselector import get_thumb
|
||||||
|
|
||||||
|
host = 'http://seriesverde.com/'
|
||||||
|
|
||||||
|
IDIOMAS = {'es': 'Cast', 'la': 'Lat', 'vos': 'VOSE', 'vo': 'VO'}
|
||||||
|
list_language = IDIOMAS.values()
|
||||||
|
list_quality = ['SD', 'Micro-HD-720p', '720p', 'HDitunes', 'Micro-HD-1080p' ]
|
||||||
|
list_servers = ['powvideo','yourupload', 'openload', 'gamovideo', 'flashx', 'clipwatching', 'streamango', 'streamcloud']
|
||||||
|
|
||||||
|
|
||||||
|
def mainlist(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
autoplay.init(item.channel, list_servers, list_quality)
|
||||||
|
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title="Todas",
|
||||||
|
action="list_all",
|
||||||
|
thumbnail=get_thumb('all', auto=True),
|
||||||
|
url=host + 'listado/',
|
||||||
|
))
|
||||||
|
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title="Generos",
|
||||||
|
action="section",
|
||||||
|
thumbnail=get_thumb('genres', auto=True),
|
||||||
|
url=host,
|
||||||
|
))
|
||||||
|
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title="A - Z",
|
||||||
|
action="section",
|
||||||
|
thumbnail=get_thumb('alphabet', auto=True),
|
||||||
|
url=host+'listado/', ))
|
||||||
|
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title="Buscar",
|
||||||
|
action="search",
|
||||||
|
thumbnail=get_thumb('search', auto=True)))
|
||||||
|
|
||||||
|
itemlist = filtertools.show_option(itemlist, item.channel, list_language, list_quality)
|
||||||
|
autoplay.show_option(item.channel, itemlist)
|
||||||
|
|
||||||
|
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 list_all(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
itemlist = []
|
||||||
|
data = get_source(item.url)
|
||||||
|
contentSerieName = ''
|
||||||
|
|
||||||
|
patron = "<div style='float.*?<a href='(.*?)'>.*?src='(.*?)' title='(.*?)'"
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
|
|
||||||
|
for scrapedurl, scrapedthumbnail, scrapedtitle in matches:
|
||||||
|
|
||||||
|
url = host + scrapedurl
|
||||||
|
thumbnail = scrapedthumbnail
|
||||||
|
title = scrapedtitle
|
||||||
|
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
action='seasons',
|
||||||
|
title=title,
|
||||||
|
url=url,
|
||||||
|
thumbnail=thumbnail,
|
||||||
|
contentTitle=scrapedtitle,
|
||||||
|
contentSerieName=contentSerieName,
|
||||||
|
context=filtertools.context(item, list_language, list_quality),
|
||||||
|
))
|
||||||
|
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
|
||||||
|
# #Paginacion
|
||||||
|
|
||||||
|
if itemlist != []:
|
||||||
|
base_page = scrapertools.find_single_match(item.url,'(.*?)?')
|
||||||
|
next_page = scrapertools.find_single_match(data, '</span><a href=?pagina=2>>></a>')
|
||||||
|
if next_page != '':
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
action="lista",
|
||||||
|
title='Siguiente >>>',
|
||||||
|
url=base_page+next_page,
|
||||||
|
thumbnail='https://s16.postimg.cc/9okdu7hhx/siguiente.png',
|
||||||
|
))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def section(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
itemlist = []
|
||||||
|
data = get_source(item.url)
|
||||||
|
if item.title == 'Generos':
|
||||||
|
patron = '<li><a href=([^ ]+) rel=nofollow><i class=fa fa-bookmark-o></i> (.*?)</a></li>'
|
||||||
|
elif item.title == 'A - Z':
|
||||||
|
patron = "<a dir='ltr' href=(.*?) class='label label-success'>(.*?)</a>"
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
|
for scrapedurl, scrapedtitle in matches:
|
||||||
|
|
||||||
|
url = host + scrapedurl
|
||||||
|
title = scrapedtitle
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
action='list_all',
|
||||||
|
title=title,
|
||||||
|
url=url
|
||||||
|
))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def seasons(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
data = get_source(item.url)
|
||||||
|
|
||||||
|
patron = '<span itemprop=seasonNumber class=fa fa-arrow-down>.*?Temporada (\d+) '
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
infoLabels=item.infoLabels
|
||||||
|
for scrapedseason in matches:
|
||||||
|
url = item.url
|
||||||
|
title = 'Temporada %s' % scrapedseason
|
||||||
|
contentSeasonNumber = scrapedseason
|
||||||
|
infoLabels['season'] = contentSeasonNumber
|
||||||
|
thumbnail = item.thumbnail
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
action="episodesxseason",
|
||||||
|
title=title,
|
||||||
|
url=url,
|
||||||
|
thumbnail=thumbnail,
|
||||||
|
contentSeasonNumber=contentSeasonNumber,
|
||||||
|
infoLabels=infoLabels
|
||||||
|
))
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
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,
|
||||||
|
action="add_serie_to_library",
|
||||||
|
extra="all_episodes",
|
||||||
|
contentSerieName=item.contentSerieName,
|
||||||
|
))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def all_episodes(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
templist = seasons(item)
|
||||||
|
for tempitem in templist:
|
||||||
|
itemlist += episodesxseason(tempitem)
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def episodesxseason(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
data = get_source(item.url)
|
||||||
|
season = item.contentSeasonNumber
|
||||||
|
patron = "<td><a href='([^ ]+)'.*?itemprop='episodeNumber'>%s+x(\d+)</span> - (.*?) </a>.*?(/banderas.*?)</td>" % season
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
infoLabels = item.infoLabels
|
||||||
|
for scrapedurl, scraped_episode, scrapedtitle, lang_data in matches:
|
||||||
|
url = host + scrapedurl
|
||||||
|
title = '%sx%s - %s' % (season, scraped_episode, scrapedtitle.strip())
|
||||||
|
infoLabels['episode'] = scraped_episode
|
||||||
|
thumbnail = item.thumbnail
|
||||||
|
title, language = add_language(title, lang_data)
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
action="findvideos",
|
||||||
|
title=title,
|
||||||
|
url=url,
|
||||||
|
thumbnail=thumbnail,
|
||||||
|
language=language,
|
||||||
|
infoLabels=infoLabels
|
||||||
|
))
|
||||||
|
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def add_language(title, string):
|
||||||
|
logger.info()
|
||||||
|
language = []
|
||||||
|
languages = scrapertools.find_multiple_matches(string, '/banderas/(.*?).png')
|
||||||
|
|
||||||
|
for lang in languages:
|
||||||
|
if 'jap' in lang or lang not in IDIOMAS:
|
||||||
|
lang = 'vos'
|
||||||
|
|
||||||
|
language.append(IDIOMAS[lang])
|
||||||
|
title = '%s [%s]' % (title, IDIOMAS[lang])
|
||||||
|
|
||||||
|
return title, language
|
||||||
|
|
||||||
|
|
||||||
|
def findvideos(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
data = get_source(item.url)
|
||||||
|
|
||||||
|
patron = "<a href=([^ ]+) target=_blank><img src='/servidores/(.*?).(?:png|jpg)'.*?sno.*?"
|
||||||
|
patron += "sno><span>(.*?)<.*?(/banderas.*?)td"
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
|
|
||||||
|
for scrapedurl, server, quality, lang_data in matches:
|
||||||
|
|
||||||
|
title = server.capitalize()
|
||||||
|
if quality == '':
|
||||||
|
quality = 'SD'
|
||||||
|
title = '%s [%s]' % (title, quality)
|
||||||
|
title, language = add_language(title, lang_data)
|
||||||
|
thumbnail = item.thumbnail
|
||||||
|
|
||||||
|
enlace_id, serie_id, se, ep = scrapertools.find_single_match(scrapedurl,'enlace(\d+)/(\d+)/(\d+)/(\d+)/')
|
||||||
|
|
||||||
|
url = host + 'ajax/load_enlace.php?serie=%s&temp=%s&cap=%s&id=%s' % (serie_id, se, ep, enlace_id)
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title=title,
|
||||||
|
url=url,
|
||||||
|
action="play",
|
||||||
|
thumbnail=thumbnail,
|
||||||
|
server=server,
|
||||||
|
quality=quality,
|
||||||
|
language=language,
|
||||||
|
infoLabels=item.infoLabels
|
||||||
|
))
|
||||||
|
# Requerido para FilterTools
|
||||||
|
|
||||||
|
itemlist = filtertools.get_links(itemlist, item, list_language)
|
||||||
|
|
||||||
|
# Requerido para AutoPlay
|
||||||
|
|
||||||
|
autoplay.start(itemlist, item)
|
||||||
|
|
||||||
|
return sorted(itemlist, key=lambda it: it.language)
|
||||||
|
|
||||||
|
|
||||||
|
def play(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url, follow_redirects=False).data
|
||||||
|
itemlist = servertools.find_video_items(data=data)
|
||||||
|
for videoitem in itemlist:
|
||||||
|
videoitem.infoLabels = item.infoLabels
|
||||||
|
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def search_results(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
data = httptools.downloadpage(host + 'finder.php', post=item.post).data
|
||||||
|
data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data)
|
||||||
|
patron = "<a href='(.*?)'>.*?src=(.*?) style.*?value=(.*?)>"
|
||||||
|
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
|
for scrapedurl, scrapedthumb, scrapedtitle in matches:
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title=scrapedtitle,
|
||||||
|
url=host+scrapedurl,
|
||||||
|
action="seasons",
|
||||||
|
thumbnail=scrapedthumb,
|
||||||
|
contentSerieName=scrapedtitle,
|
||||||
|
context=filtertools.context(item, list_language, list_quality)
|
||||||
|
))
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def search(item, texto):
|
||||||
|
logger.info()
|
||||||
|
import urllib
|
||||||
|
if texto != '':
|
||||||
|
post = {'query':texto}
|
||||||
|
post = urllib.urlencode(post)
|
||||||
|
item.post = post
|
||||||
|
|
||||||
|
return search_results(item)
|
||||||
@@ -226,33 +226,83 @@ def episodesxseasons(item):
|
|||||||
return itemlist[::-1]
|
return itemlist[::-1]
|
||||||
|
|
||||||
|
|
||||||
|
# def findvideos(item):
|
||||||
|
# logger.info()
|
||||||
|
# itemlist=[]
|
||||||
|
# data = get_source(item.url)
|
||||||
|
# patron = "<a class=dload.*? target=_blank>.*?<\/a><i>(.*?)<\/i>.*?<a href=.*?showDownload\((.*?)\);"
|
||||||
|
# matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
#
|
||||||
|
# for quality, extra_info in matches:
|
||||||
|
# extra_info= extra_info.replace("'",'')
|
||||||
|
# extra_info= extra_info.split(',')
|
||||||
|
# title = '%s [%s]' % (item.contentTitle, quality)
|
||||||
|
# url = extra_info[1]
|
||||||
|
# if item.extra == 'movie':
|
||||||
|
# url = extra_info[1]
|
||||||
|
# else:
|
||||||
|
# url = extra_info[2]
|
||||||
|
# server = 'torrent'
|
||||||
|
# itemlist.append(Item(channel=item.channel,
|
||||||
|
# title=title,
|
||||||
|
# contentTitle= item.title,
|
||||||
|
# url=url,
|
||||||
|
# action='play',
|
||||||
|
# quality=quality,
|
||||||
|
# server=server,
|
||||||
|
# thumbnail = item.infoLabels['thumbnail'],
|
||||||
|
# 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.contentTitle
|
||||||
|
# ))
|
||||||
|
#
|
||||||
|
# return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist=[]
|
itemlist=[]
|
||||||
data = get_source(item.url)
|
data = get_source(item.url)
|
||||||
patron = "<a class=dload.*? target=_blank>.*?<\/a><i>(.*?)<\/i>.*?<a href=.*?showDownload\((.*?)\);"
|
patron = "showDownload\(([^\)]+)\);.*?alt=.*?torrent (.*?) "
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
for quality, extra_info in matches:
|
for extra_info, quality in matches:
|
||||||
extra_info= extra_info.replace("'",'')
|
extra_info= extra_info.replace(",'",'|')
|
||||||
extra_info= extra_info.split(',')
|
extra_info= extra_info.split('|')
|
||||||
title = '%s [%s]' % (item.contentTitle, quality)
|
title = '%s [%s]' % ('Torrent', quality.strip())
|
||||||
url = extra_info[1]
|
|
||||||
if item.extra == 'movie':
|
if item.extra == 'movie':
|
||||||
url = extra_info[1]
|
url = extra_info[2].strip("'")
|
||||||
else:
|
else:
|
||||||
url = extra_info[2]
|
url = extra_info[3].strip("'")
|
||||||
server = 'torrent'
|
server = 'torrent'
|
||||||
itemlist.append(Item(channel=item.channel,
|
|
||||||
title=title,
|
if not '.torrent' in url:
|
||||||
contentTitle= item.title,
|
if 'tvsinpagar' in url:
|
||||||
url=url,
|
url = url.replace('http://','http://www.')
|
||||||
action='play',
|
try:
|
||||||
quality=quality,
|
from_web = httptools.downloadpage(url, follow_redirects=False)
|
||||||
server=server,
|
url = from_web.headers['location']
|
||||||
thumbnail = item.infoLabels['thumbnail'],
|
except:
|
||||||
infoLabels=item.infoLabels
|
pass
|
||||||
))
|
|
||||||
|
if '.torrent' in url:
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title=title,
|
||||||
|
contentTitle= item.title,
|
||||||
|
url=url,
|
||||||
|
action='play',
|
||||||
|
quality=quality,
|
||||||
|
server=server,
|
||||||
|
thumbnail = item.infoLabels['thumbnail'],
|
||||||
|
infoLabels=item.infoLabels
|
||||||
|
))
|
||||||
|
|
||||||
if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos':
|
if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos':
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
|||||||
@@ -70,11 +70,33 @@
|
|||||||
"Toda la videoteca"
|
"Toda la videoteca"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "addition",
|
||||||
|
"type": "label",
|
||||||
|
"label": "Añadir a la videoteca",
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "enable_filter",
|
||||||
|
"type": "bool",
|
||||||
|
"label": " Excluir los streams que contienen etiquetas específicas",
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true,
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "filters",
|
||||||
|
"type": "text",
|
||||||
|
"label": " Etiquetas",
|
||||||
|
"visible": true,
|
||||||
|
"enabled": "eq(-1,true)"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "window_type",
|
"id": "window_type",
|
||||||
"type": "list",
|
"type": "list",
|
||||||
"label": "Mostrar los enlaces en",
|
"label": "Mostrar los enlaces en",
|
||||||
"default": 0,
|
"default": 1,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"visible": true,
|
"visible": true,
|
||||||
"lvalues": [
|
"lvalues": [
|
||||||
|
|||||||
@@ -596,7 +596,12 @@ def mark_tvshow_as_updatable(item):
|
|||||||
|
|
||||||
def delete(item):
|
def delete(item):
|
||||||
def delete_all(_item):
|
def delete_all(_item):
|
||||||
filetools.rmdirtree(_item.path)
|
for file in filetools.listdir(_item.path):
|
||||||
|
if file.endswith(".strm") or file.endswith(".nfo") or file.endswith(".json"):
|
||||||
|
filetools.remove(filetools.join(_item.path, file))
|
||||||
|
raiz, carpeta_serie, ficheros = filetools.walk(_item.path).next()
|
||||||
|
if ficheros == []:
|
||||||
|
filetools.rmdir(_item.path)
|
||||||
|
|
||||||
if config.is_xbmc():
|
if config.is_xbmc():
|
||||||
import xbmc
|
import xbmc
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ def get_channel_parameters(channel_name):
|
|||||||
if 'id' in s:
|
if 'id' in s:
|
||||||
if s['id'] == "include_in_global_search":
|
if s['id'] == "include_in_global_search":
|
||||||
channel_parameters["include_in_global_search"] = True
|
channel_parameters["include_in_global_search"] = True
|
||||||
|
elif s['id'] == "filter_languages":
|
||||||
|
channel_parameters["filter_languages"] = s.get('lvalues',[])
|
||||||
elif not s['id'].startswith("include_in_") and \
|
elif not s['id'].startswith("include_in_") and \
|
||||||
(s.get('enabled', False) or s.get('visible', False)):
|
(s.get('enabled', False) or s.get('visible', False)):
|
||||||
channel_parameters["has_settings"] = True
|
channel_parameters["has_settings"] = True
|
||||||
|
|||||||
@@ -263,6 +263,7 @@ def get_nfo(item):
|
|||||||
|
|
||||||
|
|
||||||
def sort_episode_list(episodelist):
|
def sort_episode_list(episodelist):
|
||||||
|
episodelist.sort(key=lambda e: e.title, reverse=True)
|
||||||
scraper_actual = ['tmdb', 'tvdb'][config.get_setting("scraper_tvshows", "videolibrary")]
|
scraper_actual = ['tmdb', 'tvdb'][config.get_setting("scraper_tvshows", "videolibrary")]
|
||||||
|
|
||||||
if scraper_actual == "tmdb":
|
if scraper_actual == "tmdb":
|
||||||
|
|||||||
@@ -458,14 +458,14 @@ def get_season_and_episode(title):
|
|||||||
"""
|
"""
|
||||||
filename = ""
|
filename = ""
|
||||||
|
|
||||||
patrons = ["(\d+)x(\d+)", "(\d+)×(\d+)", "(?:s|t)(\d+)e(\d+)",
|
patrons = ["(\d+)\s*[x-]\s*(\d+)", "(\d+)\s*×\s*(\d+)", "(?:s|t)(\d+)e(\d+)",
|
||||||
"(?:season|temp\w*)\s*(\d+)\s*(?:capitulo|epi\w*)\s*(\d+)"]
|
"(?:season|temp\w*)\s*(\d+)\s*(?:capitulo|epi|episode\w*)\s*(\d+)"]
|
||||||
|
|
||||||
for patron in patrons:
|
for patron in patrons:
|
||||||
try:
|
try:
|
||||||
matches = re.compile(patron, re.I).search(title)
|
matches = re.compile(patron, re.I).search(title)
|
||||||
if matches:
|
if matches:
|
||||||
filename = matches.group(1) + "x" + matches.group(2).zfill(2)
|
filename = matches.group(1).lstrip('0') + "x" + matches.group(2).zfill(2)
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ def save_movie(item):
|
|||||||
else:
|
else:
|
||||||
base_name = item.contentTitle
|
base_name = item.contentTitle
|
||||||
|
|
||||||
base_name = unicode(filetools.validate_path(base_name.replace('/', '-')), "utf8").lower().encode("utf8")
|
base_name = unicode(filetools.validate_path(base_name.replace('/', '-')), "utf8").encode("utf8")
|
||||||
|
|
||||||
for raiz, subcarpetas, ficheros in filetools.walk(MOVIES_PATH):
|
for raiz, subcarpetas, ficheros in filetools.walk(MOVIES_PATH):
|
||||||
for c in subcarpetas:
|
for c in subcarpetas:
|
||||||
@@ -244,7 +244,7 @@ def save_tvshow(item, episodelist):
|
|||||||
else:
|
else:
|
||||||
base_name = item.contentSerieName
|
base_name = item.contentSerieName
|
||||||
|
|
||||||
base_name = unicode(filetools.validate_path(base_name.replace('/', '-')), "utf8").lower().encode("utf8")
|
base_name = unicode(filetools.validate_path(base_name.replace('/', '-')), "utf8").encode("utf8")
|
||||||
|
|
||||||
for raiz, subcarpetas, ficheros in filetools.walk(TVSHOWS_PATH):
|
for raiz, subcarpetas, ficheros in filetools.walk(TVSHOWS_PATH):
|
||||||
for c in subcarpetas:
|
for c in subcarpetas:
|
||||||
@@ -348,6 +348,15 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
|||||||
raiz, carpetas_series, ficheros = filetools.walk(path).next()
|
raiz, carpetas_series, ficheros = filetools.walk(path).next()
|
||||||
ficheros = [filetools.join(path, f) for f in ficheros]
|
ficheros = [filetools.join(path, f) for f in ficheros]
|
||||||
|
|
||||||
|
nostrm_episodelist = []
|
||||||
|
for root, folders, files in filetools.walk(path):
|
||||||
|
for file in files:
|
||||||
|
season_episode = scrapertools.get_season_and_episode(file)
|
||||||
|
if season_episode == "" or filetools.exists(filetools.join(path, "%s.strm" % season_episode)):
|
||||||
|
continue
|
||||||
|
nostrm_episodelist.append(season_episode)
|
||||||
|
nostrm_episodelist = sorted(set(nostrm_episodelist))
|
||||||
|
|
||||||
# Silent es para no mostrar progreso (para videolibrary_service)
|
# Silent es para no mostrar progreso (para videolibrary_service)
|
||||||
if not silent:
|
if not silent:
|
||||||
# progress dialog
|
# progress dialog
|
||||||
@@ -356,7 +365,12 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
|||||||
|
|
||||||
new_episodelist = []
|
new_episodelist = []
|
||||||
# Obtenemos el numero de temporada y episodio y descartamos los q no lo sean
|
# Obtenemos el numero de temporada y episodio y descartamos los q no lo sean
|
||||||
|
tags = []
|
||||||
|
if config.get_setting("enable_filter", "videolibrary"):
|
||||||
|
tags = [x.strip() for x in config.get_setting("filters", "videolibrary").lower().split(",")]
|
||||||
for e in episodelist:
|
for e in episodelist:
|
||||||
|
if tags != [] and tags != None and any(tag in e.title.lower() for tag in tags):
|
||||||
|
continue
|
||||||
try:
|
try:
|
||||||
season_episode = scrapertools.get_season_and_episode(e.title)
|
season_episode = scrapertools.get_season_and_episode(e.title)
|
||||||
|
|
||||||
@@ -383,6 +397,8 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
|||||||
nfo_path = filetools.join(path, "%s.nfo" % season_episode)
|
nfo_path = filetools.join(path, "%s.nfo" % season_episode)
|
||||||
json_path = filetools.join(path, ("%s [%s].json" % (season_episode, e.channel)).lower())
|
json_path = filetools.join(path, ("%s [%s].json" % (season_episode, e.channel)).lower())
|
||||||
|
|
||||||
|
if season_episode in nostrm_episodelist:
|
||||||
|
continue
|
||||||
strm_exists = strm_path in ficheros
|
strm_exists = strm_path in ficheros
|
||||||
nfo_exists = nfo_path in ficheros
|
nfo_exists = nfo_path in ficheros
|
||||||
json_exists = json_path in ficheros
|
json_exists = json_path in ficheros
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ def find_in_text(regex, text, flags=re.IGNORECASE | re.DOTALL):
|
|||||||
|
|
||||||
|
|
||||||
class UnshortenIt(object):
|
class UnshortenIt(object):
|
||||||
_adfly_regex = r'adf\.ly|q\.gs|j\.gs|u\.bb|ay\.gy|threadsphere\.bid|restorecosm\.bid'
|
_adfly_regex = r'adf\.ly|q\.gs|j\.gs|u\.bb|ay\.gy|threadsphere\.bid|restorecosm\.bid|clearload\.bid'
|
||||||
_linkbucks_regex = r'linkbucks\.com|any\.gs|cash4links\.co|cash4files\.co|dyo\.gs|filesonthe\.net|goneviral\.com|megaline\.co|miniurls\.co|qqc\.co|seriousdeals\.net|theseblogs\.com|theseforums\.com|tinylinks\.co|tubeviral\.com|ultrafiles\.net|urlbeat\.net|whackyvidz\.com|yyv\.co'
|
_linkbucks_regex = r'linkbucks\.com|any\.gs|cash4links\.co|cash4files\.co|dyo\.gs|filesonthe\.net|goneviral\.com|megaline\.co|miniurls\.co|qqc\.co|seriousdeals\.net|theseblogs\.com|theseforums\.com|tinylinks\.co|tubeviral\.com|ultrafiles\.net|urlbeat\.net|whackyvidz\.com|yyv\.co'
|
||||||
_adfocus_regex = r'adfoc\.us'
|
_adfocus_regex = r'adfoc\.us'
|
||||||
_lnxlu_regex = r'lnx\.lu'
|
_lnxlu_regex = r'lnx\.lu'
|
||||||
_shst_regex = r'sh\.st'
|
_shst_regex = r'sh\.st|gestyy\.com'
|
||||||
_hrefli_regex = r'href\.li'
|
_hrefli_regex = r'href\.li'
|
||||||
_anonymz_regex = r'anonymz\.com'
|
_anonymz_regex = r'anonymz\.com'
|
||||||
_shrink_service_regex = r'shrink-service\.it'
|
_shrink_service_regex = r'shrink-service\.it'
|
||||||
|
|||||||
@@ -352,7 +352,6 @@ def verify_directories_created():
|
|||||||
config_paths = [["folder_movies", "CINE"],
|
config_paths = [["folder_movies", "CINE"],
|
||||||
["folder_tvshows", "SERIES"]]
|
["folder_tvshows", "SERIES"]]
|
||||||
|
|
||||||
flag_call = True
|
|
||||||
for path, default in config_paths:
|
for path, default in config_paths:
|
||||||
saved_path = get_setting(path)
|
saved_path = get_setting(path)
|
||||||
|
|
||||||
@@ -365,11 +364,7 @@ def verify_directories_created():
|
|||||||
logger.debug("Creating %s: %s" % (path, content_path))
|
logger.debug("Creating %s: %s" % (path, content_path))
|
||||||
|
|
||||||
# si se crea el directorio
|
# si se crea el directorio
|
||||||
if filetools.mkdir(content_path):
|
filetools.mkdir(content_path)
|
||||||
if flag_call:
|
|
||||||
# le pasamos el valor para que sepamos que se ha pasado por creación de directorio
|
|
||||||
xbmc_videolibrary.ask_set_content(1)
|
|
||||||
flag_call = False
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from core import scrapertools
|
from core import scrapertools
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ def run(item=None):
|
|||||||
else:
|
else:
|
||||||
item = Item(channel="channelselector", action="getmainlist", viewmode="movie")
|
item = Item(channel="channelselector", action="getmainlist", viewmode="movie")
|
||||||
if not config.get_setting('show_once'):
|
if not config.get_setting('show_once'):
|
||||||
platformtools.dialog_ok('Alfa', 'Alfa recomienda para mejorar tu experiencia:',
|
from platformcode import xbmc_videolibrary
|
||||||
'Palomitas, relajate y disfruta.')
|
xbmc_videolibrary.ask_set_content(1)
|
||||||
config.set_setting('show_once', True)
|
config.set_setting('show_once', True)
|
||||||
|
|
||||||
logger.info(item.tostring())
|
logger.info(item.tostring())
|
||||||
|
|||||||
@@ -372,6 +372,44 @@ def set_context_commands(item, parent_item):
|
|||||||
else:
|
else:
|
||||||
context = []
|
context = []
|
||||||
|
|
||||||
|
if config.get_setting("faster_item_serialization"):
|
||||||
|
# logger.info("Reducing serialization!")
|
||||||
|
itemBK = item
|
||||||
|
item = Item()
|
||||||
|
item.action = itemBK.action
|
||||||
|
item.channel = itemBK.channel
|
||||||
|
infoLabels = {}
|
||||||
|
if itemBK.infoLabels["year"]: infoLabels["year"] = itemBK.infoLabels["year"]
|
||||||
|
if itemBK.infoLabels["imdb_id"]: infoLabels["imdb_id"] = itemBK.infoLabels["imdb_id"]
|
||||||
|
if itemBK.infoLabels["tmdb_id"]: infoLabels["tmdb_id"] = itemBK.infoLabels["tmdb_id"]
|
||||||
|
if itemBK.infoLabels["tvdb_id"]: infoLabels["tvdb_id"] = itemBK.infoLabels["tvdb_id"]
|
||||||
|
if itemBK.infoLabels["noscrap_id"]: infoLabels["noscrap_id"] = itemBK.infoLabels["noscrap_id"]
|
||||||
|
if len(infoLabels) > 0: item.infoLabels = infoLabels
|
||||||
|
|
||||||
|
if itemBK.thumbnail: item.thumbnail = itemBK.thumbnail
|
||||||
|
if itemBK.extra: item.extra = itemBK.extra
|
||||||
|
if itemBK.contentEpisodeNumber: item.contentEpisodeNumber = itemBK.contentEpisodeNumber
|
||||||
|
if itemBK.contentEpisodeTitle: item.contentEpisodeTitle = itemBK.contentEpisodeTitle
|
||||||
|
if itemBK.contentPlot: item.contentPlot = itemBK.contentPlot
|
||||||
|
if itemBK.contentQuality: item.contentQuality = itemBK.contentQuality
|
||||||
|
if itemBK.contentSeason: item.contentSeason = itemBK.contentSeason
|
||||||
|
if itemBK.contentSerieName: item.contentSerieName = itemBK.contentSerieName
|
||||||
|
if itemBK.contentThumbnail: item.contentThumbnail = itemBK.contentThumbnail
|
||||||
|
if itemBK.contentTitle: item.contentTitle = itemBK.contentTitle
|
||||||
|
if itemBK.contentType: item.contentType = itemBK.contentType
|
||||||
|
if itemBK.duration: item.duration = itemBK.duration
|
||||||
|
if itemBK.fulltitle: item.fulltitle = itemBK.fulltitle
|
||||||
|
if itemBK.plot: item.plot = itemBK.plot
|
||||||
|
if itemBK.quality: item.quality = itemBK.quality
|
||||||
|
if itemBK.show: item.show = itemBK.show
|
||||||
|
if itemBK.title: item.title = itemBK.title
|
||||||
|
if itemBK.viewcontent: item.viewcontent = itemBK.viewcontent
|
||||||
|
|
||||||
|
# itemJson = item.tojson()
|
||||||
|
# logger.info("Elemento: {0} bytes".format(len(itemJson)))
|
||||||
|
# logger.info(itemJson)
|
||||||
|
# logger.info("--------------------------------------------------------------")
|
||||||
|
|
||||||
# Opciones segun item.context
|
# Opciones segun item.context
|
||||||
for command in context:
|
for command in context:
|
||||||
# Predefinidos
|
# Predefinidos
|
||||||
@@ -507,14 +545,14 @@ def set_context_commands(item, parent_item):
|
|||||||
from_action=item.action).tourl())))
|
from_action=item.action).tourl())))
|
||||||
|
|
||||||
# Descargar episodio
|
# Descargar episodio
|
||||||
if item.contentType == "episode":
|
elif item.contentType == "episode":
|
||||||
context_commands.append(("Descargar Episodio", "XBMC.RunPlugin(%s?%s)" %
|
context_commands.append(("Descargar Episodio", "XBMC.RunPlugin(%s?%s)" %
|
||||||
(sys.argv[0], item.clone(channel="downloads", action="save_download",
|
(sys.argv[0], item.clone(channel="downloads", action="save_download",
|
||||||
from_channel=item.channel,
|
from_channel=item.channel,
|
||||||
from_action=item.action).tourl())))
|
from_action=item.action).tourl())))
|
||||||
|
|
||||||
# Descargar temporada
|
# Descargar temporada
|
||||||
if item.contentType == "season":
|
elif item.contentType == "season":
|
||||||
context_commands.append(("Descargar Temporada", "XBMC.RunPlugin(%s?%s)" %
|
context_commands.append(("Descargar Temporada", "XBMC.RunPlugin(%s?%s)" %
|
||||||
(sys.argv[0], item.clone(channel="downloads", action="save_download",
|
(sys.argv[0], item.clone(channel="downloads", action="save_download",
|
||||||
from_channel=item.channel,
|
from_channel=item.channel,
|
||||||
|
|||||||
@@ -440,102 +440,115 @@ def set_content(content_type, silent=False):
|
|||||||
videolibrarypath = config.get_setting("videolibrarypath")
|
videolibrarypath = config.get_setting("videolibrarypath")
|
||||||
|
|
||||||
if content_type == 'movie':
|
if content_type == 'movie':
|
||||||
if not xbmc.getCondVisibility('System.HasAddon(metadata.themoviedb.org)'):
|
scraper = ["The Movie Database", "Universal Movie Scraper"]
|
||||||
if not silent:
|
seleccion = platformtools.dialog_select("Seleccione el scraper para las películas", scraper)
|
||||||
# Preguntar si queremos instalar metadata.themoviedb.org
|
|
||||||
install = platformtools.dialog_yesno("The Movie Database",
|
|
||||||
"No se ha encontrado el Scraper de películas de TheMovieDB.",
|
|
||||||
"¿Desea instalarlo ahora?")
|
|
||||||
else:
|
|
||||||
install = True
|
|
||||||
|
|
||||||
if install:
|
# Instalar The Movie Database
|
||||||
try:
|
if seleccion == -1 or seleccion == 0:
|
||||||
# Instalar metadata.themoviedb.org
|
if not xbmc.getCondVisibility('System.HasAddon(metadata.themoviedb.org)'):
|
||||||
xbmc.executebuiltin('xbmc.installaddon(metadata.themoviedb.org)', True)
|
if not silent:
|
||||||
logger.info("Instalado el Scraper de películas de TheMovieDB")
|
# Preguntar si queremos instalar metadata.themoviedb.org
|
||||||
except:
|
install = platformtools.dialog_yesno("The Movie Database",
|
||||||
pass
|
"No se ha encontrado el Scraper de películas de TheMovieDB.",
|
||||||
|
"¿Desea instalarlo ahora?")
|
||||||
|
else:
|
||||||
|
install = True
|
||||||
|
|
||||||
continuar = (install and xbmc.getCondVisibility('System.HasAddon(metadata.themoviedb.org)'))
|
if install:
|
||||||
if not continuar:
|
try:
|
||||||
msg_text = "The Movie Database no instalado."
|
# Instalar metadata.themoviedb.org
|
||||||
|
xbmc.executebuiltin('xbmc.installaddon(metadata.themoviedb.org)', True)
|
||||||
|
logger.info("Instalado el Scraper de películas de TheMovieDB")
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
continuar = (install and xbmc.getCondVisibility('System.HasAddon(metadata.themoviedb.org)'))
|
||||||
|
if not continuar:
|
||||||
|
msg_text = "The Movie Database no instalado."
|
||||||
|
if continuar:
|
||||||
|
xbmc.executebuiltin('xbmc.addon.opensettings(metadata.themoviedb.org)', True)
|
||||||
|
|
||||||
|
# Instalar Universal Movie Scraper
|
||||||
|
elif seleccion == 1:
|
||||||
|
if continuar and not xbmc.getCondVisibility('System.HasAddon(metadata.universal)'):
|
||||||
|
continuar = False
|
||||||
|
if not silent:
|
||||||
|
# Preguntar si queremos instalar metadata.universal
|
||||||
|
install = platformtools.dialog_yesno("Universal Movie Scraper",
|
||||||
|
"No se ha encontrado el Scraper de series de TheMovieDB.",
|
||||||
|
"¿Desea instalarlo ahora?")
|
||||||
|
else:
|
||||||
|
install = True
|
||||||
|
|
||||||
|
if install:
|
||||||
|
try:
|
||||||
|
xbmc.executebuiltin('xbmc.installaddon(metadata.universal)', True)
|
||||||
|
if xbmc.getCondVisibility('System.HasAddon(metadata.universal)'):
|
||||||
|
continuar = True
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
continuar = (install and continuar)
|
||||||
|
if not continuar:
|
||||||
|
msg_text = "Universal Movie Scraper no instalado."
|
||||||
|
if continuar:
|
||||||
|
xbmc.executebuiltin('xbmc.addon.opensettings(metadata.universal)', True)
|
||||||
|
|
||||||
else: # SERIES
|
else: # SERIES
|
||||||
|
scraper = ["The TVDB", "The Movie Database"]
|
||||||
|
seleccion = platformtools.dialog_select("Seleccione el scraper para las series", scraper)
|
||||||
|
|
||||||
# Instalar The TVDB
|
# Instalar The TVDB
|
||||||
if not xbmc.getCondVisibility('System.HasAddon(metadata.tvdb.com)'):
|
if seleccion == -1 or seleccion == 0:
|
||||||
if not silent:
|
if not xbmc.getCondVisibility('System.HasAddon(metadata.tvdb.com)'):
|
||||||
# Preguntar si queremos instalar metadata.tvdb.com
|
if not silent:
|
||||||
install = platformtools.dialog_yesno("The TVDB",
|
# Preguntar si queremos instalar metadata.tvdb.com
|
||||||
"No se ha encontrado el Scraper de series de The TVDB.",
|
install = platformtools.dialog_yesno("The TVDB",
|
||||||
"¿Desea instalarlo ahora?")
|
"No se ha encontrado el Scraper de series de The TVDB.",
|
||||||
else:
|
"¿Desea instalarlo ahora?")
|
||||||
install = True
|
else:
|
||||||
|
install = True
|
||||||
|
|
||||||
if install:
|
if install:
|
||||||
try:
|
try:
|
||||||
# Instalar metadata.tvdb.com
|
# Instalar metadata.tvdb.com
|
||||||
xbmc.executebuiltin('xbmc.installaddon(metadata.tvdb.com)', True)
|
xbmc.executebuiltin('xbmc.installaddon(metadata.tvdb.com)', True)
|
||||||
logger.info("Instalado el Scraper de series de The TVDB")
|
logger.info("Instalado el Scraper de series de The TVDB")
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
continuar = (install and xbmc.getCondVisibility('System.HasAddon(metadata.tvdb.com)'))
|
continuar = (install and xbmc.getCondVisibility('System.HasAddon(metadata.tvdb.com)'))
|
||||||
if not continuar:
|
if not continuar:
|
||||||
msg_text = "The TVDB no instalado."
|
msg_text = "The TVDB no instalado."
|
||||||
|
if continuar:
|
||||||
|
xbmc.executebuiltin('xbmc.addon.opensettings(metadata.tvdb.com)', True)
|
||||||
|
|
||||||
# Instalar TheMovieDB
|
# Instalar The Movie Database
|
||||||
if continuar and not xbmc.getCondVisibility('System.HasAddon(metadata.tvshows.themoviedb.org)'):
|
elif seleccion == 1:
|
||||||
continuar = False
|
if continuar and not xbmc.getCondVisibility('System.HasAddon(metadata.tvshows.themoviedb.org)'):
|
||||||
if not silent:
|
continuar = False
|
||||||
# Preguntar si queremos instalar metadata.tvshows.themoviedb.org
|
if not silent:
|
||||||
install = platformtools.dialog_yesno("The Movie Database",
|
# Preguntar si queremos instalar metadata.tvshows.themoviedb.org
|
||||||
"No se ha encontrado el Scraper de series de TheMovieDB.",
|
install = platformtools.dialog_yesno("The Movie Database",
|
||||||
"¿Desea instalarlo ahora?")
|
"No se ha encontrado el Scraper de series de TheMovieDB.",
|
||||||
else:
|
"¿Desea instalarlo ahora?")
|
||||||
install = True
|
else:
|
||||||
|
install = True
|
||||||
|
|
||||||
if install:
|
if install:
|
||||||
try:
|
try:
|
||||||
# Instalar metadata.tvshows.themoviedb.org
|
# Instalar metadata.tvshows.themoviedb.org
|
||||||
# 1º Probar desde el repositorio ...
|
xbmc.executebuiltin('xbmc.installaddon(metadata.tvshows.themoviedb.org)', True)
|
||||||
xbmc.executebuiltin('xbmc.installaddon(metadata.tvshows.themoviedb.org)', True)
|
if xbmc.getCondVisibility('System.HasAddon(metadata.tvshows.themoviedb.org)'):
|
||||||
if not xbmc.getCondVisibility('System.HasAddon(metadata.tvshows.themoviedb.org)'):
|
continuar = True
|
||||||
# ...si no funciona descargar e instalar desde la web
|
except:
|
||||||
url = "http://mirrors.kodi.tv/addons/jarvis/metadata.tvshows.themoviedb.org/metadata.tvshows.themoviedb.org-1.3.1.zip"
|
pass
|
||||||
path_down = xbmc.translatePath(
|
|
||||||
"special://home/addons/packages/metadata.tvshows.themoviedb.org-1.3.1.zip")
|
|
||||||
path_unzip = xbmc.translatePath("special://home/addons/")
|
|
||||||
header = ("User-Agent",
|
|
||||||
"Kodi/15.2 (Windows NT 10.0; WOW64) App_Bitness/32 Version/15.2-Git:20151019-02e7013")
|
|
||||||
|
|
||||||
from core import downloadtools
|
continuar = (install and continuar)
|
||||||
from core import ziptools
|
if not continuar:
|
||||||
|
msg_text = "The Movie Database no instalado."
|
||||||
downloadtools.downloadfile(url, path_down, continuar=True, headers=[header])
|
if continuar:
|
||||||
unzipper = ziptools.ziptools()
|
xbmc.executebuiltin('xbmc.addon.opensettings(metadata.tvshows.themoviedb.org)', True)
|
||||||
unzipper.extract(path_down, path_unzip)
|
|
||||||
xbmc.executebuiltin('UpdateLocalAddons')
|
|
||||||
|
|
||||||
strSettings = '<settings>\n' \
|
|
||||||
' <setting id="fanart" value="true" />\n' \
|
|
||||||
' <setting id="keeporiginaltitle" value="false" />\n' \
|
|
||||||
' <setting id="language" value="es" />\n' \
|
|
||||||
'</settings>'
|
|
||||||
path_settings = xbmc.translatePath(
|
|
||||||
"special://profile/addon_data/metadata.tvshows.themoviedb.org/settings.xml")
|
|
||||||
tv_themoviedb_addon_path = filetools.dirname(path_settings)
|
|
||||||
if not filetools.exists(tv_themoviedb_addon_path):
|
|
||||||
filetools.mkdir(tv_themoviedb_addon_path)
|
|
||||||
if filetools.write(path_settings, strSettings):
|
|
||||||
continuar = True
|
|
||||||
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
continuar = (install and continuar)
|
|
||||||
if not continuar:
|
|
||||||
msg_text = "The Movie Database no instalado."
|
|
||||||
|
|
||||||
idPath = 0
|
idPath = 0
|
||||||
idParentPath = 0
|
idParentPath = 0
|
||||||
@@ -589,26 +602,32 @@ def set_content(content_type, silent=False):
|
|||||||
# Fijamos strContent, strScraper, scanRecursive y strSettings
|
# Fijamos strContent, strScraper, scanRecursive y strSettings
|
||||||
if content_type == 'movie':
|
if content_type == 'movie':
|
||||||
strContent = 'movies'
|
strContent = 'movies'
|
||||||
strScraper = 'metadata.themoviedb.org'
|
|
||||||
scanRecursive = 2147483647
|
scanRecursive = 2147483647
|
||||||
strSettings = "<settings><setting id='RatingS' value='TMDb' /><setting id='certprefix' value='Rated ' />" \
|
if seleccion == -1 or seleccion == 0:
|
||||||
"<setting id='fanart' value='true' /><setting id='keeporiginaltitle' value='false' />" \
|
strScraper = 'metadata.themoviedb.org'
|
||||||
"<setting id='language' value='es' /><setting id='tmdbcertcountry' value='us' />" \
|
path_settings = xbmc.translatePath("special://profile/addon_data/metadata.themoviedb.org/settings.xml")
|
||||||
"<setting id='trailer' value='true' /></settings>"
|
elif seleccion == 1:
|
||||||
|
strScraper = 'metadata.universal'
|
||||||
|
path_settings = xbmc.translatePath("special://profile/addon_data/metadata.universal/settings.xml")
|
||||||
|
settings_data = filetools.read(path_settings)
|
||||||
|
strSettings = ' '.join(settings_data.split()).replace("> <", "><")
|
||||||
|
strSettings = strSettings.replace("\"","\'")
|
||||||
strActualizar = "¿Desea configurar este Scraper en español como opción por defecto para películas?"
|
strActualizar = "¿Desea configurar este Scraper en español como opción por defecto para películas?"
|
||||||
if not videolibrarypath.endswith(sep):
|
if not videolibrarypath.endswith(sep):
|
||||||
videolibrarypath += sep
|
videolibrarypath += sep
|
||||||
strPath = videolibrarypath + config.get_setting("folder_movies") + sep
|
strPath = videolibrarypath + config.get_setting("folder_movies") + sep
|
||||||
else:
|
else:
|
||||||
strContent = 'tvshows'
|
strContent = 'tvshows'
|
||||||
strScraper = 'metadata.tvdb.com'
|
|
||||||
scanRecursive = 0
|
scanRecursive = 0
|
||||||
strSettings = "<settings><setting id='RatingS' value='TheTVDB' />" \
|
if seleccion == -1 or seleccion == 0:
|
||||||
"<setting id='absolutenumber' value='false' />" \
|
strScraper = 'metadata.tvdb.com'
|
||||||
"<setting id='dvdorder' value='false' />" \
|
path_settings = xbmc.translatePath("special://profile/addon_data/metadata.tvdb.com/settings.xml")
|
||||||
"<setting id='fallback' value='true' />" \
|
elif seleccion == 1:
|
||||||
"<setting id='fanart' value='true' />" \
|
strScraper = 'metadata.tvshows.themoviedb.org'
|
||||||
"<setting id='language' value='es' /></settings>"
|
path_settings = xbmc.translatePath("special://profile/addon_data/metadata.tvshows.themoviedb.org/settings.xml")
|
||||||
|
settings_data = filetools.read(path_settings)
|
||||||
|
strSettings = ' '.join(settings_data.split()).replace("> <", "><")
|
||||||
|
strSettings = strSettings.replace("\"","\'")
|
||||||
strActualizar = "¿Desea configurar este Scraper en español como opción por defecto para series?"
|
strActualizar = "¿Desea configurar este Scraper en español como opción por defecto para series?"
|
||||||
if not videolibrarypath.endswith(sep):
|
if not videolibrarypath.endswith(sep):
|
||||||
videolibrarypath += sep
|
videolibrarypath += sep
|
||||||
@@ -655,7 +674,8 @@ def set_content(content_type, silent=False):
|
|||||||
else:
|
else:
|
||||||
heading = "Videoteca %s configurada" % content_type
|
heading = "Videoteca %s configurada" % content_type
|
||||||
msg_text = "Felicidades la videoteca de Kodi ha sido configurada correctamente."
|
msg_text = "Felicidades la videoteca de Kodi ha sido configurada correctamente."
|
||||||
platformtools.dialog_notification(heading, msg_text, icon=1, time=10000)
|
platformtools.dialog_notification(heading, msg_text, icon=1, time=3000)
|
||||||
|
|
||||||
logger.info("%s: %s" % (heading, msg_text))
|
logger.info("%s: %s" % (heading, msg_text))
|
||||||
|
|
||||||
|
|
||||||
@@ -805,8 +825,8 @@ def ask_set_content(flag, silent=False):
|
|||||||
|
|
||||||
if not silent:
|
if not silent:
|
||||||
heading = "Alfa Auto-configuración"
|
heading = "Alfa Auto-configuración"
|
||||||
linea1 = "¿Desea que Alfa auto-configure la videoteca de Kodi?"
|
linea1 = "¿Desea que Alfa auto-configure la videoteca de Kodi? Se le pedirá que configure los scrapers para las películas y las series."
|
||||||
linea2 = "Si pulsa 'No' podra hacerlo desde 'Configuración > Preferencia > Rutas'."
|
linea2 = "Si pulsa 'No', podra hacerlo desde 'Configuración > Preferencia > Rutas'."
|
||||||
if platformtools.dialog_yesno(heading, linea1, linea2):
|
if platformtools.dialog_yesno(heading, linea1, linea2):
|
||||||
do_config()
|
do_config()
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -251,6 +251,10 @@ msgctxt "#30164"
|
|||||||
msgid "Delete this file"
|
msgid "Delete this file"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#30300"
|
||||||
|
msgid "Faster context menus"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
msgctxt "#30501"
|
msgctxt "#30501"
|
||||||
msgid "Paths"
|
msgid "Paths"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -261,4 +265,4 @@ msgstr ""
|
|||||||
|
|
||||||
msgctxt "#30999"
|
msgctxt "#30999"
|
||||||
msgid "Add key to open Shortcut"
|
msgid "Add key to open Shortcut"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|||||||
@@ -251,6 +251,10 @@ msgctxt "#30164"
|
|||||||
msgid "Delete this file"
|
msgid "Delete this file"
|
||||||
msgstr "Borrar este fichero"
|
msgstr "Borrar este fichero"
|
||||||
|
|
||||||
|
msgctxt "#30300"
|
||||||
|
msgid "Faster context menus"
|
||||||
|
msgstr "Menús contextuales rápidos (puede causar que algunas opciones no funcionen)"
|
||||||
|
|
||||||
msgctxt "#30501"
|
msgctxt "#30501"
|
||||||
msgid "Paths"
|
msgid "Paths"
|
||||||
msgstr "Rutas"
|
msgstr "Rutas"
|
||||||
@@ -261,4 +265,4 @@ msgstr "Acceso directo"
|
|||||||
|
|
||||||
msgctxt "#30999"
|
msgctxt "#30999"
|
||||||
msgid "Add key to open Shortcut"
|
msgid "Add key to open Shortcut"
|
||||||
msgstr "Añadir tecla para acceso directo"
|
msgstr "Añadir tecla para acceso directo"
|
||||||
|
|||||||
@@ -251,6 +251,10 @@ msgctxt "#30164"
|
|||||||
msgid "Delete this file"
|
msgid "Delete this file"
|
||||||
msgstr "Borrar este fichero"
|
msgstr "Borrar este fichero"
|
||||||
|
|
||||||
|
msgctxt "#30300"
|
||||||
|
msgid "Faster context menus"
|
||||||
|
msgstr "Menús contextuales rápidos (puede causar que algunas opciones no funcionen)"
|
||||||
|
|
||||||
msgctxt "#30501"
|
msgctxt "#30501"
|
||||||
msgid "Paths"
|
msgid "Paths"
|
||||||
msgstr "Rutas"
|
msgstr "Rutas"
|
||||||
@@ -261,4 +265,4 @@ msgstr "Acceso directo"
|
|||||||
|
|
||||||
msgctxt "#30999"
|
msgctxt "#30999"
|
||||||
msgid "Add key to open Shortcut"
|
msgid "Add key to open Shortcut"
|
||||||
msgstr "Añadir tecla para acceso directo"
|
msgstr "Añadir tecla para acceso directo"
|
||||||
|
|||||||
@@ -251,6 +251,10 @@ msgctxt "#30164"
|
|||||||
msgid "Delete this file"
|
msgid "Delete this file"
|
||||||
msgstr "Borrar este fichero"
|
msgstr "Borrar este fichero"
|
||||||
|
|
||||||
|
msgctxt "#30300"
|
||||||
|
msgid "Faster context menus"
|
||||||
|
msgstr "Menús contextuales rápidos (puede causar que algunas opciones no funcionen)"
|
||||||
|
|
||||||
msgctxt "#30501"
|
msgctxt "#30501"
|
||||||
msgid "Paths"
|
msgid "Paths"
|
||||||
msgstr "Rutas"
|
msgstr "Rutas"
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -7,6 +7,7 @@
|
|||||||
<setting id="channel_language" type="labelenum" values="all|cast|lat" label="30019" default="all"/>
|
<setting id="channel_language" type="labelenum" values="all|cast|lat" label="30019" default="all"/>
|
||||||
<setting id="trakt_sync" type="bool" label="Sincronizar con Trakt.tv (Debes tener una cuenta)" default="false"/>
|
<setting id="trakt_sync" type="bool" label="Sincronizar con Trakt.tv (Debes tener una cuenta)" default="false"/>
|
||||||
<setting id="forceview" type="bool" label="30043" default="false"/>
|
<setting id="forceview" type="bool" label="30043" default="false"/>
|
||||||
|
<setting id="faster_item_serialization" type="bool" label="30300" default="false"/>
|
||||||
<setting id="debug" type="bool" label="30003" default="false"/>
|
<setting id="debug" type="bool" label="30003" default="false"/>
|
||||||
<setting label="Uso de servidores" type="lsep"/>
|
<setting label="Uso de servidores" type="lsep"/>
|
||||||
<setting id="resolve_priority" type="enum" label="Método prioritario" values="Free primero|Premium primero|Debriders primero" default="0"/>
|
<setting id="resolve_priority" type="enum" label="Método prioritario" values="Free primero|Premium primero|Debriders primero" default="0"/>
|
||||||
@@ -23,13 +24,9 @@
|
|||||||
|
|
||||||
<!-- Path downloads -->
|
<!-- Path downloads -->
|
||||||
<category label="30501">
|
<category label="30501">
|
||||||
<setting id="path_selection" type="enum" values="Escribir ruta|Examinar ruta" default="0" label="Tipo de ruta"/>
|
<setting id="downloadpath" type="folder" label="30017" default=""/>
|
||||||
<setting id="downloadpath" type="text" label="30017" default="" visible="eq(-1,0)"/>
|
<setting id="downloadlistpath" type="folder" label="30018" default=""/>
|
||||||
<setting id="downloadpath" type="folder" label="30017" default="" visible="eq(-2,1)"/>
|
<setting id="videolibrarypath" type="folder" label="30067" default=""/>
|
||||||
<setting id="downloadlistpath" type="text" label="30018" default="" visible="eq(-3,0)"/>
|
|
||||||
<setting id="downloadlistpath" type="folder" label="30018" default="" visible="eq(-4,1)"/>
|
|
||||||
<setting id="videolibrarypath" type="text" label="30067" default="" visible="eq(-5,0)"/>
|
|
||||||
<setting id="videolibrarypath" type="folder" label="30067" default="" visible="eq(-6,1)"/>
|
|
||||||
|
|
||||||
<setting type="sep"/>
|
<setting type="sep"/>
|
||||||
<setting label="30131" type="lsep"/>
|
<setting label="30131" type="lsep"/>
|
||||||
@@ -49,7 +46,7 @@
|
|||||||
default="Peliculas" visible="eq(-3,True)+eq(-1,True)+eq(-2,False)" enable="eq(-3,True)+eq(-1,True)+(-2,false)"/>
|
default="Peliculas" visible="eq(-3,True)+eq(-1,True)+eq(-2,False)" enable="eq(-3,True)+eq(-1,True)+(-2,false)"/>
|
||||||
</category>
|
</category>
|
||||||
<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|angedam" 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 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 label="Opciones para Titulos" type="lsep"/>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pattern": "clipwatching.com/(\\w+)",
|
"pattern": "clipwatching.com/(\\w+)",
|
||||||
"url": "http://clipwatching.com/\\1.html"
|
"url": "http://clipwatching.com/embed-\\1.html"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ def get_video_url(page_url, user="", password="", video_password=""):
|
|||||||
logger.info("(page_url='%s')" % page_url)
|
logger.info("(page_url='%s')" % page_url)
|
||||||
data = httptools.downloadpage(page_url).data
|
data = httptools.downloadpage(page_url).data
|
||||||
video_urls = []
|
video_urls = []
|
||||||
videourl, label = scrapertools.find_single_match(data, 'file:"([^"]+).*?label:"([^"]+)')
|
videos = scrapertools.find_multiple_matches(data, 'file:"([^"]+).*?label:"([^"]+)')
|
||||||
video_urls.append([label + " [clipwatching]", videourl])
|
for video, label in videos:
|
||||||
|
video_urls.append([label + " [clipwatching]", video])
|
||||||
|
logger.info("Url: %s" %videos)
|
||||||
|
video_urls.sort(key=lambda it: int(it[0].split("p ", 1)[0]))
|
||||||
return video_urls
|
return video_urls
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"ignore_urls": [],
|
"ignore_urls": [],
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"pattern": "(https://filebebo.com/e/[a-zA-Z0-9]+)",
|
"pattern": "(https://filebebo.com/(?:e|d)/[a-zA-Z0-9]+)",
|
||||||
"url": "\\1"
|
"url": "\\1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -39,4 +39,4 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"thumbnail": "https://filebebo.com/images/logo.png"
|
"thumbnail": "https://filebebo.com/images/logo.png"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"ignore_urls": [],
|
"ignore_urls": [],
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"pattern": "flashx.(?:tv|pw|ws|sx)/(?:embed.php\\?c=|embed-|playvid-|)([A-z0-9]+)",
|
"pattern": "flashx.(?:tv|pw|ws|sx|to)/(?:embed.php\\?c=|embed-|playvid-|)([A-z0-9]+)",
|
||||||
"url": "https://www.flashx.tv/\\1.html"
|
"url": "https://www.flashx.tv/\\1.html"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
"ignore_urls": [],
|
"ignore_urls": [],
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"pattern": "vidup.me/(?:embed-|)([A-z0-9]+)",
|
"pattern": "vidup.(?:me|tv)/(?:embed-|)([A-z0-9]+)",
|
||||||
"url": "http://vidup.me/embed-\\1.html"
|
"url": "http://vidup.tv/embed-\\1.html"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -39,4 +39,4 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"thumbnail": "http://i.imgur.com/sZvy8IC.png?1"
|
"thumbnail": "http://i.imgur.com/sZvy8IC.png?1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,32 +7,25 @@ from platformcode import 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).data
|
data = httptools.downloadpage(page_url).data
|
||||||
|
|
||||||
if "Not Found" in data:
|
if "Not Found" in data:
|
||||||
return False, "[Vidup.me] El fichero no existe o ha sido borrado"
|
return False, "[Vidup] El fichero no existe o ha sido borrado"
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
data = httptools.downloadpage(page_url).data
|
data = httptools.downloadpage(page_url).data
|
||||||
key = scrapertools.find_single_match(data, "var mpri_Key\s*=\s*'([^']+)'")
|
key = scrapertools.find_single_match(data, "var thief\s*=\s*'([^']+)'")
|
||||||
data_vt = httptools.downloadpage("http://vidup.me/jwv/%s" % key).data
|
data_vt = httptools.downloadpage("http://vidup.tv/jwv/%s" % key).data
|
||||||
vt = scrapertools.find_single_match(data_vt, 'file\|(.*?)\|direct')
|
vt = scrapertools.find_single_match(data_vt, 'file\|direct\|(.*?)\|')
|
||||||
|
|
||||||
# Extrae la URL
|
# Extrae la URL
|
||||||
video_urls = []
|
video_urls = []
|
||||||
media_urls = scrapertools.find_multiple_matches(data, '\{"file"\:"([^"]+)","label"\:"([^"]+)"\}')
|
media_urls = scrapertools.find_multiple_matches(data, '\{"file"\:"([^"]+)","label"\:"([^"]+)"\}')
|
||||||
for media_url, label in media_urls:
|
for media_url, label in media_urls:
|
||||||
ext = scrapertools.get_filename_from_url(media_url)[-4:]
|
ext = scrapertools.get_filename_from_url(media_url)[-4:]
|
||||||
media_url += "?direct=false&ua=1&vt=%s" % vt
|
media_url += "?direct=false&ua=1&vt=%s" % vt
|
||||||
video_urls.append(["%s (%s) [vidup.me]" % (ext, label), media_url])
|
video_urls.append(["%s (%s) [vidup]" % (ext, label), media_url])
|
||||||
|
|
||||||
for video_url in video_urls:
|
for video_url in video_urls:
|
||||||
logger.info("%s - %s" % (video_url[0], video_url[1]))
|
logger.info("%s - %s" % (video_url[0], video_url[1]))
|
||||||
|
|
||||||
return video_urls
|
return video_urls
|
||||||
|
|||||||
Reference in New Issue
Block a user