Don't check imdb if no .nfo found
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user