From dc61e9916f746a9228f6aa272a2c1c3c2e034e6c Mon Sep 17 00:00:00 2001 From: mano3m Date: Mon, 23 Dec 2013 15:39:45 +0100 Subject: [PATCH] Add https functionality for nzbget Fixes #2622 --- couchpotato/core/downloaders/nzbget/__init__.py | 7 +++++++ couchpotato/core/downloaders/nzbget/main.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/downloaders/nzbget/__init__.py b/couchpotato/core/downloaders/nzbget/__init__.py index 00763cfb..1f21c056 100644 --- a/couchpotato/core/downloaders/nzbget/__init__.py +++ b/couchpotato/core/downloaders/nzbget/__init__.py @@ -25,6 +25,13 @@ config = [{ 'default': 'localhost:6789', 'description': 'Hostname with port. Usually localhost:6789', }, + { + 'name': 'ssl', + 'default': 0, + 'type': 'bool', + 'advanced': True, + 'description': 'Use HyperText Transfer Protocol Secure, or https', + }, { 'name': 'username', 'default': 'nzbget', diff --git a/couchpotato/core/downloaders/nzbget/main.py b/couchpotato/core/downloaders/nzbget/main.py index 482da2ca..c77561f4 100644 --- a/couchpotato/core/downloaders/nzbget/main.py +++ b/couchpotato/core/downloaders/nzbget/main.py @@ -17,7 +17,7 @@ class NZBGet(Downloader): protocol = ['nzb'] - url = 'http://%(username)s:%(password)s@%(host)s/xmlrpc' + url = '%(protocol)://%(username)s:%(password)s@%(host)s/xmlrpc' def download(self, data = None, media = None, filedata = None): if not media: media = {} @@ -29,7 +29,7 @@ class NZBGet(Downloader): log.info('Sending "%s" to NZBGet.', data.get('name')) - url = self.url % {'host': self.conf('host'), 'username': self.conf('username'), 'password': self.conf('password')} + url = self.url % {'protocol': 'https' if self.conf('ssl') else 'http', 'host': self.conf('host'), 'username': self.conf('username'), 'password': self.conf('password')} nzb_name = ss('%s.nzb' % self.createNzbName(data, media)) rpc = xmlrpclib.ServerProxy(url)