KoD 0.9
- Nuova sezione Musica - Download in Background - Download dalla Videoteca e supporto file locali - Backup e cancellazione della Videoteca - Spostamento della Videoteca - Migliorata integrazione con libreria di Kodi - Gestione delle Viste Preferite - Nuovo layout impostazioni
This commit is contained in:
+6
-6
@@ -1822,11 +1822,11 @@ def redirect_clone_newpct1(item, head_nfo=None, it=None, path=False, overwrite=F
|
||||
# - patron5: expresión Regex aplicable a la url (opcional)
|
||||
# - content_inc: contenido al que aplica esta entrada, o * (item.contentType o item.extra)
|
||||
# - content_exc: contenido que se excluye de esta entrada (item.contentType) (opcional). opción para 'emerg'
|
||||
# - ow_force: indicador para la acción de "videolibrary_service.py". Puede crear la variable item.ow_force:
|
||||
# - force: indica al canal que analize toda la serie y que videolibrary_service la reescriba
|
||||
# - auto: indica a videolibrary_service que la reescriba
|
||||
# - no: no acción para videolibrary_service, solo redirige en visionado de videolibrary
|
||||
# - del: borra las estrucuturas de un determinado canal en videolibrary_service, quizás creadas por errores de un canal
|
||||
# - ow_force: indicador para la acción de "service.py". Puede crear la variable item.ow_force:
|
||||
# - force: indica al canal que analize toda la serie y que service la reescriba
|
||||
# - auto: indica a service que la reescriba
|
||||
# - no: no acción para service, solo redirige en visionado de videolibrary
|
||||
# - del: borra las estrucuturas de un determinado canal en service, quizás creadas por errores de un canal
|
||||
# - emerg: funcionalidad muy similar a la de "del". se general dinámicamente cada vez que entra un canal con el estado activado en el .json de "emergency_urls". Permite cargar las urls de emergencia en todos los elementos existentes de la Videoteca para canal afectado
|
||||
# ejemplos:
|
||||
# ('1', 'mejortorrent', 'mejortorrent1', 'http://www.mejortorrent.com/', 'https://mejortorrent1.com/', '(http.?:\/\/.*?\/)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)([^0-9]+-)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-\\d+-(Temporada-).html', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-(\\d+)-', '', 'tvshow, season', '', 'force'),
|
||||
@@ -1835,7 +1835,7 @@ def redirect_clone_newpct1(item, head_nfo=None, it=None, path=False, overwrite=F
|
||||
# ('1', 'newpct1', '', '', '', '', '', '', '', '', '*', '', 'del'),
|
||||
# ('1', 'torrentrapid', 'torrentrapid', '', '', '', '', '', '', '', '*', '1 ó 2', 'emerg'),
|
||||
#
|
||||
# La llamada recibe el parámetro Item, el .nfo y los devuleve actualizados, así como opcionalmente el parámetro "overwrite· que puede forzar la reescritura de todos los archivos de la serie, y el parámetro "path" si viene de videolibrary_service. Por último, recibe opcionalmente el parámetro "lookup" si se quiere solo averigurar si habrá migración para ese título, pero sin realizarla.
|
||||
# La llamada recibe el parámetro Item, el .nfo y los devuleve actualizados, así como opcionalmente el parámetro "overwrite· que puede forzar la reescritura de todos los archivos de la serie, y el parámetro "path" si viene de service. Por último, recibe opcionalmente el parámetro "lookup" si se quiere solo averigurar si habrá migración para ese título, pero sin realizarla.
|
||||
#
|
||||
# """
|
||||
# #logger.debug(item)
|
||||
|
||||
@@ -179,13 +179,13 @@ class Client(object):
|
||||
return self.base64urlencode(self.a32_to_str(a))
|
||||
|
||||
def aes_cbc_decrypt(self, data, key):
|
||||
try:
|
||||
from Cryptodome.Cipher import AES
|
||||
decryptor = AES.new(key, AES.MODE_CBC, '\0' * 16)
|
||||
except:
|
||||
from Crypto.Cipher import AES
|
||||
decryptor = AES.new(key, AES.MODE_CBC, '\0' * 16)
|
||||
return decryptor.decrypt(data)
|
||||
from lib import pyaes
|
||||
decryptor = pyaes.AESModeOfOperationCBC(key, '\0' * 16)
|
||||
decrypted = ''
|
||||
for p in range(0, len(data), 16):
|
||||
decrypted += decryptor.decrypt(data[p:p + 16]).replace('\0', '')
|
||||
logger.info(decrypted)
|
||||
return decrypted
|
||||
|
||||
def aes_cbc_decrypt_a32(self,data, key):
|
||||
return self.str_to_a32(self.aes_cbc_decrypt(self.a32_to_str(data), self.a32_to_str(key)))
|
||||
|
||||
@@ -32,38 +32,27 @@ from .functions import *
|
||||
import xbmc, xbmcaddon
|
||||
import sys
|
||||
import os
|
||||
import traceback ### Alfa
|
||||
import traceback
|
||||
|
||||
|
||||
#__settings__ = xbmcaddon.Addon(id='script.module.libtorrent') ### Alfa
|
||||
#__version__ = __settings__.getAddonInfo('version') ### Alfa
|
||||
#__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__ ### Alfa
|
||||
#__settings__ = xbmcaddon.Addon(id='plugin.video.kod') ### Alfa
|
||||
__version__ = '1.1.17' ### Alfa
|
||||
__plugin__ = "python-libtorrent v.1.1.7" ### Alfa
|
||||
#__language__ = __settings__.getLocalizedString ### Alfa
|
||||
__version__ = '1.1.17'
|
||||
__plugin__ = "python-libtorrent v.1.1.7"
|
||||
__root__ = os.path.dirname(os.path.dirname(__file__))
|
||||
|
||||
libtorrent=None
|
||||
platform = get_platform()
|
||||
#set_dirname=__settings__.getSetting('dirname') ### Alfa
|
||||
#set_dirname=os.path.join(__settings__.getAddonInfo('Path'),'lib', 'python_libtorrent') ### Alfa
|
||||
set_dirname=__root__ ### Alfa
|
||||
set_dirname=__root__
|
||||
if getSettingAsBool('custom_dirname') and set_dirname:
|
||||
log('set_dirname:' +str(set_dirname))
|
||||
dirname=set_dirname
|
||||
else:
|
||||
#dirname = os.path.join(xbmc.translatePath('special://temp'), 'xbmcup', 'script.module.libtorrent',
|
||||
# 'python_libtorrent')
|
||||
dirname=set_dirname ### Alfa
|
||||
dirname=set_dirname
|
||||
|
||||
log('dirname: ' +str(dirname))
|
||||
|
||||
#versions = ['0.16.19', '1.0.6', '1.0.7', '1.0.8', '1.0.9', '1.0.11', '1.1.0', '1.1.1', '1.1.6', '1.1.7', '1.2.2', '1.2.3'] ### Alfa
|
||||
versions = ['0.16.19', '1.0.6', '1.0.7', '1.0.8', '1.0.9', '1.0.11', '1.1.0', '1.1.1', '1.1.6', '1.1.7', '1.2.2'] ### Alfa
|
||||
#versions = ['0.16.19', '1.0.6', '1.0.7', '1.0.8', '1.0.9', '1.0.11', '1.1.0', '1.1.1', '1.1.6', '1.1.7', '1.2.2', '1.2.3']
|
||||
versions = ['0.16.19', '1.0.6', '1.0.7', '1.0.8', '1.0.9', '1.0.11', '1.1.0', '1.1.1', '1.1.6', '1.1.7', '1.2.2']
|
||||
default_path = versions[-1]
|
||||
#set_version = int(__settings__.getSetting('set_version')) ### Alfa
|
||||
set_version = 0 ### Alfa
|
||||
set_version = 0
|
||||
if getSettingAsBool('custom_version'):
|
||||
log('set_version:' +str(set_version)+' '+versions[set_version])
|
||||
platform['version'] = versions[set_version]
|
||||
@@ -101,12 +90,8 @@ if not lm.check_exist():
|
||||
xbmc.sleep(2000)
|
||||
|
||||
|
||||
#if __settings__.getSetting('plugin_name')!=__plugin__: ### Alfa
|
||||
# __settings__.setSetting('plugin_name', __plugin__) ### Alfa
|
||||
# lm.update() ### Alfa
|
||||
|
||||
log('platform: ' + str(platform))
|
||||
if platform['system'] not in ['windows', 'windows_x64']: ### Alfa
|
||||
if platform['system'] not in ['windows', 'windows_x64']:
|
||||
log('os: '+str(os.uname()))
|
||||
log_text = 'ucs4' if sys.maxunicode > 65536 else 'ucs2'
|
||||
log_text += ' x64' if sys.maxsize > 2147483647 else ' x86'
|
||||
@@ -118,18 +103,18 @@ try:
|
||||
description = ''
|
||||
libtorrent = ''
|
||||
from platformcode import config
|
||||
|
||||
|
||||
if platform['system'] in ['linux_x86', 'windows', 'windows_x64', 'linux_armv6', 'linux_armv7',
|
||||
'linux_x86_64', 'linux_mipsel_ucs2', 'linux_mipsel_ucs4',
|
||||
'linux_aarch64_ucs2', 'linux_aarch64_ucs4']: ### Alfa
|
||||
'linux_aarch64_ucs2', 'linux_aarch64_ucs4']:
|
||||
import libtorrent
|
||||
|
||||
|
||||
elif PY3 and platform['system'] not in ['android_armv7', 'android_x86']:
|
||||
import libtorrent ### Alfa
|
||||
|
||||
import libtorrent
|
||||
|
||||
elif platform['system'] in ['darwin', 'ios_arm']:
|
||||
import imp
|
||||
|
||||
|
||||
path_list = [dest_path]
|
||||
log('path_list = ' + str(path_list))
|
||||
fp, pathname, description = imp.find_module('libtorrent', path_list)
|
||||
@@ -140,12 +125,12 @@ try:
|
||||
libtorrent = imp.load_module('libtorrent', fp, pathname, description)
|
||||
finally:
|
||||
if fp: fp.close()
|
||||
|
||||
|
||||
elif platform['system'] in ['android_armv7', 'android_x86']:
|
||||
try:
|
||||
import imp
|
||||
from ctypes import CDLL
|
||||
|
||||
|
||||
dest_path=lm.android_workaround(os.path.join(xbmc.translatePath('special://xbmc/'), 'files').replace('/cache/apk/assets', ''))
|
||||
dll_path=os.path.join(dest_path, 'liblibtorrent.so')
|
||||
log('CDLL path = ' + dll_path)
|
||||
@@ -164,8 +149,8 @@ try:
|
||||
except Exception as e:
|
||||
if not PY3:
|
||||
e = unicode(str(e), "utf8", errors="replace").encode("utf8")
|
||||
config.set_setting("libtorrent_path", "", server="torrent") ### Alfa
|
||||
config.set_setting("libtorrent_error", str(e), server="torrent") ### Alfa
|
||||
config.set_setting("libtorrent_path", "", server="torrent")
|
||||
config.set_setting("libtorrent_error", str(e), server="torrent")
|
||||
log(traceback.format_exc(1))
|
||||
log('fp = ' + str(fp))
|
||||
log('pathname = ' + str(pathname))
|
||||
@@ -174,7 +159,7 @@ try:
|
||||
if fp: fp.close()
|
||||
|
||||
# If no permission in dest_path we need to go deeper on root!
|
||||
try: ### Alfa START
|
||||
try:
|
||||
sys_path = '/data/app/'
|
||||
fp = ''
|
||||
pathname = sys_path
|
||||
@@ -186,7 +171,7 @@ try:
|
||||
dialog = xbmcgui.Dialog()
|
||||
dialog.notification('KoD: '+ config.get_localizad_string(70766), config.get_localizad_string(70767), time=15000)
|
||||
config.set_setting("libtorrent_msg", 'OK', server="torrent")
|
||||
|
||||
|
||||
from core import scrapertools
|
||||
kodi_app = xbmc.translatePath('special://xbmc')
|
||||
kodi_app = scrapertools.find_single_match(kodi_app, '\/\w+\/\w+\/.*?\/(.*?)\/')
|
||||
@@ -201,10 +186,10 @@ try:
|
||||
output_cmd, error_cmd = p.communicate()
|
||||
log('Comando ROOT: %s' % str(command))
|
||||
dir_list = output_cmd.split()
|
||||
|
||||
|
||||
if not dir_list:
|
||||
raise
|
||||
|
||||
|
||||
for file in dir_list:
|
||||
if kodi_app in file:
|
||||
kodi_dir = file
|
||||
@@ -228,12 +213,12 @@ try:
|
||||
if fp: fp.close()
|
||||
else:
|
||||
import libtorrent
|
||||
|
||||
|
||||
except Exception as e:
|
||||
log('ERROR Comando ROOT: %s, %s' % (str(command), str(dest_path)))
|
||||
if not PY3:
|
||||
e = unicode(str(e), "utf8", errors="replace").encode("utf8")
|
||||
log(traceback.format_exc(1)) ### Alfa
|
||||
log(traceback.format_exc(1))
|
||||
log('fp = ' + str(fp))
|
||||
log('pathname = ' + str(pathname))
|
||||
log('description = ' + str(description))
|
||||
@@ -241,15 +226,15 @@ try:
|
||||
if fp: fp.close()
|
||||
|
||||
if libtorrent:
|
||||
config.set_setting("libtorrent_path", dest_path, server="torrent") ### Alfa
|
||||
config.set_setting("libtorrent_error", "", server="torrent") ### Alfa
|
||||
config.set_setting("libtorrent_path", dest_path, server="torrent")
|
||||
config.set_setting("libtorrent_error", "", server="torrent")
|
||||
log('Imported libtorrent v' + libtorrent.version + ' from "' + dest_path + '"')
|
||||
|
||||
except Exception as e:
|
||||
if not PY3:
|
||||
e = unicode(str(e), "utf8", errors="replace").encode("utf8")
|
||||
config.set_setting("libtorrent_path", "", server="torrent") ### Alfa
|
||||
config.set_setting("libtorrent_error", str(e), server="torrent") ### Alfa
|
||||
config.set_setting("libtorrent_path", "", server="torrent")
|
||||
config.set_setting("libtorrent_error", str(e), server="torrent")
|
||||
log('Error importing libtorrent from "' + dest_path + '". Exception: ' + str(e))
|
||||
if fp: fp.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user