From 0ec3a3766052a8d13cff4ae3d78841abbc56141d Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Fri, 15 May 2020 17:01:21 +0200 Subject: [PATCH] Fix Elementum download per Android TV --- specials/elementum_download.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/specials/elementum_download.py b/specials/elementum_download.py index 1e28094b..56717628 100644 --- a/specials/elementum_download.py +++ b/specials/elementum_download.py @@ -37,9 +37,20 @@ def download(item=None): def extract(): import zipfile + from platformcode.updater import fixZipGetHash, fOpen support.log('Estraggo Elementum in:', elementum_path) - with zipfile.ZipFile(filename, 'r') as zip_ref: - zip_ref.extractall(xbmc.translatePath(addon_path)) + try: + hash = fixZipGetHash(filename) + support.log(hash) + + with zipfile.ZipFile(fOpen(filename, 'rb')) as zip_ref: + zip_ref.extractall(xbmc.translatePath(addon_path)) + + except Exception as e: + support.log('Non sono riuscito ad estrarre il file zip') + support.logger.error(e) + import traceback + support.logger.error(traceback.print_exc()) def setting():