From 2b5a21a120ac6d0dad2fe24f5b48479d4ead05a8 Mon Sep 17 00:00:00 2001 From: inpos Date: Thu, 10 Mar 2016 17:49:24 +0300 Subject: [PATCH] =?UTF-8?q?DiMartino=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=B2=D1=8B=D1=85=D0=BE=D0=B4=20=D0=B2=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D1=8B=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BF=D1=80=D0=BE=D1=81=D0=BC=D0=BE=D1=82=D1=80=D0=B0?= =?UTF-8?q?=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon.xml | 3 +++ lib/pyrrent2http/pyrrent2http.py | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/addon.xml b/addon.xml index d905cb8..f129dea 100644 --- a/addon.xml +++ b/addon.xml @@ -6,6 +6,9 @@ + + executable + all en diff --git a/lib/pyrrent2http/pyrrent2http.py b/lib/pyrrent2http/pyrrent2http.py index f131285..e4d2d1e 100644 --- a/lib/pyrrent2http/pyrrent2http.py +++ b/lib/pyrrent2http/pyrrent2http.py @@ -667,13 +667,9 @@ class Pyrrent2http(object): try: absPath = os.path.abspath(urllib.unquote(uriPath)) logging.info('Opening local torrent file: %s' % (absPath,)) - with open(absPath, 'rb') as f: - btorrent_info = f.read() - torrent_info = lt.torrent_info(lt.bdecode(btorrent_info)) + torrent_info = lt.torrent_info(absPath) except Exception as e: strerror = e.args - if btorrent_info == '': - logging.error('Torrent-file is empty: %s' % (absPath,)) logging.error('Build torrent params error is (%s)' % (strerror,)) if STANDALONE: sys.exit(1)