Merge branch 'master' into prueba_request

This commit is contained in:
Alfa
2018-07-18 08:42:00 -05:00
committed by GitHub
19 changed files with 129 additions and 54 deletions

View File

@@ -128,7 +128,7 @@
"label": "@70238",
"lvalues": [
"@70244",
"@70245"
"Reordenar"
],
"default": 1,
"enabled": true,
@@ -145,7 +145,7 @@
"Vose, Eng, Sub, Esp, Lat"
],
"default": 0,
"enabled": "eq(-1,@70245])",
"enabled": "eq(-1,'Reordenar')",
"visible": true
},
{
@@ -159,7 +159,7 @@
"SD"
],
"default": 0,
"enabled": "eq(-2,@70245])",
"enabled": "eq(-2,'Reordenar')",
"visible": true
},
{
@@ -167,8 +167,8 @@
"type": "bool",
"label": "@70242",
"default": true,
"enabled": "eq(-3,@70245])",
"enabled": "eq(-3,'Reordenar')",
"visible": true
}
]
}
}

View File

@@ -98,7 +98,10 @@ def mainlist(item):
def settingCanal(item):
from platformcode import platformtools
return platformtools.show_channel_settings()
platformtools.show_channel_settings()
platformtools.itemlist_refresh()
return
def submenu(item):

View File

@@ -612,11 +612,11 @@ def setting_channel(item):
list_controls.append(control)
caption = "Canales incluidos en Novedades " + item.title.replace("Canales incluidos en: ", "- ").strip()
caption = config.get_localized_string(60533) + item.title.replace(config.get_localized_string(60525), "- ").strip()
if config.get_setting("custom_button_value_news", item.channel):
custom_button_label = "Ninguno"
custom_button_label = config.get_localized_string(59992)
else:
custom_button_label = "Todos"
custom_button_label = config.get_localized_string(59991)
return platformtools.show_channel_settings(list_controls=list_controls,
caption=caption,

View File

@@ -160,7 +160,7 @@ def searchbycat(item):
# Only in xbmc/kodi
# Abre un cuadro de dialogo con las categorías en las que hacer la búsqueda
categories = ["Películas", "Series", "Anime", "Documentales", "VOS", "Latino"]
categories = [config.get_localized_string(30122), config.get_localized_string(30123), config.get_localized_string(30124), config.get_localized_string(30125), config.get_localized_string(59975), config.get_localized_string(59976)]
categories_id = ["movie", "tvshow", "anime", "documentary", "vos", "latino"]
list_controls = []
for i, category in enumerate(categories):
@@ -416,7 +416,7 @@ def do_search(item, categories=None):
percentage = int(math.ceil(index * t))
list_pendent_names = [a.getName() for a in pendent]
mensaje = "Buscando en %s" % (", ".join(list_pendent_names))
mensaje = config.get_localized_string(70282) % (", ".join(list_pendent_names))
progreso.update(percentage, config.get_localized_string(60521) % (len(threads) - len(pendent), len(threads)),
mensaje)
logger.debug(mensaje)

View File

@@ -16,10 +16,10 @@ def mainlist(item):
itemlist = list()
itemlist.append(Item(channel=item.channel, action="list_movies", title=config.get_localized_string(60509),
category="Videoteca de películas",
category=config.get_localized_string(70270),
thumbnail=get_thumb("videolibrary_movie.png")))
itemlist.append(Item(channel=item.channel, action="list_tvshows", title=config.get_localized_string(60600),
category="Videoteca de series",
category=config.get_localized_string(70271),
thumbnail=get_thumb("videolibrary_tvshow.png")))
return itemlist
@@ -146,7 +146,7 @@ def list_tvshows(item):
"action": "delete",
"channel": "videolibrary",
"multicanal": multicanal},
{"title": "Buscar nuevos episodios ahora",
{"title": config.get_localized_string(70269),
"action": "update_tvshow",
"channel": "videolibrary"}]
# ,{"title": "Cambiar contenido (PENDIENTE)",

View File

@@ -812,7 +812,7 @@ def downloadfileGzipped(url, pathfichero):
# Crea el diálogo de progreso
from platformcode import platformtools
progreso = platformtools.dialog_progress("addon", "Descargando...", url.split("|")[0], nombrefichero)
progreso = platformtools.dialog_progress("addon", config.get_localized_string(60200), url.split("|")[0], nombrefichero)
# Timeout del socket a 60 segundos
socket.setdefaulttimeout(10)

View File

@@ -29,7 +29,7 @@ def find_and_set_infoLabels(item):
# Obtener el Scraper por defecto de la configuracion segun el tipo de contenido
if item.contentType == "movie":
scraper_actual = ['tmdb'][config.get_setting("scraper_movies", "videolibrary")]
tipo_contenido = "película"
tipo_contenido = config.get_localized_string(70283)
title = item.contentTitle
# Completar lista de opciones para este tipo de contenido
list_opciones_cuadro.append(scrapers_disponibles['tmdb'])

View File

@@ -198,6 +198,9 @@ def post_tmdb_listado(item, itemlist):
for item_local in itemlist: #Recorremos el Itenlist generado por el canal
title = item_local.title
#logger.debug(item_local)
item_local.last_page = 0
del item_local.last_page #Borramos restos de paginación
if item_local.contentSeason_save: #Restauramos el num. de Temporada
item_local.contentSeason = item_local.contentSeason_save
@@ -710,9 +713,7 @@ def post_tmdb_findvideos(item, itemlist):
title_gen = '%s: %s' % (item.category.capitalize(), title_gen)
#Pintamos el pseudo-título con toda la información disponible del vídeo
item.action = ""
item.server = ""
itemlist.append(item.clone(title=title_gen)) #Título con todos los datos del vídeo
itemlist.append(item.clone(action="", server = "", title=title_gen)) #Título con todos los datos del vídeo
#agregamos la opción de Añadir a Videoteca para péliculas (no series)
if item.contentType == 'movie' and item.contentChannel != "videolibrary":

View File

@@ -4,6 +4,7 @@ import random
import struct
import time
import urllib
from core import httptools
from threading import Thread
from file import File
@@ -132,9 +133,9 @@ class Client(object):
raise Exception("Enlace no valido")
def api_req(self, req, get=""):
seqno = random.randint(0, 0xFFFFFFFF)
url = 'https://g.api.mega.co.nz/cs?id=%d%s' % (seqno, get)
return json.loads(self.post(url, json.dumps([req])))[0]
seqno = random.randint(0, 0xFFFFFFFF)
url = 'https://g.api.mega.co.nz/cs?id=%d%s' % (seqno, get)
return json.loads(self.post(url, json.dumps([req])))[0]
def base64urldecode(self,data):
data += '=='[(2 - len(data) * 3) % 4:]
@@ -179,6 +180,7 @@ class Client(object):
return sum((self.aes_cbc_decrypt_a32(a[i:i+4], key) for i in xrange(0, len(a), 4)), ())
def post(self, url, data):
return httptools.downloadpage(url, data).data
import ssl
from functools import wraps
def sslwrap(func):

View File

