diff --git a/couchpotato/core/plugins/quality/main.py b/couchpotato/core/plugins/quality/main.py index 665b1fc..84ac80a 100644 --- a/couchpotato/core/plugins/quality/main.py +++ b/couchpotato/core/plugins/quality/main.py @@ -26,7 +26,7 @@ class QualityPlugin(Plugin): {'identifier': 'r5', 'size': (600, 1000), 'label': 'R5', 'alternative': [], 'allow': ['dvdr'], 'ext':['avi', 'mpg', 'mpeg']}, {'identifier': 'tc', 'size': (600, 1000), 'label': 'TeleCine', 'alternative': ['telecine'], 'allow': [], 'ext':['avi', 'mpg', 'mpeg']}, {'identifier': 'ts', 'size': (600, 1000), 'label': 'TeleSync', 'alternative': ['telesync'], 'allow': [], 'ext':['avi', 'mpg', 'mpeg']}, - {'identifier': 'cam', 'size': (600, 1000), 'label': 'Cam', 'alternative': [], 'allow': [], 'ext':['avi', 'mpg', 'mpeg']} + {'identifier': 'cam', 'size': (600, 1000), 'label': 'Cam', 'alternative': ['camrip', 'hdcam'], 'allow': [], 'ext':['avi', 'mpg', 'mpeg']} ] pre_releases = ['cam', 'ts', 'tc', 'r5', 'scr'] diff --git a/couchpotato/core/plugins/score/main.py b/couchpotato/core/plugins/score/main.py index 8b4fedb..2506a47 100644 --- a/couchpotato/core/plugins/score/main.py +++ b/couchpotato/core/plugins/score/main.py @@ -4,7 +4,7 @@ from couchpotato.core.helpers.variable import getTitle from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin from couchpotato.core.plugins.score.scores import nameScore, nameRatioScore, \ - sizeScore, providerScore, duplicateScore + sizeScore, providerScore, duplicateScore, partialIgnoredScore log = CPLog(__name__) @@ -38,6 +38,9 @@ class Score(Plugin): # Duplicates in name score += duplicateScore(nzb['name'], getTitle(movie['library'])) + # Partial ignored words + score += partialIgnoredScore(nzb['name'], getTitle(movie['library'])) + # Extra provider specific check extra_score = nzb.get('extra_score') if extra_score: diff --git a/couchpotato/core/plugins/score/scores.py b/couchpotato/core/plugins/score/scores.py index 2cace04..71fe1f0 100644 --- a/couchpotato/core/plugins/score/scores.py +++ b/couchpotato/core/plugins/score/scores.py @@ -79,3 +79,18 @@ def duplicateScore(nzb_name, movie_name): duplicates = [x for i, x in enumerate(nzb_words) if nzb_words[i:].count(x) > 1] return len(list(set(duplicates) - set(movie_words))) * -4 + + +def partialIgnoredScore(nzb_name, movie_name): + + nzb_name = nzb_name.lower() + movie_name = movie_name.lower() + + ignored_words = [x.strip().lower() for x in Env.setting('ignored_words', section = 'searcher').split(',')] + + score = 0 + for ignored_word in ignored_words: + if ignored_word in nzb_name and ignored_word not in movie_name: + score -= 5 + + return score diff --git a/couchpotato/core/plugins/searcher/main.py b/couchpotato/core/plugins/searcher/main.py index 247f776..da77908 100644 --- a/couchpotato/core/plugins/searcher/main.py +++ b/couchpotato/core/plugins/searcher/main.py @@ -145,6 +145,9 @@ class Searcher(Plugin): for nzb in sorted_results: + if nzb['score'] <= 0: + log.debug('No more releases with score higher than 0') + break downloaded = self.download(data = nzb, movie = movie) if downloaded is True: ret = True @@ -245,7 +248,7 @@ class Searcher(Plugin): log.info("Wrong: '%s' blacklisted words: %s" % (nzb['name'], ", ".join(blacklisted))) return False - pron_tags = ['xxx', 'sex', 'anal', 'tits', 'fuck', 'porn', 'orgy', 'milf', 'boobs'] + pron_tags = ['xxx', 'sex', 'anal', 'tits', 'fuck', 'porn', 'orgy', 'milf', 'boobs', 'erotica', 'erotic'] for p_tag in pron_tags: if p_tag in nzb_words and p_tag not in movie_words: log.info('Wrong: %s, probably pr0n', (nzb['name'])) @@ -406,17 +409,19 @@ class Searcher(Plugin): if dates.get('theater') - 604800 < now: return True else: - # 6 weeks after theater release - if dates.get('theater') + 3628800 < now: + # 12 weeks after theater release + if dates.get('theater') > 0 and dates.get('theater') + 7257600 < now: return True - # 6 weeks before dvd release - if dates.get('dvd') - 3628800 < now: - return True + if dates.get('dvd') > 0: - # Dvd should be released - if dates.get('dvd') > 0 and dates.get('dvd') < now: - return True + # 3 weeks before dvd release + if dates.get('dvd') - 1814400 < now: + return True + + # Dvd should be released + if dates.get('dvd') < now: + return True return False