Merge branch 'develop_newznab' of git://github.com/mano3m/CouchPotatoServer into mano3m-develop_newznab

This commit is contained in:
Ruud committed 2014-01-12 15:18:41 +01:00
commit a95320e162
3 files changed
+75 -44

No files matched your search

@@ -38,13 +38,20 @@ config = [{
'default': '0,0,0,0,0,0',
'description': 'Starting score for each release found via this provider.',
},
{
'name': 'custom_tag',
'advanced': True,
'label': 'Custom tag',
'default': ',,,,,',
'description': 'Add custom tags, for example add rls=1 to get only scene releases from nzbs.org',
},
{
'name': 'api_key',
'default': ',,,,,',
'label': 'Api Key',
'description': 'Can be found on your profile page',
'type': 'combined',
'combine': ['use', 'host', 'api_key', 'extra_score'],
'combine': ['use', 'host', 'api_key', 'extra_score', 'custom_tag'],
},
],
},
+10 -2
View File
@@ -46,7 +46,7 @@ class Newznab(NZBProvider, RSS):
'imdbid': movie['library']['identifier'].replace('tt', ''),
'apikey': host['api_key'],
'extended': 1
})
}) + ('&%s' % host['tag'] if host['tag'] else '')
url = '%s&%s' % (self.getUrl(host['host'], self.urls['search']), arguments)
nzbs = self.getRSSData(url, cache_timeout = 1800, headers = {'User-Agent': Env.getIdentifier()})
@@ -100,6 +100,7 @@ class Newznab(NZBProvider, RSS):
hosts = splitString(self.conf('host'), clean = False)
api_keys = splitString(self.conf('api_key'), clean = False)
extra_score = splitString(self.conf('extra_score'), clean = False)
custom_tags = splitString(self.conf('custom_tag'), clean = False)
list = []
for nr in range(len(hosts)):
@@ -110,11 +111,18 @@ class Newznab(NZBProvider, RSS):
try: host = hosts[nr]
except: host = ''
try: score = tryInt(extra_score[nr])
except: score = 0
try: tag = custom_tags[nr]
except: tag = ''
list.append({
'use': uses[nr],
'host': host,
'api_key': key,
'extra_score': tryInt(extra_score[nr]) if len(extra_score) > nr else 0
'extra_score': score,
'custom_tag': tag
})
return list