Merge remote-tracking branch 'alfa-addon/master' into unify+autoplay
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<addon id="plugin.video.alfa" name="Alfa" version="2.4.3" provider-name="Alfa Addon">
|
||||
<addon id="plugin.video.alfa" name="Alfa" version="2.4.4" provider-name="Alfa Addon">
|
||||
<requires>
|
||||
<import addon="xbmc.python" version="2.1.0"/>
|
||||
<import addon="script.module.libtorrent" optional="true"/>
|
||||
@@ -10,7 +10,7 @@
|
||||
<extension point="xbmc.addon.metadata">
|
||||
<summary lang="es">Navega con Kodi por páginas web.</summary>
|
||||
<assets>
|
||||
<icon>icon.png</icon>
|
||||
<icon>icon1.png</icon>
|
||||
<fanart>fanart.jpg</fanart>
|
||||
<screenshot>resources/media/themes/ss/1.jpg</screenshot>
|
||||
<screenshot>resources/media/themes/ss/2.jpg</screenshot>
|
||||
@@ -19,11 +19,8 @@
|
||||
</assets>
|
||||
<news>[B]Estos son los cambios para esta versión:[/B]
|
||||
[COLOR green][B]Canales agregados y arreglos[/B][/COLOR]
|
||||
» cinetux » descargasmix
|
||||
» hdfull » peliculasdk
|
||||
» pelisfox » yaske
|
||||
» gvideo » powvideo
|
||||
» yourupload ¤ arreglos internos
|
||||
» pelisplus » pelisplusco
|
||||
» gvideo ¤ arreglos internos
|
||||
</news>
|
||||
<description lang="es">Navega con Kodi por páginas web para ver sus videos de manera fácil.</description>
|
||||
<summary lang="en">Browse web pages using Kodi</summary>
|
||||
|
||||
@@ -146,8 +146,7 @@ def search(item, texto):
|
||||
logger.info()
|
||||
texto = texto.replace(" ", "+")
|
||||
item.url = host + 'busqueda/?s=' + texto
|
||||
if not item.extra:
|
||||
item.extra = 'peliculas/'
|
||||
|
||||
try:
|
||||
if texto != '':
|
||||
return lista(item)
|
||||
@@ -174,7 +173,7 @@ def lista(item):
|
||||
|
||||
data = httptools.downloadpage(item.url).data
|
||||
|
||||
if item.title != 'Buscar':
|
||||
if item.action != 'search':
|
||||
patron = '<img.*?width="147" heigh="197".*?src="([^"]+)".*?>.*?.<i class="icon online-play"><\/i>.*?.<h2 ' \
|
||||
'class="title title-.*?">.*?.<a href="([^"]+)" title="([^"]+)">.*?>'
|
||||
actual = scrapertools.find_single_match(data,
|
||||
@@ -197,8 +196,8 @@ def lista(item):
|
||||
# de tmdb
|
||||
filtro_list = filtro_list.items()
|
||||
|
||||
if item.action != 'search':
|
||||
|
||||
if item.title != 'Buscar':
|
||||
new_item=(
|
||||
Item(channel=item.channel,
|
||||
contentType=tipo,
|
||||
@@ -217,6 +216,14 @@ def lista(item):
|
||||
new_item.contentTitle = scrapedtitle
|
||||
itemlist.append(new_item)
|
||||
else:
|
||||
if item.extra=='':
|
||||
item.extra = scrapertools.find_single_match(url, 'serie|pelicula')+'s/'
|
||||
if 'series/' in item.extra:
|
||||
accion = 'temporadas'
|
||||
tipo = 'tvshow'
|
||||
else:
|
||||
accion = 'findvideos'
|
||||
tipo = 'movie'
|
||||
item.extra = item.extra.rstrip('s/')
|
||||
if item.extra in url:
|
||||
new_item=(
|
||||
@@ -238,7 +245,7 @@ def lista(item):
|
||||
itemlist.append(new_item)
|
||||
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
if item.title != 'Buscar' and actual != '':
|
||||
if item.action != 'search' and actual != '':
|
||||
if itemlist != []:
|
||||
next_page = str(int(actual) + 1)
|
||||
next_page_url = item.extra + 'pag-' + next_page
|
||||
|
||||
@@ -97,12 +97,12 @@ def list_all (item):
|
||||
contentType = 'pelicula'
|
||||
action = 'findvideos'
|
||||
|
||||
patron = 'item-%s><a href=(.*?)><figure><img src=https:(.*?)'%contentType
|
||||
patron += ' alt=><\/figure><p>(.*?)<\/p><span>(.*?)<\/span>'
|
||||
patron = 'item-%s><a href=(.*?)><figure><img.*?data-src=(.*?) alt=.*?<p>(.*?)<\/p><span>(\d{4})<\/span>'%contentType
|
||||
|
||||
matches = re.compile(patron,re.DOTALL).findall(data)
|
||||
|
||||
for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedyear in matches:
|
||||
url = host+scrapedurl
|
||||
url = host+scrapedurl+'p001/'
|
||||
thumbnail = scrapedthumbnail
|
||||
plot= ''
|
||||
contentTitle=scrapedtitle
|
||||
@@ -263,7 +263,9 @@ def findvideos(item):
|
||||
video_list = []
|
||||
data = httptools.downloadpage(item.url).data
|
||||
data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data)
|
||||
patron = 'data-source=(.*?) data.*?-srt=(.*?) data-iframe=0><a>(.*?) - (.*?)<\/a>'
|
||||
|
||||
patron = 'data-source=(.*?) .*?tab.*?data.*?srt=(.*?) data-iframe=><a>(.*?)\s?-\s?(.*?)<\/a>'
|
||||
|
||||
matches = matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
|
||||
for url, sub, language, quality in matches:
|
||||
|
||||
@@ -557,12 +557,12 @@ def detalles(item):
|
||||
itemlist.append(item.clone(channel="trailertools", action="buscartrailer", title="Buscar Tráiler",
|
||||
text_color=color5))
|
||||
|
||||
# try:
|
||||
# images['tmdb'] = ob_tmdb.result["images"]
|
||||
# itemlist.append(item.clone(action="imagenes", title="Lista de Imágenes", text_color=color5, images=images,
|
||||
# extra="menu"))
|
||||
# except:
|
||||
# pass
|
||||
try:
|
||||
images['tmdb'] = ob_tmdb.result["images"]
|
||||
itemlist.append(item.clone(action="imagenes", title="Lista de Imágenes", text_color=color5, images=images,
|
||||
extra="menu"))
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
if item.contentType == "movie" and item.infoLabels["year"] < 2014:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
# --------------------------------------------------------------------------------
|
||||
# Server management
|
||||
# --------------------------------------------------------------------------------
|
||||
@@ -75,7 +75,6 @@ def get_servers_itemlist(itemlist, fnc=None, sort=False):
|
||||
@param sort: indica si el listado resultante se ha de ordenar en funcion de la lista de servidores favoritos
|
||||
@type sort: bool
|
||||
"""
|
||||
server_stats = {}
|
||||
# Recorre los servidores
|
||||
for serverid in get_servers_list().keys():
|
||||
server_parameters = get_server_parameters(serverid)
|
||||
@@ -90,7 +89,6 @@ def get_servers_itemlist(itemlist, fnc=None, sort=False):
|
||||
for x in range(len(match.groups())):
|
||||
url = url.replace("\\%s" % (x + 1), match.groups()[x])
|
||||
|
||||
server_stats[serverid] = "found"
|
||||
for item in itemlist:
|
||||
if match.group() in item.url:
|
||||
if not item.contentThumbnail:
|
||||
@@ -102,8 +100,6 @@ def get_servers_itemlist(itemlist, fnc=None, sort=False):
|
||||
else:
|
||||
item.url = url
|
||||
|
||||
save_server_stats(server_stats, "find_videos")
|
||||
|
||||
# Eliminamos los servidores desactivados
|
||||
itemlist = filter(lambda i: not i.server or is_server_enabled(i.server), itemlist)
|
||||
|
||||
@@ -188,10 +184,6 @@ def findvideosbyserver(data, serverid):
|
||||
devuelve.append(value)
|
||||
logger.info(msg)
|
||||
|
||||
# Guardar estadisticas
|
||||
if devuelve:
|
||||
save_server_stats({serverid: "found"}, "find_videos")
|
||||
|
||||
return devuelve
|
||||
|
||||
|
||||
@@ -324,11 +316,8 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
try:
|
||||
logger.info("Invocando a %s.get_video_url" % server)
|
||||
response = serverid.get_video_url(page_url=url, video_password=video_password)
|
||||
if response:
|
||||
save_server_stats({server: "sucess"}, "resolve")
|
||||
video_urls.extend(response)
|
||||
except:
|
||||
save_server_stats({server: "error"}, "resolve")
|
||||
logger.error("Error al obtener la url en modo free")
|
||||
error_messages.append("Se ha producido un error en %s" % server_name)
|
||||
import traceback
|
||||
@@ -343,16 +332,12 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
password=config.get_setting("password", server=opcion),
|
||||
video_password=video_password)
|
||||
if response and response[0][1]:
|
||||
if opcion == server:
|
||||
save_server_stats({server: "sucess"}, "resolve")
|
||||
video_urls.extend(response)
|
||||
elif response and response[0][0]:
|
||||
error_messages.append(response[0][0])
|
||||
else:
|
||||
error_messages.append("Se ha producido un error en %s" % server_name)
|
||||
except:
|
||||
if opcion == server:
|
||||
save_server_stats({server: "error"}, "resolve")
|
||||
logger.error("Error en el servidor: %s" % opcion)
|
||||
error_messages.append("Se ha producido un error en %s" % server_name)
|
||||
import traceback
|
||||
@@ -720,41 +705,3 @@ def filter_servers(servers_list):
|
||||
servers_list = servers_list_filter
|
||||
|
||||
return servers_list
|
||||
|
||||
|
||||
def save_server_stats(stats, type="find_videos"):
|
||||
if not config.get_setting("server_stats"):
|
||||
return
|
||||
|
||||
stats_file = os.path.join(config.get_data_path(), "server_stats.json")
|
||||
today = datetime.datetime.now().strftime("%Y%m%d")
|
||||
|
||||
# Leemos el archivo
|
||||
try:
|
||||
server_stats = jsontools.load(open(stats_file, "rb").read())
|
||||
except:
|
||||
server_stats = {"created": time.time(), "data": {}}
|
||||
|
||||
# Actualizamos los datos
|
||||
for server in stats:
|
||||
if not server in server_stats["data"]:
|
||||
server_stats["data"][server] = {}
|
||||
|
||||
if not today in server_stats["data"][server]:
|
||||
server_stats["data"][server][today] = {"find_videos": {"found": 0}, "resolve": {"sucess": 0, "error": 0}}
|
||||
|
||||
server_stats["data"][server][today][type][stats[server]] += 1
|
||||
|
||||
# Guardamos el archivo
|
||||
open(stats_file, "wb").write(jsontools.dump(server_stats))
|
||||
|
||||
# Enviamos al servidor
|
||||
return
|
||||
if time.time() - server_stats["created"] > 86400: # 86400: #1 Dia
|
||||
from core import httptools
|
||||
if httptools.downloadpage("url servidor", headers={'Content-Type': 'application/json'},
|
||||
post=jsontools.dump(server_stats)).sucess:
|
||||
os.remove(stats_file)
|
||||
logger.info("Datos enviados correctamente")
|
||||
else:
|
||||
logger.info("No se han podido enviar los datos")
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 177 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 836 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 85 KiB |
BIN
plugin.video.alfa/icon1.png
Normal file
BIN
plugin.video.alfa/icon1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 153 KiB |
@@ -805,7 +805,7 @@ def ask_set_content(flag, silent=False):
|
||||
|
||||
if not silent:
|
||||
heading = "Alfa Auto-configuración"
|
||||
linea1 = "¿Desea que Alfa auto-configure la videteoca de Kodi?"
|
||||
linea1 = "¿Desea que Alfa auto-configure la videoteca de Kodi?"
|
||||
linea2 = "Si pulsa 'No' podra hacerlo desde 'Configuración > Preferencia > Rutas'."
|
||||
if platformtools.dialog_yesno(heading, linea1, linea2):
|
||||
do_config()
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<setting id="resolve_priority" type="enum" label="Método prioritario" values="Free primero|Premium primero|Debriders primero" default="0"/>
|
||||
<setting id="resolve_stop" type="bool" label="Dejar de buscar cuando encuentre una opción" default="true"/>
|
||||
<setting id="hidepremium" type="bool" label="Ocultar servidores de pago sin cuenta" default="false"/>
|
||||
<setting id="server_stats" type="bool" label="Enviar estadisticas sobre el uso de servidores" default="true"/>
|
||||
<setting type="sep"/>
|
||||
<setting label="Canales para adultos" type="lsep"/>
|
||||
<setting id="adult_aux_intro_password" type="text" label="Contraseña (por defecto 0000):" option="hidden" default=""/>
|
||||
|
||||
@@ -20,7 +20,8 @@ def test_video_exists(page_url):
|
||||
return False, "[gvideo] No tienes permiso para acceder a este video"
|
||||
if "Se ha producido un error" in response.data:
|
||||
return False, "[gvideo] Se ha producido un error en el reproductor de google"
|
||||
|
||||
if "No+se+puede+procesar+este" in response.data:
|
||||
return False, "[gvideo] No se puede procesar este video"
|
||||
return True, ""
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user