From 213f1cd1d7c493d36ee93039ac15eb4af9f9cedf Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 1 Jan 2012 13:05:15 +0100 Subject: [PATCH] Don't check imdb if no .nfo found --- couchpotato/core/plugins/base.py | 5 +++-- couchpotato/core/plugins/searcher/main.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/couchpotato/core/plugins/base.py b/couchpotato/core/plugins/base.py index 810936e2..6eff56be 100644 --- a/couchpotato/core/plugins/base.py +++ b/couchpotato/core/plugins/base.py @@ -89,7 +89,7 @@ class Plugin(object): return False # http request - def urlopen(self, url, timeout = 10, params = {}, headers = {}, multipart = False): + def urlopen(self, url, timeout = 10, params = {}, headers = {}, multipart = False, show_error = True): socket.setdefaulttimeout(timeout) @@ -113,7 +113,8 @@ class Plugin(object): data = urllib2.urlopen(request).read() except IOError: - log.error('Failed opening url: %s %s' % (url, traceback.format_exc(1))) + if show_error: + log.error('Failed opening url in %s: %s %s' % (self.getName(), url, traceback.format_exc(1))) raise self.http_last_use[host] = time.time() diff --git a/couchpotato/core/plugins/searcher/main.py b/couchpotato/core/plugins/searcher/main.py index 66df34f2..a6383699 100644 --- a/couchpotato/core/plugins/searcher/main.py +++ b/couchpotato/core/plugins/searcher/main.py @@ -263,9 +263,9 @@ class Searcher(Plugin): nfo = self.getCache(cache_key) if not nfo: try: - nfo = self.urlopen('http://www.srrdb.com/showfile.php?release=%s' % check_name) + nfo = self.urlopen('http://www.srrdb.com/showfile.php?release=%s' % check_name, show_error = False) self.setCache(cache_key, nfo) except: pass - return getImdb(nfo) == imdb_id + return nfo and getImdb(nfo) == imdb_id