NZBget version check
This commit is contained in:
@@ -2,6 +2,7 @@ from base64 import standard_b64encode
|
|||||||
from couchpotato.core.downloaders.base import Downloader
|
from couchpotato.core.downloaders.base import Downloader
|
||||||
from couchpotato.core.helpers.variable import tryInt
|
from couchpotato.core.helpers.variable import tryInt
|
||||||
from couchpotato.core.logger import CPLog
|
from couchpotato.core.logger import CPLog
|
||||||
|
import re
|
||||||
import socket
|
import socket
|
||||||
import traceback
|
import traceback
|
||||||
import xmlrpclib
|
import xmlrpclib
|
||||||
@@ -44,11 +45,10 @@ class NZBGet(Downloader):
|
|||||||
log.error('Protocol Error: %s', e)
|
log.error('Protocol Error: %s', e)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
priority = tryInt(self.conf('priority'))
|
if re.search(r"^0", rpc.version()):
|
||||||
if priority != 0:
|
|
||||||
xml_response = rpc.append(nzb_name, self.conf('category'), False, standard_b64encode(filedata.strip()))
|
xml_response = rpc.append(nzb_name, self.conf('category'), False, standard_b64encode(filedata.strip()))
|
||||||
else:
|
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:
|
if xml_response:
|
||||||
log.info('NZB sent successfully to NZBGet')
|
log.info('NZB sent successfully to NZBGet')
|
||||||
|
|||||||
Reference in New Issue
Block a user