Get IMDB id from NFO via srrdb.

This commit is contained in:
Ruud committed 2011-10-18 00:11:43 +02:00
1 parent 5f23a16fae
commit 54a99c7fa9
1 file changed
+9 -1
+9 -1
View File
@@ -1,7 +1,7 @@
from couchpotato import get_session from couchpotato import get_session
from couchpotato.core.event import addEvent, fireEvent from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.encoding import simplifyString 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.logger import CPLog
from couchpotato.core.plugins.base import Plugin from couchpotato.core.plugins.base import Plugin
from couchpotato.core.settings.model import Movie, Release, ReleaseInfo 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): if len(movie_words) <= 2 and self.correctYear([nzb['name']], movie['library']['year'], 0):
return True 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'])) log.info("Wrong: %s, undetermined naming. Looking for '%s (%s)'" % (nzb['name'], movie['library']['titles'][0]['title'], movie['library']['year']))
return False return False
@@ -250,3 +254,7 @@ class Searcher(Plugin):
movie_words = re.split('\W+', simplifyString(movie_name)) movie_words = re.split('\W+', simplifyString(movie_name))
return len(list(set(check_words) - set(movie_words))) == 0 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