Fix #2227 : Torrent file contains sha1 and ed2k digest that needs encoding to hex
This commit is contained in:
parent
2a8b8e93da
commit
8658be3b05
@ -106,8 +106,11 @@ class TorrentInfo(object):
|
|||||||
else:
|
else:
|
||||||
path = decode_string(os.path.join(prefix, decode_string(os.path.join(*f["path"]), self.encoding)), self.encoding)
|
path = decode_string(os.path.join(prefix, decode_string(os.path.join(*f["path"]), self.encoding)), self.encoding)
|
||||||
f["index"] = index
|
f["index"] = index
|
||||||
|
if "sha1" in f and len(f["sha1"]) == 20:
|
||||||
|
f["sha1"] = f["sha1"].encode('hex')
|
||||||
|
if "ed2k" in f and len(f["ed2k"]) == 16:
|
||||||
|
f["ed2k"] = f["ed2k"].encode('hex')
|
||||||
paths[path] = f
|
paths[path] = f
|
||||||
|
|
||||||
dirname = os.path.dirname(path)
|
dirname = os.path.dirname(path)
|
||||||
while dirname:
|
while dirname:
|
||||||
dirinfo = dirs.setdefault(dirname, {})
|
dirinfo = dirs.setdefault(dirname, {})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user