Test 3: Elementum download richiamato da server

This commit is contained in:
Alhaziel01
2020-04-20 19:51:22 +02:00
parent 0903d79edc
commit e291ebbde8
4 changed files with 12 additions and 16 deletions

View File

@@ -1358,12 +1358,6 @@ def play_torrent(item, xlistitem, mediaurl):
torrent_client = config.get_setting("torrent_client", server="torrent")
# Si es Libtorrent y no está soportado, se ofrecen alternativas, si las hay...
if len(torrent_options) == 0:
from specials import elementum_download
if elementum_download.download():
torrent_options = torrent_client_installed(show_tuple=True)
else:
return
if len(torrent_options) > 1:
selection = dialog_select(config.get_localized_string(70193), [opcion[0] for opcion in torrent_options])

View File

@@ -5897,7 +5897,7 @@ msgstr "Vuoi aprire i settaggi di Elementum per passare temporaneamente a usare
msgctxt "#70782"
msgid "You must install an external Client to take advantage of the torrent support. Do you want to install Elementum?"
msgstr "Per poter usufruire del support torrent devi installare un Client esterno. Vuoi installare Elementum?"
msgstr "Per poter usufruire del supporto torrent devi installare un Client esterno. Vuoi installare Elementum?"
msgctxt "#70783"
msgid "Elementum is installed on your device, but is not active. Do you want to activate it?"

View File

@@ -61,6 +61,10 @@ trackers = [
# Returns an array of possible video url's from the page_url
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
torrent_options = platformtools.torrent_client_installed(show_tuple=True)
if len(torrent_options) == 0:
from specials import elementum_download
elementum_download.download()
logger.info("server=torrent, the url is the good")
if page_url.startswith("magnet:"):

View File

@@ -19,7 +19,7 @@ def download(item=None):
if filetools.exists(elementum_path):
if platformtools.dialog_yesno(config.get_localized_string(70784), config.get_localized_string(70783)):
setting()
return True
platformtools.dialog_ok('Elementum', config.get_localized_string(70783))
else:
if platformtools.dialog_yesno(config.get_localized_string(70784), config.get_localized_string(70782)):
@@ -33,9 +33,6 @@ def download(item=None):
extract()
xbmc.sleep(1000)
setting()
return True
return False
def extract():
@@ -48,11 +45,11 @@ def extract():
def setting():
# support.dbg()
xbmc.executebuiltin('UpdateLocalAddons')
xbmc.sleep(1000)
if filetools.isfile(elementum_setting_file):
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id":1, "method": "Addons.SetAddonEnabled", "params": { "addonid": "plugin.video.elementum", "enabled": true }}')
Continue = True
while Continue: #xbmc.sleep(1000)
while Continue:
try:
__settings__ = xbmcaddon.Addon(id="plugin.video.elementum")
__settings__.setSetting('skip_burst_search', 'true')
@@ -60,19 +57,20 @@ def setting():
__settings__.setSetting('do_not_disturb', 'true')
Continue = False
except:
Continue = True
support.log('RIPROVO')
xbmc.sleep(100)
else:
if not filetools.exists(elementum_path):
filetools.mkdir(elementum_path)
filetools.copy(kod_setting_file, elementum_setting_file)
xbmc.sleep(1000)
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id":1, "method": "Addons.SetAddonEnabled", "params": { "addonid": "plugin.video.elementum", "enabled": true }}')
updater.refreshLang()
if filetools.exists(filename):
filetools.remove(filename)
if platformtools.dialog_ok('Elementum', config.get_localized_string(70783)):
return
def get_platform():