исправления и версия python 3.7

This commit is contained in:
roman committed 2022-03-14 22:57:02 +03:00
1 parent bf08457a2a
commit 8198b8f558
14 files changed
+23 -19

No files matched your search

@@ -1 +0,0 @@
10487144
@@ -1 +0,0 @@
9063628
@@ -1 +1 @@
7175372 7171244
@@ -1 +1 @@
11220000 11170816
Binary file not shown.
@@ -1 +1 @@
11148992 11059240
@@ -47,7 +47,7 @@ else:
log('dirname:' + str(dirname)) log('dirname:' + str(dirname))
versions = ['1.2.15'] versions = ['1.1.14']
default_path = versions[-1] default_path = versions[-1]
set_version = int(__settings__.getSetting('set_version')) set_version = int(__settings__.getSetting('set_version'))
if getSettingAsBool('custom_version'): if getSettingAsBool('custom_version'):
@@ -35,7 +35,7 @@ __libbaseurl__ = "https://git.ukamnya.ru/ukamnya/script.module.libtorrent/raw/br
__settings__ = xbmcaddon.Addon(id='script.module.libtorrent') __settings__ = xbmcaddon.Addon(id='script.module.libtorrent')
__version__ = __settings__.getAddonInfo('version') __version__ = __settings__.getAddonInfo('version')
__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(xbmcvfs.translatePath('special://home'), 'addons',
'script.module.libtorrent', 'icon.png') 'script.module.libtorrent', 'icon.png')
__language__ = __settings__.getLocalizedString __language__ = __settings__.getLocalizedString
@@ -98,7 +98,7 @@ class LibraryManager():
self.http = HTTP() self.http = HTTP()
self.http.fetch(url, download=dest + ".zip", progress=True) self.http.fetch(url, download=dest + ".zip", progress=True)
log("%s -> %s" % (url, dest)) log("%s -> %s" % (url, dest))
xbmc.executebuiltin('XBMC.Extract("%s.zip","%s")' % (dest, self.dest_path), True) xbmc.executebuiltin('Extract("%s.zip","%s")' % (dest, self.dest_path), True)
xbmcvfs.delete(dest + ".zip") xbmcvfs.delete(dest + ".zip")
except: except:
text = 'Failed download %s!' % libname text = 'Failed download %s!' % libname
+15 -9
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
''' """
python-libtorrent for Kodi (script.module.libtorrent) python-libtorrent for Kodi (script.module.libtorrent)
Copyright (C) 2015-2016 DiMartino, srg70, RussakHH, aisman Copyright (C) 2015-2016 DiMartino, srg70, RussakHH, aisman
@@ -21,7 +21,7 @@
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
''' """
import base64 import base64
import http.cookiejar import http.cookiejar
@@ -75,6 +75,8 @@ class HTTP:
self._opener() self._opener()
self._fetch() self._fetch()
except Exception as e: except Exception as e:
import traceback
xbmc.log(f'XBMCup trace: {traceback.format_exc()}')
xbmc.log('XBMCup: HTTP: ' + str(e), xbmc.LOGERROR) xbmc.log('XBMCup: HTTP: ' + str(e), xbmc.LOGERROR)
if isinstance(e, urllib.error.HTTPError): if isinstance(e, urllib.error.HTTPError):
self.response.code = e.code self.response.code = e.code
@@ -82,15 +84,15 @@ class HTTP:
else: else:
self.response.code = 200 self.response.code = 200
if self.fd: if self.fd is not None:
self.fd.close() self.fd.close()
self.fd = None self.fd = None
if self.con: if self.con is not None:
self.con.close() self.con.close()
self.con = None self.con = None
if self.progress: if self.progress is not None:
self.progress.close() self.progress.close()
self.progress = None self.progress = None
@@ -186,13 +188,15 @@ class HTTP:
while 1: while 1:
buf = self.con.read(bs) buf = self.con.read(bs)
if buf == '': if buf == b'':
break break
read += len(buf) read += len(buf)
fd.write(buf) fd.write(buf)
if self.request.progress: if self.request.progress:
self.progress.update(*self._progress(read, size, name)) # self.progress.update(*self._progress(read, size, name))
pr = self._progress(read, size, name)
self.progress.update(pr[0], ' '.join(pr[1:]))
self.response.filename = self.request.download self.response.filename = self.request.download
@@ -235,8 +239,10 @@ class HTTP:
def _headers(self, raw): def _headers(self, raw):
headers = {} headers = {}
for line in raw.headers: #for line in raw.headers:
pair = line.split(':', 1) for line in raw.raw_items():
#pair = line.split(':', 1)
pair = line
if len(pair) == 2: if len(pair) == 2:
tag = pair[0].lower().strip() tag = pair[0].lower().strip()
value = pair[1].strip() value = pair[1].strip()
+2 -2
View File
@@ -97,8 +97,8 @@ msgid "Windows 64-bit"
msgstr "Windows 64-bit" msgstr "Windows 64-bit"
msgctxt "#401150" msgctxt "#401150"
msgid "1.2.15" msgid "1.1.14"
msgstr "1.2.15" msgstr "1.1.14"
msgctxt "#401010" msgctxt "#401010"
msgid "401010" msgid "401010"