Private GIT

Skip to content
Snippets Groups Projects
Commit 49076fcd authored by Alexandre Beloin's avatar Alexandre Beloin
Browse files

KAT: Added removeWordsList to remove ending group

parent ec45cf8d
Branches
Tags
No related merge requests found
...@@ -59,12 +59,37 @@ class KATProvider(generic.TorrentProvider): ...@@ -59,12 +59,37 @@ class KATProvider(generic.TorrentProvider):
self.url = self.urls['base_url'] self.url = self.urls['base_url']
# Valid options search, searchre
self.removeWordsList = {'\[rartv\]$': 'searchre',
'\[rarbg\]$': 'searchre',
'\[eztv\]$': 'searchre',
'\[ettv\]$': 'searchre',
'\[GloDLS\]$': 'searchre',
'\[silv4\]$': 'searchre',
'\[Seedbox\]$': 'searchre',
'\[AndroidTwoU\]$': 'searchre',
'\.RiPSaLoT$': 'searchre',
}
def isEnabled(self): def isEnabled(self):
return self.enabled return self.enabled
def imageName(self): def imageName(self):
return 'kat.png' return 'kat.png'
def removeWords(self, title):
torrent_title = title
for remove_string, remove_type in self.removeWordsList.iteritems():
if remove_type == 'search':
torrent_title = torrent_title.replace(remove_string, '')
elif remove_type == 'searchre':
torrent_title = re.sub(remove_string, '', torrent_title)
if torrent_title != title:
logger.log(u'Change title from {old_name} to {new_name}'.format(old_name=title, new_name=torrent_title), logger.DEBUG)
return torrent_title
def getQuality(self, item, anime=False): def getQuality(self, item, anime=False):
quality = Quality.sceneQuality(item[0], anime) quality = Quality.sceneQuality(item[0], anime)
...@@ -237,7 +262,7 @@ class KATProvider(generic.TorrentProvider): ...@@ -237,7 +262,7 @@ class KATProvider(generic.TorrentProvider):
try: try:
link = item['link'] link = item['link']
id = item['guid'] id = item['guid']
title = item['title'] title = self.removeWords(item['title'])
url = item['torrent_magneturi'] url = item['torrent_magneturi']
verified = bool(int(item['torrent_verified']) or 0) verified = bool(int(item['torrent_verified']) or 0)
seeders = int(item['torrent_seeds']) seeders = int(item['torrent_seeds'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment