Fix Torrent

This commit is contained in:
Alhaziel
2020-03-13 15:59:43 +01:00
parent 8c3dc2f57a
commit f94d3af077
13 changed files with 106 additions and 64 deletions
+2 -2
View File
@@ -258,7 +258,7 @@ def get_channel_setting(name, channel, default=None):
Devuelve el valor del parametro 'name' en la configuracion propia del canal 'channel'. Devuelve el valor del parametro 'name' en la configuracion propia del canal 'channel'.
Busca en la ruta \addon_data\plugin.video.alfa\settings_channels el archivo channel_data.json y lee Busca en la ruta \addon_data\plugin.video.kod\settings_channels el archivo channel_data.json y lee
el valor del parametro 'name'. Si el archivo channel_data.json no existe busca en la carpeta channels el archivo el valor del parametro 'name'. Si el archivo channel_data.json no existe busca en la carpeta channels el archivo
channel.json y crea un archivo channel_data.json antes de retornar el valor solicitado. Si el parametro 'name' channel.json y crea un archivo channel_data.json antes de retornar el valor solicitado. Si el parametro 'name'
tampoco existe en el el archivo channel.json se devuelve el parametro default. tampoco existe en el el archivo channel.json se devuelve el parametro default.
@@ -317,7 +317,7 @@ def set_channel_setting(name, value, channel):
Establece 'value' como el valor del parametro 'name' en la configuracion propia del canal 'channel'. Establece 'value' como el valor del parametro 'name' en la configuracion propia del canal 'channel'.
Devuelve el valor cambiado o None si la asignacion no se ha podido completar. Devuelve el valor cambiado o None si la asignacion no se ha podido completar.
Si se especifica el nombre del canal busca en la ruta \addon_data\plugin.video.alfa\settings_channels el Si se especifica el nombre del canal busca en la ruta \addon_data\plugin.video.kod\settings_channels el
archivo channel_data.json y establece el parametro 'name' al valor indicado por 'value'. archivo channel_data.json y establece el parametro 'name' al valor indicado por 'value'.
Si el parametro 'name' no existe lo añade, con su valor, al archivo correspondiente. Si el parametro 'name' no existe lo añade, con su valor, al archivo correspondiente.
+1 -1
View File
@@ -353,7 +353,7 @@ class Item(object):
def fromurl(self, url): def fromurl(self, url):
""" """
Genera un item a partir de una cadena de texto. La cadena puede ser creada por la funcion tourl() o tener Genera un item a partir de una cadena de texto. La cadena puede ser creada por la funcion tourl() o tener
el formato antiguo: plugin://plugin.video.alfa/?channel=... (+ otros parametros) el formato antiguo: plugin://plugin.video.kod/?channel=... (+ otros parametros)
Uso: item.fromurl("cadena") Uso: item.fromurl("cadena")
@param url: url @param url: url
+1 -1
View File
@@ -562,7 +562,7 @@ class Client(object):
Servicio encargado de anunciar el torrent Servicio encargado de anunciar el torrent
""" """
self._th.force_reannounce() self._th.force_reannounce()
self._th.force_dht_announce() self._th.force_dht_announce()
def save_state(self): def save_state(self):
""" """
+1 -1
View File
@@ -30,7 +30,7 @@ try:
#__settings__ = xbmcaddon.Addon(id='script.module.libtorrent') ### Alfa #__settings__ = xbmcaddon.Addon(id='script.module.libtorrent') ### Alfa
#__version__ = __settings__.getAddonInfo('version') ### Alfa #__version__ = __settings__.getAddonInfo('version') ### Alfa
#__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__ ### Alfa #__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__ ### Alfa
__settings__ = xbmcaddon.Addon(id='plugin.video.alfa') ### Alfa __settings__ = xbmcaddon.Addon(id='plugin.video.kod') ### Alfa
__version__ = '1.1.17' ### Alfa __version__ = '1.1.17' ### Alfa
__plugin__ = "python-libtorrent v.1.1.7" ### Alfa __plugin__ = "python-libtorrent v.1.1.7" ### Alfa
except: except:
@@ -38,7 +38,7 @@ import traceback
#__settings__ = xbmcaddon.Addon(id='script.module.libtorrent') ### Alfa #__settings__ = xbmcaddon.Addon(id='script.module.libtorrent') ### Alfa
#__version__ = __settings__.getAddonInfo('version') ### Alfa #__version__ = __settings__.getAddonInfo('version') ### Alfa
#__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__ ### Alfa #__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__ ### Alfa
#__settings__ = xbmcaddon.Addon(id='plugin.video.alfa') ### Alfa #__settings__ = xbmcaddon.Addon(id='plugin.video.kod') ### Alfa
__version__ = '1.1.17' ### Alfa __version__ = '1.1.17' ### Alfa
__plugin__ = "python-libtorrent v.1.1.7" ### Alfa __plugin__ = "python-libtorrent v.1.1.7" ### Alfa
#__language__ = __settings__.getLocalizedString ### Alfa #__language__ = __settings__.getLocalizedString ### Alfa
@@ -41,11 +41,11 @@ __libbaseurl__ = "https://github.com/DiMartinoXBMC/script.module.libtorrent/raw/
#__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__ #__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__
#__icon__=os.path.join(xbmc.translatePath('special://home'), 'addons', #__icon__=os.path.join(xbmc.translatePath('special://home'), 'addons',
# 'script.module.libtorrent', 'icon.png') # 'script.module.libtorrent', 'icon.png')
#__settings__ = xbmcaddon.Addon(id='plugin.video.alfa') ### Alfa #__settings__ = xbmcaddon.Addon(id='plugin.video.kod') ### Alfa
__version__ = '1.1.17' ### Alfa __version__ = '1.1.17' ### Alfa
__plugin__ = "python-libtorrent v.1.1.7" ### Alfa __plugin__ = "python-libtorrent v.1.1.7" ### Alfa
__icon__=os.path.join(xbmc.translatePath('special://home'), 'addons', __icon__=os.path.join(xbmc.translatePath('special://home'), 'addons',
'plugin.video.alfa', 'icon.png') ### Alfa 'plugin.video.kod', 'icon.png') ### Alfa
#__language__ = __settings__.getLocalizedString ### Alfa #__language__ = __settings__.getLocalizedString ### Alfa
#from python_libtorrent.platform_pulsar import get_platform, get_libname ### Alfa #from python_libtorrent.platform_pulsar import get_platform, get_libname ### Alfa
@@ -60,7 +60,7 @@ def log(msg):
xbmc.log("### [%s]: %s" % (__plugin__,'ERROR LOG',), level=xbmc.LOGNOTICE ) xbmc.log("### [%s]: %s" % (__plugin__,'ERROR LOG',), level=xbmc.LOGNOTICE )
def getSettingAsBool(setting): def getSettingAsBool(setting):
__settings__ = xbmcaddon.Addon(id='plugin.video.alfa') ### Alfa __settings__ = xbmcaddon.Addon(id='plugin.video.kod') ### Alfa
return __settings__.getSetting(setting).lower() == "true" return __settings__.getSetting(setting).lower() == "true"
class LibraryManager(object): class LibraryManager(object):
@@ -105,7 +105,7 @@ class LibraryManager(object):
self.download() self.download()
def download(self): def download(self):
__settings__ = xbmcaddon.Addon(id='plugin.video.alfa') ### Alfa __settings__ = xbmcaddon.Addon(id='plugin.video.kod') ### Alfa
filetools.mkdir(self.dest_path) filetools.mkdir(self.dest_path)
for libname in get_libname(self.platform): for libname in get_libname(self.platform):
dest = os.path.join(self.dest_path, libname) dest = os.path.join(self.dest_path, libname)
@@ -33,7 +33,7 @@ try:
#__settings__ = xbmcaddon.Addon(id='script.module.libtorrent') ### Alfa #__settings__ = xbmcaddon.Addon(id='script.module.libtorrent') ### Alfa
#__version__ = __settings__.getAddonInfo('version') ### Alfa #__version__ = __settings__.getAddonInfo('version') ### Alfa
#__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__ ### Alfa #__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__ ### Alfa
__settings__ = xbmcaddon.Addon(id='plugin.video.alfa') ### Alfa __settings__ = xbmcaddon.Addon(id='plugin.video.kod') ### Alfa
__version__ = '1.1.17' ### Alfa __version__ = '1.1.17' ### Alfa
__plugin__ = "python-libtorrent v.1.1.7" ### Alfa __plugin__ = "python-libtorrent v.1.1.7" ### Alfa
except: except:
@@ -67,7 +67,7 @@ def get_platform():
#__settings__ = xbmcaddon.Addon(id='script.module.libtorrent') ### Alfa #__settings__ = xbmcaddon.Addon(id='script.module.libtorrent') ### Alfa
#__version__ = __settings__.getAddonInfo('version') ### Alfa #__version__ = __settings__.getAddonInfo('version') ### Alfa
#__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__ ### Alfa #__plugin__ = __settings__.getAddonInfo('name') + " v." + __version__ ### Alfa
__settings__ = xbmcaddon.Addon(id='plugin.video.alfa') ### Alfa __settings__ = xbmcaddon.Addon(id='plugin.video.kod') ### Alfa
__version__ = '1.1.17' ### Alfa __version__ = '1.1.17' ### Alfa
__plugin__ = "python-libtorrent v.1.1.7" ### Alfa __plugin__ = "python-libtorrent v.1.1.7" ### Alfa
__language__ = __settings__.getLocalizedString __language__ = __settings__.getLocalizedString
+1 -1
View File
@@ -311,7 +311,7 @@ def set_setting(name, value, channel="", server=""):
canal 'channel'. canal 'channel'.
Devuelve el valor cambiado o None si la asignacion no se ha podido completar. Devuelve el valor cambiado o None si la asignacion no se ha podido completar.
Si se especifica el nombre del canal busca en la ruta \addon_data\plugin.video.alfa\settings_channels el Si se especifica el nombre del canal busca en la ruta \addon_data\plugin.video.kod\settings_channels el
archivo channel_data.json y establece el parametro 'name' al valor indicado por 'value'. Si el archivo archivo channel_data.json y establece el parametro 'name' al valor indicado por 'value'. Si el archivo
channel_data.json no existe busca en la carpeta channels el archivo channel.json y crea un archivo channel_data.json channel_data.json no existe busca en la carpeta channels el archivo channel.json y crea un archivo channel_data.json
antes de modificar el parametro 'name'. antes de modificar el parametro 'name'.
+3 -3
View File
@@ -29,7 +29,7 @@ def init():
""" """
Todo el código añadido al add-on se borra con cada actualización. Esta función permite restaurarlo automáticamente con cada actualización. Esto permite al usuario tener su propio código, bajo su responsabilidad, y restaurarlo al add-on cada vez que se actualiza. Todo el código añadido al add-on se borra con cada actualización. Esta función permite restaurarlo automáticamente con cada actualización. Esto permite al usuario tener su propio código, bajo su responsabilidad, y restaurarlo al add-on cada vez que se actualiza.
El mecanismo funciona copiando el contenido de la carpeta-arbol "./userdata/addon_data/plugin.video.alfa/custom_code/..." sobre El mecanismo funciona copiando el contenido de la carpeta-arbol "./userdata/addon_data/plugin.video.kod/custom_code/..." sobre
las carpetas de código del add-on. No verifica el contenido, solo vuelca(reemplaza) el contenido de "custom_code". las carpetas de código del add-on. No verifica el contenido, solo vuelca(reemplaza) el contenido de "custom_code".
El usuario almacenará en las subcarpetas de "custom_code" su código actualizado y listo para ser copiado en cualquier momento. El usuario almacenará en las subcarpetas de "custom_code" su código actualizado y listo para ser copiado en cualquier momento.
@@ -42,7 +42,7 @@ def init():
from platformcode import custom_code from platformcode import custom_code
custom_code.init() custom_code.init()
2.- En el inicio de Kodi, comprueba si existe la carpeta "custom_code" en "./userdata/addon_data/plugin.video.alfa/". 2.- En el inicio de Kodi, comprueba si existe la carpeta "custom_code" en "./userdata/addon_data/plugin.video.kod/".
Si no existe, la crea y sale sin más, dando al ususario la posibilidad de copiar sobre esa estructura su código, Si no existe, la crea y sale sin más, dando al ususario la posibilidad de copiar sobre esa estructura su código,
y que la función la vuelque sobre el add-on en el próximo inicio de Kodi. y que la función la vuelque sobre el add-on en el próximo inicio de Kodi.
@@ -63,7 +63,7 @@ def init():
try: try:
#Borra el .zip de instalación de Alfa de la carpeta Packages, por si está corrupto, y que así se pueda descargar de nuevo #Borra el .zip de instalación de Alfa de la carpeta Packages, por si está corrupto, y que así se pueda descargar de nuevo
version = 'plugin.video.alfa-%s.zip' % config.get_addon_version(with_fix=False) version = 'plugin.video.kod-%s.zip' % config.get_addon_version(with_fix=False)
filetools.remove(filetools.join(xbmc.translatePath('special://home'), 'addons', 'packages', version), True) filetools.remove(filetools.join(xbmc.translatePath('special://home'), 'addons', 'packages', version), True)
#Verifica si Kodi tiene algún achivo de Base de Datos de Vídeo de versiones anteriores, entonces los borra #Verifica si Kodi tiene algún achivo de Base de Datos de Vídeo de versiones anteriores, entonces los borra
+28 -31
View File
@@ -155,7 +155,7 @@ def play(url, xlistitem={}, is_view=None, subtitle="", password="", item=None):
e = e1 or e2 e = e1 or e2
do.ok(config.get_localized_string(30035) + 'MCT Libtorrent', config.get_localized_string(30036), config.get_localized_string(60015), str(e)) do.ok(config.get_localized_string(30035) + 'MCT Libtorrent', config.get_localized_string(30036), config.get_localized_string(60015), str(e))
return return
log("XXX libtorrent version: %s" % lt.version) log("XXX libtorrent version: %s" % lt.version)
log("##### Torrent file: %s ##" % torrent_file) log("##### Torrent file: %s ##" % torrent_file)
@@ -279,7 +279,7 @@ def play(url, xlistitem={}, is_view=None, subtitle="", password="", item=None):
extracted_rar = False extracted_rar = False
global erase_file_path global erase_file_path
erase_file_path = '' erase_file_path = ''
if _video_file_ext == ".rar": if _video_file_ext == ".rar":
rar = True rar = True
filename = video_file filename = video_file
@@ -361,7 +361,7 @@ def play(url, xlistitem={}, is_view=None, subtitle="", password="", item=None):
dp_cerrado = True dp_cerrado = True
dp = xbmcgui.DialogProgress() dp = xbmcgui.DialogProgress()
dp.create(msg_header) dp.create(msg_header)
# -- Recuperar los datos del progreso ------------------- # -- Recuperar los datos del progreso -------------------
message, porcent, msg_file, s, download = getProgress(h, video_file, _pf=_pieces_info) message, porcent, msg_file, s, download = getProgress(h, video_file, _pf=_pieces_info)
@@ -377,12 +377,12 @@ def play(url, xlistitem={}, is_view=None, subtitle="", password="", item=None):
video_file, rar, play_file, erase_path = torr.extract_files(video_file, \ video_file, rar, play_file, erase_path = torr.extract_files(video_file, \
save_path_videos, password, dp, item=item, torr_client='MCT') # ... extraemos el vídeo del RAR save_path_videos, password, dp, item=item, torr_client='MCT') # ... extraemos el vídeo del RAR
dp.close() dp.close()
erase_file_path = erase_path erase_file_path = erase_path
ren_video_file = erase_file_path ren_video_file = erase_file_path
extracted_rar = rar extracted_rar = rar
if not play_file: if not play_file:
remove_files( download, torrent_file, erase_file_path, ses, h, ren_video_file ) remove_files( download, torrent_file, erase_file_path, ses, h, ren_video_file, erase_file_path )
return return
is_view = "Ok" is_view = "Ok"
save_path_videos = play_file save_path_videos = play_file
@@ -417,14 +417,14 @@ def play(url, xlistitem={}, is_view=None, subtitle="", password="", item=None):
if not bkg_user: if not bkg_user:
is_view = "Ok" is_view = "Ok"
else: else:
remove_files( download, torrent_file, video_file, ses, h, ren_video_file ) remove_files( download, torrent_file, video_file, ses, h, ren_video_file, erase_file_path )
return return
if is_view == "Ok": if is_view == "Ok":
# -- Esperando a que termine otra reproducción -------------------------- # -- Esperando a que termine otra reproducción --------------------------
while xbmc.Player().isPlaying(): while xbmc.Player().isPlaying():
xbmc.sleep(3000) xbmc.sleep(3000)
# -- Player - Ver el vídeo -------------------------- # -- Player - Ver el vídeo --------------------------
playlist = xbmc.PlayList( xbmc.PLAYLIST_VIDEO ) playlist = xbmc.PlayList( xbmc.PLAYLIST_VIDEO )
playlist.clear() playlist.clear()
@@ -552,21 +552,21 @@ def play(url, xlistitem={}, is_view=None, subtitle="", password="", item=None):
player.pause() player.pause()
is_greater_num_pieces_pause = False is_greater_num_pieces_pause = False
is_greater_num_pieces_canceled = 0 is_greater_num_pieces_canceled = 0
# -- El usuario cancelo el visionado -------- # -- El usuario cancelo el visionado --------
# -- Terminar - # -- Terminar -
if player.ended: if player.ended:
# -- Diálogo eliminar archivos ---------- # -- Diálogo eliminar archivos ----------
remove_files( download, torrent_file, video_file, ses, h, ren_video_file ) remove_files( download, torrent_file, video_file, ses, h, ren_video_file, erase_file_path )
return return
xbmc.sleep(1000) xbmc.sleep(1000)
# -- Kodi - Se cerró el visionado ----------------------- # -- Kodi - Se cerró el visionado -----------------------
# -- Continuar | Terminar - # -- Continuar | Terminar -
if is_view == "Ok" and not xbmc.Player().isPlaying(): if is_view == "Ok" and not xbmc.Player().isPlaying():
dp.close() dp.close()
if h.status().num_pieces < tot_piece_set: if h.status().num_pieces < tot_piece_set:
# -- Diálogo continuar o terminar --------------- # -- Diálogo continuar o terminar ---------------
# Preguntamos si el usuario quiere pasar a backgroung # Preguntamos si el usuario quiere pasar a backgroung
@@ -579,12 +579,12 @@ def play(url, xlistitem={}, is_view=None, subtitle="", password="", item=None):
dp_cerrado = False dp_cerrado = False
dp = xbmcgui.DialogProgressBG() dp = xbmcgui.DialogProgressBG()
dp.create(msg_header) dp.create(msg_header)
else: else:
# -- Terminar: ---------------------------------- # -- Terminar: ----------------------------------
# -- Comprobar si el vídeo pertenece a una ------ # -- Comprobar si el vídeo pertenece a una ------
# -- lista de archivos - # -- lista de archivos -
remove_files( download, torrent_file, video_file, ses, h, ren_video_file ) remove_files( download, torrent_file, video_file, ses, h, ren_video_file, erase_file_path )
dp.close() dp.close()
return return
""" """
@@ -592,7 +592,7 @@ def play(url, xlistitem={}, is_view=None, subtitle="", password="", item=None):
if _index < 0 or len_files == 1: if _index < 0 or len_files == 1:
# -- Diálogo eliminar archivos -------------- # -- Diálogo eliminar archivos --------------
#video_file = _video_file #video_file = _video_file
remove_files( download, torrent_file, video_file, ses, h, ren_video_file ) remove_files( download, torrent_file, video_file, ses, h, ren_video_file, erase_file_path )
dp.close() dp.close()
return return
else: else:
@@ -620,10 +620,10 @@ def play(url, xlistitem={}, is_view=None, subtitle="", password="", item=None):
dp = xbmcgui.DialogProgressBG() dp = xbmcgui.DialogProgressBG()
dp.create(msg_header) dp.create(msg_header)
if ses_lt: h.set_download_limit(DOWNLOAD_LIMIT) if ses_lt: h.set_download_limit(DOWNLOAD_LIMIT)
else: else:
remove_files( download, torrent_file, video_file, ses, h, ren_video_file ) remove_files( download, torrent_file, video_file, ses, h, ren_video_file, erase_file_path )
return return
# -- Comprobar si el vídeo pertenece a una lista de - # -- Comprobar si el vídeo pertenece a una lista de -
# -- archivos - # -- archivos -
@@ -631,7 +631,7 @@ def play(url, xlistitem={}, is_view=None, subtitle="", password="", item=None):
if _index < 0 or len_files == 1: if _index < 0 or len_files == 1:
# -- Diálogo eliminar archivos ------------------ # -- Diálogo eliminar archivos ------------------
#video_file = _video_file #video_file = _video_file
remove_files( download, torrent_file, video_file, ses, h, ren_video_file ) remove_files( download, torrent_file, video_file, ses, h, ren_video_file, erase_file_path )
return return
else: else:
# -- Lista de archivos. Diálogo de opciones ----- # -- Lista de archivos. Diálogo de opciones -----
@@ -645,7 +645,7 @@ def play(url, xlistitem={}, is_view=None, subtitle="", password="", item=None):
if is_view == "Ok" and not xbmc.Player().isPlaying(): if is_view == "Ok" and not xbmc.Player().isPlaying():
dp.close() dp.close()
# -- Diálogo eliminar archivos -------------------------- # -- Diálogo eliminar archivos --------------------------
remove_files( download, torrent_file, video_file, ses, h, ren_video_file ) remove_files( download, torrent_file, video_file, ses, h, ren_video_file, erase_file_path)
return return
@@ -758,7 +758,7 @@ def get_video_files_sizes( info ):
if "/" in _file_name: _file_name = _file_name.split('/')[1] if "/" in _file_name: _file_name = _file_name.split('/')[1]
_file_ext = os.path.splitext( _title )[1] _file_ext = os.path.splitext( _title )[1]
if '.rar' in _file_ext or '.zip' in _file_ext: if '.rar' in _file_ext or '.zip' in _file_ext:
rar_parts += 1 rar_parts += 1
rar_size += _size rar_size += _size
@@ -797,7 +797,7 @@ def get_video_files_sizes( info ):
return index, vfile_name[seleccion], vfile_size[seleccion], len(opciones) return index, vfile_name[seleccion], vfile_size[seleccion], len(opciones)
# -- Preguntar si se desea borrar lo descargado ----------------- # -- Preguntar si se desea borrar lo descargado -----------------
def remove_files( download, torrent_file, video_file, ses, h, ren_video_file="" ): def remove_files( download, torrent_file, video_file, ses, h, ren_video_file="", erase_file_path='' ):
dialog_view = False dialog_view = False
torrent = False torrent = False
@@ -809,15 +809,12 @@ def remove_files( download, torrent_file, video_file, ses, h, ren_video_file=""
dialog_view = True dialog_view = True
if bkg_user and not extracted_rar: if bkg_user and not extracted_rar:
dialog_view = False dialog_view = False
if erase_file_path and erase_file_path != \ if erase_file_path and erase_file_path != os.path.join( DOWNLOAD_PATH , "MCT-torrent-videos" ):
os.path.join( DOWNLOAD_PATH , "MCT-torrent-videos" ):
ren_video_file = erase_file_path ren_video_file = erase_file_path
if filetools.isfile(ren_video_file) and filetools.split(ren_video_file)[0] != \ if filetools.isfile(ren_video_file) and filetools.split(ren_video_file)[0] != os.path.join( DOWNLOAD_PATH , "MCT-torrent-videos" ):
os.path.join( DOWNLOAD_PATH , "MCT-torrent-videos" ):
ren_video_file = filetools.split(ren_video_file)[0] ren_video_file = filetools.split(ren_video_file)[0]
elif filetools.isdir(ren_video_file) and ren_video_file == \ elif filetools.isdir(ren_video_file) and ren_video_file == os.path.join( DOWNLOAD_PATH , "MCT-torrent-videos" ):
os.path.join( DOWNLOAD_PATH , "MCT-torrent-videos" ):
ren_video_file = '' ren_video_file = ''
if dialog_view and ren_video_file: if dialog_view and ren_video_file:
@@ -844,7 +841,7 @@ def remove_files( download, torrent_file, video_file, ses, h, ren_video_file=""
try: try:
if os.path.isdir(ren_video_file): if os.path.isdir(ren_video_file):
filetools.rmdirtree(ren_video_file, silent=True) filetools.rmdirtree(ren_video_file, silent=True)
elif os.path.exists(ren_video_file) and os.path.isfile(ren_video_file): elif os.path.exists(ren_video_file) and os.path.isfile(ren_video_file):
os.remove(ren_video_file) os.remove(ren_video_file)
log("##### erase_file_path: %s" % ren_video_file) log("##### erase_file_path: %s" % ren_video_file)
except: except:
@@ -874,7 +871,7 @@ def remove_files( download, torrent_file, video_file, ses, h, ren_video_file=""
pass pass
log("### End session #########") log("### End session #########")
return return
# -- Descargar de la web los datos para crear el torrent -------- # -- Descargar de la web los datos para crear el torrent --------
+6 -17
View File
@@ -1267,10 +1267,9 @@ def play_torrent(item, xlistitem, mediaurl):
# Si es Libtorrent y no está soportado, se ofrecen alternativas, si las hay... # Si es Libtorrent y no está soportado, se ofrecen alternativas, si las hay...
if seleccion < 2 and not LIBTORRENT: if seleccion < 2 and not LIBTORRENT:
dialog_ok('Cliente Interno (LibTorrent):', 'Este cliente no está soportado en su dispositivo.', \ dialog_ok(config.get_localized_string(30033), config.get_localized_string(70774), \
'Error: [COLOR yellow]%s[/COLOR]' % config.get_setting("libtorrent_error", server="torrent", config.get_localized_string(70774) % config.get_setting("libtorrent_error", server="torrent", default=''), \
default=''), \ config.get_localized_string(70776))
'Use otro cliente Torrent soportado')
if len(torrent_options) > 2: if len(torrent_options) > 2:
seleccion = dialog_select(config.get_localized_string(70193), [opcion[0] for opcion in torrent_options]) seleccion = dialog_select(config.get_localized_string(70193), [opcion[0] for opcion in torrent_options])
if seleccion < 2: if seleccion < 2:
@@ -1280,14 +1279,8 @@ def play_torrent(item, xlistitem, mediaurl):
# Si es Torrenter o Elementum con opción de Memoria, se ofrece la posibilidad ee usar Libtorrent temporalemente # Si es Torrenter o Elementum con opción de Memoria, se ofrece la posibilidad ee usar Libtorrent temporalemente
elif seleccion > 1 and LIBTORRENT and UNRAR and 'RAR-' in item.torrent_info and ( elif seleccion > 1 and LIBTORRENT and UNRAR and 'RAR-' in item.torrent_info and (
"torrenter" in torrent_options[seleccion][0] \ "torrenter" in torrent_options[seleccion][0] \
or ("elementum" in torrent_options[seleccion][0] and xbmcaddon.Addon(id="plugin.video.%s" \ or ("elementum" in torrent_options[seleccion][0] and xbmcaddon.Addon(id="plugin.video.%s" % torrent_options[seleccion][0].replace('Plugin externo: ','')).getSetting('download_storage') == '1')):
% torrent_options[seleccion][ if dialog_yesno(torrent_options[seleccion][0], config.get_localized_string(70777), config.get_localized_string(70778), config.get_localized_string(70779) % size_rar):
0].replace('Plugin externo: ',
'')).getSetting(
'download_storage') == '1')):
if dialog_yesno(torrent_options[seleccion][0], 'Este plugin externo no soporta extraer on-line archivos RAR', \
'[COLOR yellow]¿Quiere que usemos esta vez el Cliente interno MCT?[/COLOR]', \
'Esta operación ocupará en disco [COLOR yellow][B]%s+[/B][/COLOR] veces el tamaño del vídeo' % size_rar):
seleccion = 1 seleccion = 1
else: else:
return return
@@ -1296,11 +1289,7 @@ def play_torrent(item, xlistitem, mediaurl):
torrent_options[seleccion][0] \ torrent_options[seleccion][0] \
and xbmcaddon.Addon(id="plugin.video.%s" % torrent_options[seleccion][0].replace('Plugin externo: ', '')) \ and xbmcaddon.Addon(id="plugin.video.%s" % torrent_options[seleccion][0].replace('Plugin externo: ', '')) \
.getSetting('download_storage') == '1': .getSetting('download_storage') == '1':
if dialog_yesno(torrent_options[seleccion][0], if dialog_yesno(torrent_options[seleccion][0], congig.get_localized_string(70780) % size_rar, congig.get_localized_string(70781)):
'Elementum con descarga en [COLOR yellow]Memoria[/COLOR] no soporta ' + \
'extraer on-line archivos RAR (ocupación en disco [COLOR yellow][B]%s+[/B][/COLOR] veces)' % size_rar, \
'[COLOR yellow]¿Quiere llamar a los Ajustes de Elementum para cambiar [B]temporalmente[/B] ' + \
'a [COLOR hotpink]"Usar Archivos"[/COLOR] y [B]reintentarlo[/B]?[/COLOR]'):
__settings__ = xbmcaddon.Addon( __settings__ = xbmcaddon.Addon(
id="plugin.video.%s" % torrent_options[seleccion][0].replace('Plugin externo: ', '')) id="plugin.video.%s" % torrent_options[seleccion][0].replace('Plugin externo: ', ''))
__settings__.openSettings() # Se visulizan los Ajustes de Elementum __settings__.openSettings() # Se visulizan los Ajustes de Elementum
+24
View File
@@ -5885,6 +5885,30 @@ msgctxt "#70773"
msgid "Download in the background? Cancel in Downloads menu" msgid "Download in the background? Cancel in Downloads menu"
msgstr "" msgstr ""
msgctxt "#70774"
msgid "Client not supported on this device."
msgstr ""
msgctxt "#70775"
msgid "Error: %s"
msgstr ""
msgctxt "#70776"
msgid "Use a supported client."
msgstr ""
msgctxt "#70777"
msgid "This external plugin does not support the extraction of RAR files online"
msgstr ""
msgctxt "#70778"
msgid "Do you want us to use the internal MCT client this time?"
msgstr ""
msgctxt "#70779"
msgid "This will take %s + times the size of the video"
msgstr ""
# DNS start [ settings and declaration ] # DNS start [ settings and declaration ]
msgctxt "#707401" msgctxt "#707401"
msgid "Enable DNS Check Alert" msgid "Enable DNS Check Alert"
+32
View File
@@ -5889,6 +5889,38 @@ msgctxt "#70773"
msgid "Download in the background? Cancel in Downloads menu" msgid "Download in the background? Cancel in Downloads menu"
msgstr "Scarica in background? Annulla nel menu Download" msgstr "Scarica in background? Annulla nel menu Download"
msgctxt "#70774"
msgid "Client not supported on this device."
msgstr "Client non supportato su questo dispositivo."
msgctxt "#70775"
msgid "Error: %s"
msgstr "Errore: %s"
msgctxt "#70776"
msgid "Use a supported client."
msgstr "Usa un client supportato."
msgctxt "#70777"
msgid "This external plugin does not support the extraction of RAR files online"
msgstr "Questo plugin esterno non supporta l'estrazione di file RAR online"
msgctxt "#70778"
msgid "Do you want us to use the internal MCT client this time?"
msgstr "Vuoi che questa volta utilizziamo il client MCT interno?"
msgctxt "#70779"
msgid "This will take %s + times the size of the video"
msgstr "Questa operazione occuperà %s + volte la dimensione del video"
msgctxt "#70780"
msgid "Elementum with memory download does not support to extract online RAR files (disk occupation %s + times)"
msgstr "Elementum con download di memoria non supporta l'estrazione di file RAR online (occupazione del disco %s + volte)"
msgctxt "#70781"
msgid "Do you want to call Elementum Settings to temporarily switch to Use Files?"
msgstr "Vuoi aprire i settaggi di Elementum per passare temporaneamente a usare i file?"
# DNS start [ settings and declaration ] # DNS start [ settings and declaration ]
msgctxt "#707401" msgctxt "#707401"
msgid "Enable DNS Check Alert" msgid "Enable DNS Check Alert"