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
+52 -21

No files matched your search

@@ -38,13 +38,20 @@ config = [{
'default': '0,0,0,0,0,0', 'default': '0,0,0,0,0,0',
'description': 'Starting score for each release found via this provider.', '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', 'name': 'api_key',
'default': ',,,,,', 'default': ',,,,,',
'label': 'Api Key', 'label': 'Api Key',
'description': 'Can be found on your profile page', 'description': 'Can be found on your profile page',
'type': 'combined', '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', ''), 'imdbid': movie['library']['identifier'].replace('tt', ''),
'apikey': host['api_key'], 'apikey': host['api_key'],
'extended': 1 'extended': 1
}) }) + ('&%s' % host['tag'] if host['tag'] else '')
url = '%s&%s' % (self.getUrl(host['host'], self.urls['search']), arguments) url = '%s&%s' % (self.getUrl(host['host'], self.urls['search']), arguments)
nzbs = self.getRSSData(url, cache_timeout = 1800, headers = {'User-Agent': Env.getIdentifier()}) 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) hosts = splitString(self.conf('host'), clean = False)
api_keys = splitString(self.conf('api_key'), clean = False) api_keys = splitString(self.conf('api_key'), clean = False)
extra_score = splitString(self.conf('extra_score'), clean = False) extra_score = splitString(self.conf('extra_score'), clean = False)
custom_tags = splitString(self.conf('custom_tag'), clean = False)
list = [] list = []
for nr in range(len(hosts)): for nr in range(len(hosts)):
@@ -110,11 +111,18 @@ class Newznab(NZBProvider, RSS):
try: host = hosts[nr] try: host = hosts[nr]
except: host = '' except: host = ''
try: score = tryInt(extra_score[nr])
except: score = 0
try: tag = custom_tags[nr]
except: tag = ''
list.append({ list.append({
'use': uses[nr], 'use': uses[nr],
'host': host, 'host': host,
'api_key': key, 'api_key': key,
'extra_score': tryInt(extra_score[nr]) if len(extra_score) > nr else 0 'extra_score': score,
'custom_tag': tag
}) })
return list return list
+34 -18
View File
@@ -113,7 +113,7 @@
width: 20px; width: 20px;
} }
.Scan_folder { padding: 0 !important; } .Scan_folder { padding: 0 !important; }
.page .ctrlHolder { .page .ctrlHolder {
line-height: 25px; line-height: 25px;
@@ -132,11 +132,11 @@
.page .ctrlHolder .formHint { .page .ctrlHolder .formHint {
width: 46%; width: 46%;
margin: -18px 0; margin: -18px 0;
color: #fff !important; color: #fff !important;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
padding: 0 0 0 2%; padding: 0 0 0 2%;
line-height: 14px; line-height: 14px;
} }
.page .check { .page .check {
@@ -559,23 +559,15 @@
.page .combined_table .head abbr.pass_key { margin-right: 71px; } .page .combined_table .head abbr.pass_key { margin-right: 71px; }
.page .combined_table input.pass_key { width: 113px; } .page .combined_table input.pass_key { width: 113px; }
.page .section_newznab .combined_table .head abbr.api_key { margin-right: 185px; } .page .section_newznab .combined_table .head abbr.api_key { margin-right: 190px; }
.page .section_newznab .combined_table input.api_key { width: 223px; } .page .section_newznab .combined_table input.api_key { width: 223px; }
.page .combined_table .seed_ratio, .page .combined_table .head abbr.extra_score {
.page .combined_table .seed_time { margin-right: 25px;
width: 70px; display: none;
text-align: center;
margin-left: 10px;
} }
.page .combined_table .seed_time { .page .combined_table input.extra_score {
margin-right: 10px; width: 80px;
}
.page .combined_table .head .extra_score,
.page .combined_table .extra_score {
width: 70px;
text-align: center;
display: none; display: none;
} }
.page.show_advanced .combined_table .head .extra_score, .page.show_advanced .combined_table .head .extra_score,
@@ -583,6 +575,30 @@
display: inline-block; display: inline-block;
} }
.page .combined_table .head abbr.custom_tag {
margin-right: 15px;
display: none;
}
.page .combined_table input.custom_tag {
width: 84px;
display: none;
}
.page.show_advanced .combined_table .head .custom_tag,
.page.show_advanced .combined_table .custom_tag {
display: inline-block;
}
.page .combined_table .seed_ratio,
.page .combined_table .seed_time {
width: 70px;
text-align: center;
margin-left: 10px;
}
.page .combined_table .seed_time {
margin-right: 10px;
}
.page .combined_table .ctrlHolder { .page .combined_table .ctrlHolder {
padding-top: 2px; padding-top: 2px;
padding-bottom: 3px; padding-bottom: 3px;