From 4752e07733b7969b3a3563d68ab1e2c82b980d6d Mon Sep 17 00:00:00 2001 From: echel0n Date: Sun, 17 Aug 2014 19:14:07 -0700 Subject: [PATCH] Possible fix for failed to send torrent errors --- sickbeard/clients/generic.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sickbeard/clients/generic.py b/sickbeard/clients/generic.py index aae58623..a3465719 100644 --- a/sickbeard/clients/generic.py +++ b/sickbeard/clients/generic.py @@ -142,16 +142,14 @@ class GenericClient(object): def _get_torrent_hash(self, result): - result.hash = None if result.url.startswith('magnet'): result.hash = re.findall('urn:btih:([\w]{32,40})', result.url)[0] if len(result.hash) == 32: result.hash = b16encode(b32decode(result.hash)).lower() else: result.content = result.provider.getURL(result.url) - if result.content: - info = bdecode(result.content)["info"] - result.hash = sha1(bencode(info)).hexdigest() + info = bdecode(result.content)["info"] + result.hash = sha1(bencode(info)).hexdigest() return result