Get IMDB id from NFO via srrdb.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from couchpotato import get_session
|
||||
from couchpotato.core.event import addEvent, fireEvent
|
||||
from couchpotato.core.helpers.encoding import simplifyString
|
||||
from couchpotato.core.helpers.variable import md5
|
||||
from couchpotato.core.helpers.variable import md5, getImdb
|
||||
from couchpotato.core.logger import CPLog
|
||||
from couchpotato.core.plugins.base import Plugin
|
||||
from couchpotato.core.settings.model import Movie, Release, ReleaseInfo
|
||||
@@ -197,6 +197,10 @@ class Searcher(Plugin):
|
||||
if len(movie_words) <= 2 and self.correctYear([nzb['name']], movie['library']['year'], 0):
|
||||
return True
|
||||
|
||||
# Get the nfo and see if it contains the proper imdb url
|
||||
if self.checkNFO(nzb['name'], movie['library']['identifier']):
|
||||
return True
|
||||
|
||||
log.info("Wrong: %s, undetermined naming. Looking for '%s (%s)'" % (nzb['name'], movie['library']['titles'][0]['title'], movie['library']['year']))
|
||||
return False
|
||||
|
||||
@@ -250,3 +254,7 @@ class Searcher(Plugin):
|
||||
movie_words = re.split('\W+', simplifyString(movie_name))
|
||||
|
||||
return len(list(set(check_words) - set(movie_words))) == 0
|
||||
|
||||
def checkNFO(self, check_name, imdb_id):
|
||||
nfo = self.urlopen('http://www.srrdb.com/showfile.php?release=%s' % check_name)
|
||||
return getImdb(nfo) == imdb_id
|
||||
|
||||
Reference in New Issue
Block a user