|
|
@ -2,6 +2,7 @@ from base64 import standard_b64encode |
|
|
|
from couchpotato.core.downloaders.base import Downloader |
|
|
|
from couchpotato.core.helpers.variable import tryInt |
|
|
|
from couchpotato.core.logger import CPLog |
|
|
|
import re |
|
|
|
import socket |
|
|
|
import traceback |
|
|
|
import xmlrpclib |
|
|
@ -44,11 +45,10 @@ class NZBGet(Downloader): |
|
|
|
log.error('Protocol Error: %s', e) |
|
|
|
return False |
|
|
|
|
|
|
|
priority = tryInt(self.conf('priority')) |
|
|
|
if priority != 0: |
|
|
|
if re.search(r"^0", rpc.version()): |
|
|
|
xml_response = rpc.append(nzb_name, self.conf('category'), False, standard_b64encode(filedata.strip())) |
|
|
|
else: |
|
|
|
xml_response = rpc.append(nzb_name, self.conf('category'), priority, False, standard_b64encode(filedata.strip())) |
|
|
|
xml_response = rpc.append(nzb_name, self.conf('category'), tryInt(self.conf('priority')), False, standard_b64encode(filedata.strip())) |
|
|
|
|
|
|
|
if xml_response: |
|
|
|
log.info('NZB sent successfully to NZBGet') |
|
|
|