diff --git a/deluge/common.py b/deluge/common.py index 400f0ec98..276e86a2d 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -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: