From 28387ebc684a0f8b8f7a3924a066857ab598e057 Mon Sep 17 00:00:00 2001 From: sharkykh Date: Fri, 2 Oct 2020 10:09:22 +0300 Subject: [PATCH 1/2] fix torrent hash from magnet to be unicode --- medusa/clients/torrent/generic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/medusa/clients/torrent/generic.py b/medusa/clients/torrent/generic.py index b024af232d..f1a60fe94f 100644 --- a/medusa/clients/torrent/generic.py +++ b/medusa/clients/torrent/generic.py @@ -198,7 +198,8 @@ def _get_info_hash(result): if result.url.startswith('magnet:'): result.hash = re.findall(r'urn:btih:([\w]{32,40})', result.url)[0] if len(result.hash) == 32: - result.hash = b16encode(b32decode(result.hash)).lower() + hash_b16 = b16encode(b32decode(result.hash)).lower() + result.hash = hash_b16.decode('utf-8') else: try: From b8e2dbb034b7bfafffbb811b55383c1020385161 Mon Sep 17 00:00:00 2001 From: sharkykh Date: Fri, 2 Oct 2020 10:12:18 +0300 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f11e25156..f4e4bc1044 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Fix notify lists for prowl and email ([8535](https://github.com/pymedusa/Medusa/pull/8535)) - Fix shows sorting by article sort using (the, a, an) was reversed in config-general ([8532](https://github.com/pymedusa/Medusa/pull/8532)) - Fix sending torrents to qBittorrent api version > 2.0.0 ([8528](https://github.com/pymedusa/Medusa/pull/8528)) +- Fix decoding torrent hash from magnet links ([8563](https://github.com/pymedusa/Medusa/pull/8563)) -----