@@ -37,11 +37,11 @@ def download_and_play(url, file_name, download_path):
while True:
cancelled = False
dialog = xbmcgui.DialogProgress()
dialog.create('Descargando...', 'Cierra esta ventana para empezar la reproducción')
dialog.create(config.get_localized_string(60200), config.get_localized_string(60312))
dialog.update(0)
while not cancelled and download_thread.isAlive():
dialog.update(download_thread.get_progress(), "Cancela esta ventana para empezar la reproducción",
dialog.update(download_thread.get_progress(), config.get_localized_string(60313),
"Velocidad: " + str(int(download_thread.get_speed() / 1024)) + " KB/s " + str(
download_thread.get_actual_size()) + "MB de " + str(
download_thread.get_total_size()) + "MB",

View File

@@ -1048,6 +1048,21 @@ def play_torrent(item, xlistitem, mediaurl):
if seleccion > 1:
mediaurl = urllib.quote_plus(item.url)
xbmc.executebuiltin("PlayMedia(" + torrent_options[seleccion][1] % mediaurl + ")")
if "quasar" in torrent_options[seleccion][1]: #Seleccionamos que clientes torrent soportamos
if item.strm_path: #Sólo si es de Videoteca
import time
time_limit = time.time() + 150 #Marcamos el timepo máx. de buffering
while not is_playing() and time.time() < time_limit: #Esperamos mientra buffera
time.sleep(5) #Repetimos cada intervalo
logger.debug(str(time_limit))
if is_playing(): #Ha terminado de bufferar o ha cancelado
from platformcode import xbmc_videolibrary
xbmc_videolibrary.mark_auto_as_watched(item) #Marcamos como visto al terminar
logger.debug("Llamado el marcado")
else:
logger.debug("Video cancelado o timeout")
if seleccion == 1:
from platformcode import mct

View File

@@ -196,48 +196,48 @@ class InfoWindow(xbmcgui.WindowXMLDialog):
# Cargamos los datos para el formato pelicula
if self.result.get("mediatype", "movie") == "movie":
self.getControl(10006).setLabel("Título:")
self.getControl(10006).setLabel(config.get_localized_string(60377))
self.getControl(10007).setLabel(self.result.get("title", "N/A"))
self.getControl(10008).setLabel("Título original:")
self.getControl(10008).setLabel(config.get_localized_string(60378))
self.getControl(10009).setLabel(self.result.get("originaltitle", "N/A"))
self.getControl(100010).setLabel("Idioma original:")
self.getControl(100010).setLabel(config.get_localized_string(60379))
self.getControl(100011).setLabel(self.result.get("language", "N/A"))
self.getControl(100012).setLabel("Puntuación:")
self.getControl(100012).setLabel(config.get_localized_string(60380))
self.getControl(100013).setLabel(self.result.get("puntuacion", "N/A"))
self.getControl(100014).setLabel("Lanzamiento:")
self.getControl(100014).setLabel(config.get_localized_string(60381))
self.getControl(100015).setLabel(self.result.get("release_date", "N/A"))
self.getControl(100016).setLabel("Géneros:")
self.getControl(100016).setLabel(config.get_localized_string(60382))
self.getControl(100017).setLabel(self.result.get("genre", "N/A"))
# Cargamos los datos para el formato serie
else:
self.getControl(10006).setLabel("Serie:")
self.getControl(10006).setLabel(config.get_localized_string(60383))
self.getControl(10007).setLabel(self.result.get("title", "N/A"))
self.getControl(10008).setLabel("Idioma original:")
self.getControl(10008).setLabel(config.get_localized_string(60379))
self.getControl(10009).setLabel(self.result.get("language", "N/A"))
self.getControl(100010).setLabel("Puntuación:")
self.getControl(100010).setLabel(config.get_localized_string(60380))
self.getControl(100011).setLabel(self.result.get("puntuacion", "N/A"))
self.getControl(100012).setLabel("Géneros:")
self.getControl(100012).setLabel(config.get_localized_string(60382)
self.getControl(100013).setLabel(self.result.get("genre", "N/A"))
if self.result.get("season"):
self.getControl(100014).setLabel("Título temporada:")
self.getControl(100014).setLabel(config.get_localized_string(60384))
self.getControl(100015).setLabel(self.result.get("temporada_nombre", "N/A"))
self.getControl(100016).setLabel("Temporada:")
self.getControl(100016).setLabel(config.get_localized_string(60385))
self.getControl(100017).setLabel(self.result.get("season", "N/A") + " de " +
self.result.get("seasons", "N/A"))
if self.result.get("episode"):
self.getControl(100014).setLabel("Título:")
self.getControl(100014).setLabel(config.get_localized_string(60377))
self.getControl(100015).setLabel(self.result.get("episode_title", "N/A"))
self.getControl(100018).setLabel("Episodio:")
self.getControl(100018).setLabel(config.get_localized_string(60386))
self.getControl(100019).setLabel(self.result.get("episode", "N/A") + " de " +
self.result.get("episodes", "N/A"))
self.getControl(100020).setLabel("Emisión:")
self.getControl(100020).setLabel(config.get_localized_string(60387))
self.getControl(100021).setLabel(self.result.get("date", "N/A"))
# Sinopsis
if self.result['plot']:
self.getControl(100022).setLabel("Sinopsis:")
self.getControl(100022).setLabel(config.get_localized_string(60388))
self.getControl(100023).setText(self.result.get("plot", "N/A"))
else:
self.getControl(100022).setLabel("")

View File

@@ -3725,6 +3725,14 @@ msgctxt "#70254"
msgid "Internal Client"
msgstr ""
msgctxt "#70281"
msgid "Do you want to show these links?"
msgstr ""
msgctxt "#70282"
msgid "Searching in %s"
msgstr ""
msgctxt "#70255"
msgid "Internal client - MCT"
msgstr ""
@@ -3817,3 +3825,18 @@ msgctxt "#70279"
msgid "You can try downloading the 'libtorrent' module from Kodi or installing some addon like 'Quasar' or 'Torrenter', \nwhich will appear among the options in the pop-up \nwhen it appears when clicking on a torrent link. 'Torrenter 'It's more complex but also more complete \nand it always works.'"
msgstr ""
msgctxt "#70280"
msgid " - Torrent Links don't work."
msgstr ""
msgctxt "#70281"
msgid "Do you want to show these links?"
msgstr ""
msgctxt "#70282"
msgid "Searching in %s"
msgstr ""
msgctxt "#70283"
msgid "movie"
msgstr ""

View File

@@ -391,7 +391,7 @@ msgstr "Alfa Auto-configurazione"
msgctxt "#59972"
msgid "Search for: '%s' | Found: %d vídeos | Time: %2.f seconds"
msgstr "Ricerca di: '%s' | Trovati: %d vídeos | Tempo: %2.f secondi"
msgstr "Ricerca di: '%s' | Trovati: %d video | Tempo: %2.f secondi"
msgctxt "#59973"
msgid "Search Cancelled"
@@ -971,7 +971,7 @@ msgstr "Nessuna informazione trovata per: %s"
msgctxt "#60229"
msgid "Enter the name of %s to search"
msgstr "Inserisci il nome di %s per cercare"
msgstr "Inserisci il titolo del %s per cercare"
msgctxt "#60230"
msgid "Title:"
@@ -1687,7 +1687,7 @@ msgstr "Altre opzioni"
msgctxt "#60421"
msgid "Channels included in the global search "
msgstr "Canali inclusi nella ricerca globale "
msgstr "Canali inclusi nella ricerca globale: "
msgctxt "#60422"
msgid "Search "
@@ -3809,5 +3809,14 @@ msgctxt "#70280"
msgid " - Torrent Links don't work."
msgstr " - I Link Torrent non funzionano."
msgctxt "#70281"
msgid "Do you want to show these links?"
msgstr "Vuoi vedere questi links"
msgctxt "#70282"
msgid "Searching in %s"
msgstr "Ricerca in %s"
msgctxt "#70283"
msgid "movie"
msgstr "film"

View File

@@ -3793,4 +3793,15 @@ msgctxt "#70280"
msgid " - Torrent Links don't work."
msgstr " - Los enlaces Torrent no funcionan."
msgctxt "#70281"
msgid "Do you want to show these links?"
msgstr "¿Desea mostrar estos enlaces?"
msgctxt "#70282"
msgid "Searching in %s"
msgstr "Buscando en %s"
msgctxt "#70283"
msgid "movie"
msgstr "pelicula"

View File

@@ -3793,4 +3793,14 @@ msgctxt "#70280"
msgid " - Torrent Links don't work."
msgstr " - Los enlaces Torrent no funcionan."
msgctxt "#70281"
msgid "Do you want to show these links?"
msgstr "¿Desea mostrar estos enlaces?"
msgctxt "#70282"
msgid "Searching in %s"
msgstr "Buscando en %s"
msgctxt "#70283"
msgid "movie"
msgstr "pelicula"

View File

@@ -3793,4 +3793,10 @@ msgctxt "#70280"
msgid " - Torrent Links don't work."
msgstr " - Los enlaces Torrent no funcionan."
msgctxt "#70281"
msgid "Do you want to show these links?"
msgstr "¿Desea mostrar estos enlaces?"
msgctxt "#70282"
msgid "Searching in %s"
msgstr "Buscando en %s"

View File

@@ -27,7 +27,7 @@
<shadowcolor>black</shadowcolor>
<align>center</align>
<aligny>center</aligny>
<label>Opciones</label>
<label>$ADDON[plugin.video.alfa 70000]</label>
</control>
<control type="button" id="10003">
<posx>735</posx>
@@ -303,7 +303,7 @@
<texturenofocus>Controls/KeyboardKeyNF.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>Anterior</label>
<label>$ADDON[plugin.video.alfa 70005]</label>
</control>
<control type="button" id="10026">
<posy>0</posy>
@@ -315,7 +315,7 @@
<texturenofocus>Controls/KeyboardKeyNF.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>Siguiente</label>
<label>$ADDON[plugin.video.alfa 70006]</label>
</control>
<control type="button" id="10027">
<posy>0</posy>
@@ -327,7 +327,7 @@
<texturenofocus>Controls/KeyboardKeyNF.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>Cancelar</label>
<label>$ADDON[plugin.video.alfa 70002]</label>
</control>
<control type="button" id="10028">
<posy>0</posy>
@@ -339,7 +339,7 @@
<texturenofocus>Controls/KeyboardKeyNF.png</texturenofocus>
<align>center</align>
<aligny>center</aligny>
<label>Aceptar</label>
<label>$ADDON[plugin.video.alfa 70007]</label>
</control>
<control type="label" id="100029">
<posy>0</posy>
@@ -356,4 +356,4 @@
</control>
</control>
</controls>
</window>
</window>

View File

@@ -27,11 +27,6 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
referer = page_url.replace('iframe', 'preview')
data = httptools.downloadpage(page_url, headers={'referer': referer}).data
if data == "File was deleted":
return "El archivo no existe o ha sido borrado"
if 'Video is processing now' in data:
return "El vídeo está siendo procesado, intentalo de nuevo mas tarde"
packed = scrapertools.find_single_match(data, "<script type=[\"']text/javascript[\"']>(eval.*?)</script>")
unpacked = jsunpack.unpack(packed)