mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
[#2790] Ensure base32 magnet hash is uppercase
This commit is contained in:
parent
5c69b56cd5
commit
cd6669c024
1 changed files with 5 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue