From 9761c6c6a37228ad2c7935f3f0032d72c93fa636 Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 30 Jul 2014 21:31:54 -0700 Subject: [PATCH] Fixed issues with torrent blackhole download issues. --- sickbeard/providers/generic.py | 11 ++++++----- sickbeard/tvcache.py | 22 ++++++++++++---------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/sickbeard/providers/generic.py b/sickbeard/providers/generic.py index 8d53c965..899b93f8 100644 --- a/sickbeard/providers/generic.py +++ b/sickbeard/providers/generic.py @@ -408,11 +408,12 @@ class GenericProvider: # validate torrent file if not magnet link to avoid invalid torrent links if self.providerType == self.TORRENT: - client = clients.getClientIstance(sickbeard.TORRENT_METHOD)() - result = client._get_torrent_hash(result) - if not result.hash: - logger.log(u'Unable to get torrent hash for ' + title + ', skipping it', logger.DEBUG) - continue + if sickbeard.TORRENT_METHOD != "blackhole": + client = clients.getClientIstance(sickbeard.TORRENT_METHOD)() + result = client._get_torrent_hash(result) + if not result.hash: + logger.log(u'Unable to get torrent hash for ' + title + ', skipping it', logger.DEBUG) + continue if epNum not in results: results[epNum] = [result] diff --git a/sickbeard/tvcache.py b/sickbeard/tvcache.py index 18067799..234e24c8 100644 --- a/sickbeard/tvcache.py +++ b/sickbeard/tvcache.py @@ -24,14 +24,15 @@ import sickbeard from sickbeard import db from sickbeard import logger -from sickbeard.common import Quality - +from sickbeard import clients from sickbeard import helpers, show_name_helpers +from sickbeard.providers.generic import GenericProvider +from sickbeard.common import Quality from sickbeard.exceptions import MultipleShowObjectsException from sickbeard.exceptions import AuthException -from name_parser.parser import NameParser, InvalidNameException, InvalidShowException from sickbeard.rssfeeds import RSSFeeds -from sickbeard import clients + +from name_parser.parser import NameParser, InvalidNameException, InvalidShowException class CacheDBConnection(db.DBConnection): def __init__(self, providerName): @@ -360,12 +361,13 @@ class TVCache(): result.content = None # validate torrent file if not magnet link to avoid invalid torrent links - if self.provider.providerType == sickbeard.providers.generic.GenericProvider.TORRENT: - client = clients.getClientIstance(sickbeard.TORRENT_METHOD)() - result = client._get_torrent_hash(result) - if not result.hash: - logger.log(u'Unable to get torrent hash for ' + title + ', skipping it', logger.DEBUG) - continue + if self.provider.providerType == GenericProvider.TORRENT: + if sickbeard.TORRENT_METHOD != "blackhole": + client = clients.getClientIstance(sickbeard.TORRENT_METHOD)() + result = client._get_torrent_hash(result) + if not result.hash: + logger.log(u'Unable to get torrent hash for ' + title + ', skipping it', logger.DEBUG) + continue # add it to the list if epObj not in neededEps: