diff --git a/python_libtorrent/linux_aarch64_ucs4/1.1.14/libtorrent.so.size.txt b/python_libtorrent/linux_aarch64_ucs4/1.1.14/libtorrent.so.size.txt deleted file mode 100644 index 5ce4b55..0000000 --- a/python_libtorrent/linux_aarch64_ucs4/1.1.14/libtorrent.so.size.txt +++ /dev/null @@ -1 +0,0 @@ -10487144 diff --git a/python_libtorrent/linux_aarch64_ucs4/1.1.14/libtorrent.so.zip b/python_libtorrent/linux_aarch64_ucs4/1.1.14/libtorrent.so.zip deleted file mode 100644 index 66323f4..0000000 Binary files a/python_libtorrent/linux_aarch64_ucs4/1.1.14/libtorrent.so.zip and /dev/null differ diff --git a/python_libtorrent/linux_armv6/1.1.14/libtorrent.so.size.txt b/python_libtorrent/linux_armv6/1.1.14/libtorrent.so.size.txt deleted file mode 100644 index b3a8745..0000000 --- a/python_libtorrent/linux_armv6/1.1.14/libtorrent.so.size.txt +++ /dev/null @@ -1 +0,0 @@ -9063628 diff --git a/python_libtorrent/linux_armv6/1.1.14/libtorrent.so.zip b/python_libtorrent/linux_armv6/1.1.14/libtorrent.so.zip deleted file mode 100644 index ad2c7da..0000000 Binary files a/python_libtorrent/linux_armv6/1.1.14/libtorrent.so.zip and /dev/null differ diff --git a/python_libtorrent/linux_armv7/1.1.14/libtorrent.so.size.txt b/python_libtorrent/linux_armv7/1.1.14/libtorrent.so.size.txt index acf6a90..e46dc4f 100644 --- a/python_libtorrent/linux_armv7/1.1.14/libtorrent.so.size.txt +++ b/python_libtorrent/linux_armv7/1.1.14/libtorrent.so.size.txt @@ -1 +1 @@ -7175372 +7171244 diff --git a/python_libtorrent/linux_armv7/1.1.14/libtorrent.so.zip b/python_libtorrent/linux_armv7/1.1.14/libtorrent.so.zip index 261e41d..097983a 100644 Binary files a/python_libtorrent/linux_armv7/1.1.14/libtorrent.so.zip and b/python_libtorrent/linux_armv7/1.1.14/libtorrent.so.zip differ diff --git a/python_libtorrent/linux_x86/1.1.14/libtorrent.so.size.txt b/python_libtorrent/linux_x86/1.1.14/libtorrent.so.size.txt index 955cc25..6cebf8d 100644 --- a/python_libtorrent/linux_x86/1.1.14/libtorrent.so.size.txt +++ b/python_libtorrent/linux_x86/1.1.14/libtorrent.so.size.txt @@ -1 +1 @@ -11220000 +11170816 diff --git a/python_libtorrent/linux_x86/1.1.14/libtorrent.so.zip b/python_libtorrent/linux_x86/1.1.14/libtorrent.so.zip index 357a8d5..cfa5f99 100644 Binary files a/python_libtorrent/linux_x86/1.1.14/libtorrent.so.zip and b/python_libtorrent/linux_x86/1.1.14/libtorrent.so.zip differ diff --git a/python_libtorrent/linux_x86_64/1.1.14/libtorrent.so.size.txt b/python_libtorrent/linux_x86_64/1.1.14/libtorrent.so.size.txt index 0fcfd58..bd1dbcf 100644 --- a/python_libtorrent/linux_x86_64/1.1.14/libtorrent.so.size.txt +++ b/python_libtorrent/linux_x86_64/1.1.14/libtorrent.so.size.txt @@ -1 +1 @@ -11148992 +11059240 diff --git a/python_libtorrent/linux_x86_64/1.1.14/libtorrent.so.zip b/python_libtorrent/linux_x86_64/1.1.14/libtorrent.so.zip index e6ef903..ee05a1c 100644 Binary files a/python_libtorrent/linux_x86_64/1.1.14/libtorrent.so.zip and b/python_libtorrent/linux_x86_64/1.1.14/libtorrent.so.zip differ diff --git a/python_libtorrent/python_libtorrent/__init__.py b/python_libtorrent/python_libtorrent/__init__.py index a8993a1..6a26ee6 100644 --- a/python_libtorrent/python_libtorrent/__init__.py +++ b/python_libtorrent/python_libtorrent/__init__.py @@ -47,7 +47,7 @@ else: log('dirname:' + str(dirname)) -versions = ['1.2.15'] +versions = ['1.1.14'] default_path = versions[-1] set_version = int(__settings__.getSetting('set_version')) if getSettingAsBool('custom_version'): diff --git a/python_libtorrent/python_libtorrent/functions.py b/python_libtorrent/python_libtorrent/functions.py index 7aee6d0..3a44977 100644 --- a/python_libtorrent/python_libtorrent/functions.py +++ b/python_libtorrent/python_libtorrent/functions.py @@ -35,7 +35,7 @@ __libbaseurl__ = "https://git.ukamnya.ru/ukamnya/script.module.libtorrent/raw/br __settings__ = xbmcaddon.Addon(id='script.module.libtorrent') __version__ = __settings__.getAddonInfo('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') __language__ = __settings__.getLocalizedString @@ -98,7 +98,7 @@ class LibraryManager(): self.http = HTTP() self.http.fetch(url, download=dest + ".zip", progress=True) 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") except: text = 'Failed download %s!' % libname diff --git a/python_libtorrent/python_libtorrent/net.py b/python_libtorrent/python_libtorrent/net.py index b662d3a..d464c23 100644 --- a/python_libtorrent/python_libtorrent/net.py +++ b/python_libtorrent/python_libtorrent/net.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -''' +""" python-libtorrent for Kodi (script.module.libtorrent) Copyright (C) 2015-2016 DiMartino, srg70, RussakHH, aisman @@ -21,7 +21,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -''' +""" import base64 import http.cookiejar @@ -75,6 +75,8 @@ class HTTP: self._opener() self._fetch() except Exception as e: + import traceback + xbmc.log(f'XBMCup trace: {traceback.format_exc()}') xbmc.log('XBMCup: HTTP: ' + str(e), xbmc.LOGERROR) if isinstance(e, urllib.error.HTTPError): self.response.code = e.code @@ -82,15 +84,15 @@ class HTTP: else: self.response.code = 200 - if self.fd: + if self.fd is not None: self.fd.close() self.fd = None - if self.con: + if self.con is not None: self.con.close() self.con = None - if self.progress: + if self.progress is not None: self.progress.close() self.progress = None @@ -186,13 +188,15 @@ class HTTP: while 1: buf = self.con.read(bs) - if buf == '': + if buf == b'': break read += len(buf) fd.write(buf) 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 @@ -235,8 +239,10 @@ class HTTP: def _headers(self, raw): headers = {} - for line in raw.headers: - pair = line.split(':', 1) + #for line in raw.headers: + for line in raw.raw_items(): + #pair = line.split(':', 1) + pair = line if len(pair) == 2: tag = pair[0].lower().strip() value = pair[1].strip() diff --git a/resources/language/English/strings.po b/resources/language/English/strings.po index 380c731..0b389a2 100644 --- a/resources/language/English/strings.po +++ b/resources/language/English/strings.po @@ -97,8 +97,8 @@ msgid "Windows 64-bit" msgstr "Windows 64-bit" msgctxt "#401150" -msgid "1.2.15" -msgstr "1.2.15" +msgid "1.1.14" +msgstr "1.1.14" msgctxt "#401010" msgid "401010"