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)