Don't check imdb if no .nfo found

This commit is contained in:
Ruud
2012-01-01 13:05:15 +01:00
parent c604ffe3c8
commit 213f1cd1d7
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -89,7 +89,7 @@ class Plugin(object):
return False return False
# http request # 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) socket.setdefaulttimeout(timeout)
@@ -113,7 +113,8 @@ class Plugin(object):
data = urllib2.urlopen(request).read() data = urllib2.urlopen(request).read()
except IOError: 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 raise
self.http_last_use[host] = time.time() self.http_last_use[host] = time.time()
+2 -2
View File
@@ -263,9 +263,9 @@ class Searcher(Plugin):
nfo = self.getCache(cache_key) nfo = self.getCache(cache_key)
if not nfo: if not nfo:
try: 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) self.setCache(cache_key, nfo)
except: except:
pass pass
return getImdb(nfo) == imdb_id return nfo and getImdb(nfo) == imdb_id