mirror of
https://github.com/evilhero/mylar
synced 2024-12-27 01:57:01 +00:00
FIX: bencode problem for deluge users when snatching torrent
This commit is contained in:
parent
1f7f8e9add
commit
8891088b4d
1 changed files with 3 additions and 3 deletions
|
@ -158,13 +158,13 @@ class TorrentClient(object):
|
|||
|
||||
def get_the_hash(self, filepath):
|
||||
import hashlib, StringIO
|
||||
from mylar import bencode
|
||||
import bencode
|
||||
|
||||
# Open torrent file
|
||||
torrent_file = open(filepath, "rb")
|
||||
metainfo = bencode.bdecode(torrent_file.read())
|
||||
metainfo = bencode.decode(torrent_file.read())
|
||||
info = metainfo['info']
|
||||
thehash = hashlib.sha1(bencode.bencode(info)).hexdigest().upper()
|
||||
thehash = hashlib.sha1(bencode.encode(info)).hexdigest().upper()
|
||||
logger.debug('Hash: ' + thehash)
|
||||
return thehash
|
||||
|
||||
|
|
Loading…
Reference in a new issue