Merge pull request #322 from Intel11/master

Actualizados
This commit is contained in:
Alfa
2018-06-27 15:55:30 -05:00
committed by GitHub
16 changed files with 161 additions and 233 deletions
+24
View File
@@ -0,0 +1,24 @@
Esta versión de Alfa no necesita de ningún programa para instalar (tampoco kodi), es una versión independiente que solo necesita un navegador web y un equipo (en el cual será instalado) para ver el contenido desde cualquier dispositivo que cuente con un navegador web.
REQUISITOS:
Se necesita que esté instalado python 2.x desde aqui: https://www.python.org/
COMO INSTALAR LA VERSION MEDIASERVER:
-Descargar Alfa desde el reposotorio de Github: https://github.com/alfa-addon/addon (opcion Clone or download - Download zip
-El archivo descargado (addon-master.zip) abrirlo e ingresar a la carpeta: addon-master
-Descomprimir la carpeta plugin.video.alfa en alguna carpeta
-Luego descomprimir la carpeta mediaserver encima de la carpeta plugi.video.alfa reemplazando los archivos existentes.
COMO INICIAR LA VERSION MEDIASERVER
Para iniciar: python alfa.py
Y mostrará en pantalla la url a la cual se puede conectar desde cualquier dispositivo que contenga un navegador web.
Ejemplo:
http://192.168.1.10:8080
@@ -1,2 +0,0 @@
Debe ejecutar primero el archivo "script.py", si no lo hizo antes.
Una vez realizado el proceso podrá ejecutar como siempre "alfa.py" para iniciar el addon.
+18
View File
@@ -310,6 +310,23 @@ def verify_directories_created():
logger.debug("Creating %s: %s" % (path, saved_path))
filetools.mkdir(saved_path)
config_paths = [["folder_movies", "CINE"],
["folder_tvshows", "SERIES"]]
for path, default in config_paths:
saved_path = get_setting(path)
if not saved_path:
saved_path = default
set_setting(path, saved_path)
content_path = filetools.join(get_videolibrary_path(), saved_path)
if not filetools.exists(content_path):
logger.debug("Creating %s: %s" % (path, content_path))
# si se crea el directorio
filetools.mkdir(content_path)
def get_local_ip():
import socket
@@ -372,6 +389,7 @@ if not os.path.exists(get_data_path()):
TRANSLATION_FILE_PATH = os.path.join(get_runtime_path(), "resources", "language", "Spanish", "strings.po")
load_settings()
# modo adulto:
# sistema actual 0: Nunca, 1:Siempre, 2:Solo hasta que se reinicie sesión
# si es == 2 lo desactivamos.
@@ -131,9 +131,12 @@ div.header {
}
div.header > div.logo {
float: left;
height: 50px;
width: 70px;
background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2270px%22%20height%3D%2250px%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20xml%3Aspace%3D%22preserve%22%3E%0A%3Crect%20fill%3D%22%2391D9E8%22%20stroke%3D%22%2301455C%22%20stroke-width%3D%221%22%20x%3D%229%22%20y%3D%2215%22%20width%3D%2240.4%22%20height%3D%2226.5%22%2F%3E%0A%3Crect%20fill%3D%22%2303BFEC%22%20stroke%3D%22%2301455C%22%20stroke-width%3D%221%22%20x%3D%226%22%20y%3D%229%22%20width%3D%2210.8%22%20height%3D%229.3%22%20rx%3D%222%22%20ry%3D%222%22%2F%3E%0A%3Crect%20fill%3D%22%2303BFEC%22%20stroke%3D%22%2301455C%22%20stroke-width%3D%221%22%20x%3D%2237%22%20y%3D%2235%22%20width%3D%2215.5%22%20height%3D%2212.4%22%20rx%3D%222%22%20ry%3D%222%22%2F%3E%0A%3Crect%20fill%3D%22%2300ABE3%22%20stroke%3D%22%2301455C%22%20stroke-width%3D%221%22%20x%3D%2233%22%20y%3D%222%22%20width%3D%2234.2%22%20height%3D%2225%22%20rx%3D%222%22%20ry%3D%222%22%2F%3E%0A%3Crect%20fill%3D%22%2303BFEC%22%20stroke%3D%22%2301455C%22%20stroke-width%3D%221%22%20x%3D%223%22%20y%3D%2227%22%20width%3D%2224.8%22%20height%3D%2217%22%20rx%3D%222%22%20ry%3D%222%22%2F%3E%0A%3C%2Fsvg%3E");
height: 45px;
width: 60px;
margin-left: 15px;
margin-top: 2px;
background-repeat: no-repeat;
background-image: url("https://github.com/alfa-addon/addon/raw/master/mediaserver/platformcode/template/logo-mediaserver.png");
}
div.header > a.settings:after {
@@ -1303,4 +1306,4 @@ ul.itemlist > li.item_list > a.item > h3.label {
padding-top: 0px;
left: 0px;
right: 0px;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

-110
View File
@@ -1,110 +0,0 @@
# -*- coding: utf-8 -*-
import os
import re
import shutil
from platformcode import config, logger, platformtools
def conversion():
logger.info()
data = ""
try:
# do a backup
path_settings = os.path.join(config.get_data_path(), "settings.xml")
path_settings_backup = os.path.join(config.get_data_path(), "settings.backup.xml")
shutil.copy(path_settings, path_settings_backup)
# open file
f = open(path_settings, "r")
# copy = open(path_settings2, "w")
logger.info(" ---")
logger.info(" --- 1")
logger.info(" --- 2")
logger.info(" --- 3")
data_aux = ""
begin_tag = "<settings>\n"
end_tag = "</settings>\n"
adult_data = ' <setting id="adult_aux_intro_password" value="" />\n'
adult_data += ' <setting id="adult_aux_new_password1" value="" />\n'
adult_data += ' <setting id="adult_aux_new_password2" value="" />\n'
adult_data += ' <setting id="adult_mode" value="0" />\n'
adult_data += ' <setting id="adult_password" value="0000" />\n'
adult_data += ' <setting id="adult_request_password" value="false" />\n'
for line in f:
matches = re.findall('<setting id="([^"]*)" value="([^"]*)', line, re.DOTALL)
logger.info("macthes %s" % matches)
if not matches:
logger.info("no matches")
# for <settings></settings> tag
# data += line
else:
logger.info("Matches")
for _id, value in matches:
logger.info(" dentro del for")
logger.info(" _id:%s value:%s" % (_id, value))
if _id not in ["adult_aux_intro_password", "adult_aux_new_password1", "adult_aux_new_password2",
"adult_mode", "adult_password", "adult_request_password", "adult_pin"]:
logger.info(" linea %s" % line)
logger.info(" value %s" % value)
if value:
# logger.info(" type value!! %s" % type(value))
logger.info(" antes value!! %s" % value)
if "(str, " in value:
if "(str, &apos;" in value:
value = value.replace("(str, &apos;", "")
value = value.replace("&apos;)", "")
elif "(str, '":
value = value.replace("(str, '", "")
value = value.replace("')", "")
elif "(bool, " in value:
value = value.replace("(bool, ", "")
if value == "True)":
value = "true"
else:
value = "false"
value = value.replace('\\\\', '\\')
logger.info(" despues value!! %s" % value)
aux_line = '<setting id="%s" value="%s" />\n' % (_id, value)
logger.info(" aux_line %s" % aux_line)
data_aux += " " + aux_line
f.close()
data = begin_tag + adult_data + data_aux + end_tag
copy_file = open(path_settings, "w")
copy_file.write(data)
copy_file.close()
while True:
import sys
logger.info("sys ve %s" % sys.version_info)
if sys.version_info > (3, 0):
value = input("Alfa\nCorregido un error en la seccion adultos, se ha reseteado la contrasena a por "
"defecto, tendra que cambiarla de nuevo si lo desea.\n Escriba 's', si lo ha entendido: ")
else:
value = raw_input("Alfa\nCorregido un error en la seccion adultos, se ha reseteado la contrasena a por "
"defecto, tendra que cambiarla de nuevo si lo desea.\n Escriba 's', si lo ha entendido: ")
logger.debug("value %s" % value)
if value.lower() == 's':
break
logger.info("En disclaimer clickó 'No'")
logger.info("En disclaimer clickó 'Si'")
except Exception, ex:
template = "An exception of type %s occured. Arguments:\n%r"
message = template % (type(ex).__name__, ex.args)
logger.info(message)
print("Alfa", "Error, en conversión")
logger.info("Datos a guardar %s" % data)
if __name__ == "__main__":
conversion()