mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 12:34:43 +00:00
[#2790] Ensure base32 magnet hash is uppercase
This commit is contained in:
parent
5c69b56cd5
commit
cd6669c024
@ -612,7 +612,11 @@ def get_magnet_info(uri):
|
||||
if param.startswith(xt_param):
|
||||
xt_hash = param[len(xt_param):]
|
||||
if len(xt_hash) == 32:
|
||||
info_hash = base64.b32decode(xt_hash).encode("hex")
|
||||
try:
|
||||
info_hash = base64.b32decode(xt_hash.upper()).encode("hex")
|
||||
except TypeError as ex:
|
||||
log.debug("Invalid base32 magnet hash: %s, %s", xt_hash, ex)
|
||||
break
|
||||
elif len(xt_hash) == 40:
|
||||
info_hash = xt_hash
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user