Newzbin url cleanup
This commit is contained in:
@@ -17,6 +17,11 @@ log = CPLog(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class Newzbin(NZBProvider, RSS):
|
class Newzbin(NZBProvider, RSS):
|
||||||
|
|
||||||
|
urls = {
|
||||||
|
'search': 'https://www.newzbin.com/search/',
|
||||||
|
'download': 'http://www.newzbin.com/api/dnzb/',
|
||||||
|
}
|
||||||
searchUrl = 'https://www.newzbin.com/search/'
|
searchUrl = 'https://www.newzbin.com/search/'
|
||||||
|
|
||||||
format_ids = {
|
format_ids = {
|
||||||
@@ -57,14 +62,14 @@ class Newzbin(NZBProvider, RSS):
|
|||||||
'ps_rb_source': str(format_id),
|
'ps_rb_source': str(format_id),
|
||||||
})
|
})
|
||||||
|
|
||||||
url = "%s?%s" % (self.searchUrl, arguments)
|
url = "%s?%s" % (self.url['search'], arguments)
|
||||||
cache_key = str('newzbin.%s.%s.%s' % (movie['library']['identifier'], str(format_id), str(cat_id)))
|
cache_key = str('newzbin.%s.%s.%s' % (movie['library']['identifier'], str(format_id), str(cat_id)))
|
||||||
single_cat = True
|
single_cat = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = self.getCache(cache_key)
|
data = self.getCache(cache_key)
|
||||||
if not data:
|
if not data:
|
||||||
data = self.urlopen(url, username = self.conf('username'), password = self.conf('password'))
|
data = self.urlopen(url, params = {'username': self.conf('username'), 'password': self.conf('password')})
|
||||||
self.setCache(cache_key, data)
|
self.setCache(cache_key, data)
|
||||||
except (IOError, URLError):
|
except (IOError, URLError):
|
||||||
log.error('Failed to open %s.' % url)
|
log.error('Failed to open %s.' % url)
|
||||||
|
|||||||
Reference in New Issue
Block a user