Better scoring and don't download releases with low score
This commit is contained in:
1 parent
67926f92a1
commit
b87c9ebc63
4 files changed
+34
-11
No files matched your search
@@ -26,7 +26,7 @@ class QualityPlugin(Plugin):
|
|||||||
{'identifier': 'r5', 'size': (600, 1000), 'label': 'R5', 'alternative': [], 'allow': ['dvdr'], 'ext':['avi', 'mpg', 'mpeg']},
|
{'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': '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': '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']
|
pre_releases = ['cam', 'ts', 'tc', 'r5', 'scr']
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from couchpotato.core.helpers.variable import getTitle
|
|||||||
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.plugins.score.scores import nameScore, nameRatioScore, \
|
from couchpotato.core.plugins.score.scores import nameScore, nameRatioScore, \
|
||||||
sizeScore, providerScore, duplicateScore
|
sizeScore, providerScore, duplicateScore, partialIgnoredScore
|
||||||
|
|
||||||
log = CPLog(__name__)
|
log = CPLog(__name__)
|
||||||
|
|
||||||
@@ -38,6 +38,9 @@ class Score(Plugin):
|
|||||||
# Duplicates in name
|
# Duplicates in name
|
||||||
score += duplicateScore(nzb['name'], getTitle(movie['library']))
|
score += duplicateScore(nzb['name'], getTitle(movie['library']))
|
||||||
|
|
||||||
|
# Partial ignored words
|
||||||
|
score += partialIgnoredScore(nzb['name'], getTitle(movie['library']))
|
||||||
|
|
||||||
# Extra provider specific check
|
# Extra provider specific check
|
||||||
extra_score = nzb.get('extra_score')
|
extra_score = nzb.get('extra_score')
|
||||||
if extra_score:
|
if extra_score:
|
||||||
|
|||||||
@@ -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]
|
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
|
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
|
||||||
@@ -145,6 +145,9 @@ class Searcher(Plugin):
|
|||||||
|
|
||||||
|
|
||||||
for nzb in sorted_results:
|
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)
|
downloaded = self.download(data = nzb, movie = movie)
|
||||||
if downloaded is True:
|
if downloaded is True:
|
||||||
ret = True
|
ret = True
|
||||||
@@ -245,7 +248,7 @@ class Searcher(Plugin):
|
|||||||
log.info("Wrong: '%s' blacklisted words: %s" % (nzb['name'], ", ".join(blacklisted)))
|
log.info("Wrong: '%s' blacklisted words: %s" % (nzb['name'], ", ".join(blacklisted)))
|
||||||
return False
|
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:
|
for p_tag in pron_tags:
|
||||||
if p_tag in nzb_words and p_tag not in movie_words:
|
if p_tag in nzb_words and p_tag not in movie_words:
|
||||||
log.info('Wrong: %s, probably pr0n', (nzb['name']))
|
log.info('Wrong: %s, probably pr0n', (nzb['name']))
|
||||||
@@ -406,17 +409,19 @@ class Searcher(Plugin):
|
|||||||
if dates.get('theater') - 604800 < now:
|
if dates.get('theater') - 604800 < now:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
# 6 weeks after theater release
|
# 12 weeks after theater release
|
||||||
if dates.get('theater') + 3628800 < now:
|
if dates.get('theater') > 0 and dates.get('theater') + 7257600 < now:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# 6 weeks before dvd release
|
if dates.get('dvd') > 0:
|
||||||
if dates.get('dvd') - 3628800 < now:
|
|
||||||
return True
|
|
||||||
|
|
||||||
# Dvd should be released
|
# 3 weeks before dvd release
|
||||||
if dates.get('dvd') > 0 and dates.get('dvd') < now:
|
if dates.get('dvd') - 1814400 < now:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# Dvd should be released
|
||||||
|
if dates.get('dvd') < now:
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
return False
|
return False
|
||||||
Reference in new issue
Block a user