From 7e8efc570ed23a054ae471ec910709617cb7d016 Mon Sep 17 00:00:00 2001 From: inpos Date: Sun, 6 Mar 2016 16:28:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D1=81=D1=82=20=D1=83=D0=B1=D1=80?= =?UTF-8?q?=D0=B0=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pyrrent2http/pyrrent2http.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/pyrrent2http/pyrrent2http.py b/lib/pyrrent2http/pyrrent2http.py index ee78bde..e384a83 100644 --- a/lib/pyrrent2http/pyrrent2http.py +++ b/lib/pyrrent2http/pyrrent2http.py @@ -677,12 +677,11 @@ class Pyrrent2http(object): logging.info('Opening local torrent file: %s' % (absPath,)) with open(absPath, 'rb') as f: btorrent_info = f.read() - logging.info(repr(btorrent_info)) - dtorrent_info = lt.bdecode(btorrent_info) - logging.info(repr(dtorrent_info)) - torrent_info = lt.torrent_info(dtorrent_info) + torrent_info = lt.torrent_info(lt.bdecode(btorrent_info)) 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)