From 6e6ae5bb8737ada062abf726311862be9dd0bccf Mon Sep 17 00:00:00 2001 From: echel0n Date: Sun, 27 Jul 2014 23:48:10 -0700 Subject: [PATCH] Further corrections for torrent download issues related to content being empty and not properly checked in advance. --- sickbeard/clients/generic.py | 3 ++- sickbeard/config.py | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sickbeard/clients/generic.py b/sickbeard/clients/generic.py index 7a1ef698..91c0539d 100644 --- a/sickbeard/clients/generic.py +++ b/sickbeard/clients/generic.py @@ -142,11 +142,12 @@ class GenericClient(object): def _get_torrent_hash(self, result): + torrent_hash = None if result.url.startswith('magnet'): torrent_hash = re.findall('urn:btih:([\w]{32,40})', result.url)[0] if len(torrent_hash) == 32: torrent_hash = b16encode(b32decode(torrent_hash)).lower() - else: + elif result.content: info = bdecode(result.content)["info"] torrent_hash = sha1(bencode(info)).hexdigest() diff --git a/sickbeard/config.py b/sickbeard/config.py index b792b0df..e3bc14c6 100644 --- a/sickbeard/config.py +++ b/sickbeard/config.py @@ -191,11 +191,6 @@ def change_VERSION_NOTIFY(version_notify): if oldSetting == False and version_notify == True: sickbeard.versionCheckScheduler.action.run() # @UndefinedVariable -def change_VERSION(version): - if sickbeard.version.SICKBEARD_VERSION != version: - - sickbeard.versionCheckScheduler.action.run() # @UndefinedVariable - def CheckSection(CFG, sec): """ Check if INI section exists, if not create it """ try: