Private GIT

Skip to content
Snippets Groups Projects
Commit 031a186d authored by Ruud's avatar Ruud
Browse files

NZBx fixes

parent 3c04eed2
Branches
Tags
No related merge requests found
...@@ -19,13 +19,13 @@ class Nzbx(NZBProvider, RSS): ...@@ -19,13 +19,13 @@ class Nzbx(NZBProvider, RSS):
endpoint = 'https://nzbx.co/api/' endpoint = 'https://nzbx.co/api/'
urls = { urls = {
'search': endpoint + 'search', 'search': 'https://nzbx.co/api/search',
'details': endpoint + 'details?guid=%s', 'details': 'https://nzbx.co/api/details?guid=%s',
'comments': endpoint + 'get-comments?guid=%s', 'comments': 'https://nzbx.co/api/get-comments?guid=%s',
'ratings': endpoint + 'get-votes?guid=%s', 'ratings': 'https://nzbx.co/api/get-votes?guid=%s',
'downloads': endpoint + 'get-downloads-count?guid=%s', 'downloads': 'https://nzbx.co/api/get-downloads-count?guid=%s',
'categories': endpoint + 'categories', 'categories': 'https://nzbx.co/api/categories',
'groups': endpoint + 'groups', 'groups': 'https://nzbx.co/api/groups',
} }
http_time_between_calls = 1 # Seconds http_time_between_calls = 1 # Seconds
...@@ -60,16 +60,25 @@ class Nzbx(NZBProvider, RSS): ...@@ -60,16 +60,25 @@ class Nzbx(NZBProvider, RSS):
nzbx_guid = nzb['guid'] nzbx_guid = nzb['guid']
# need to filter by completed def extra_score(item):
score = 0
if item['votes']['upvotes'] > item['votes']['downvotes']:
score += 5
return score
new = { new = {
'guid': nzbx_guid, 'guid': nzbx_guid,
'type': 'nzb', 'type': 'nzb',
'provider': self.getName(), 'provider': self.getName(),
'download': nzb['nzb'], 'download': self.download,
'url': nzb['nzb'],
'name': nzb['name'], 'name': nzb['name'],
'age': self.calculateAge(int(nzb['postdate'])), 'age': self.calculateAge(int(nzb['postdate'])),
'size': tryInt(nzb['size']) / 1024 / 1024, 'size': tryInt(nzb['size']) / 1024 / 1024,
'description': '',
'extra_score': extra_score,
'votes': nzb['votes'],
'check_nzb': True, 'check_nzb': True,
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment