added new argument for SABnzbd0.7.17+. fixes #222

This commit is contained in:
clinton-hall 2013-12-20 11:48:08 +10:30
commit 6720aa463c
8 changed files with 90 additions and 6 deletions

View file

@ -205,7 +205,7 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
Logger.info("Script triggered from NZBGet, starting autoProcessMovie...")
clientAgent = "nzbget"
result = autoProcessMovie.process(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBNAME'], status, clientAgent, download_id)
# SABnzbd
# SABnzbd Pre 0.7.17
elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# SABnzbd argv:
# 1 The final directory of the job (full path)
@ -218,6 +218,20 @@ elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
Logger.info("Script triggered from SABnzbd, starting autoProcessMovie...")
clientAgent = "sabnzbd"
result = autoProcessMovie.process(sys.argv[1], sys.argv[2], sys.argv[7], clientAgent)
# SABnzbd 0.7.17+
elif len(sys.argv) == SABNZB_0717_NO_OF_ARGUMENTS:
# SABnzbd argv:
# 1 The final directory of the job (full path)
# 2 The original name of the NZB file
# 3 Clean version of the job name (no path info and ".nzb" removed)
# 4 Indexer's report number (if supported)
# 5 User-defined category
# 6 Group that the NZB was posted in e.g. alt.binaries.x
# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2
# 8 Failure URL
Logger.info("Script triggered from SABnzbd 0.7.17+, starting autoProcessMovie...")
clientAgent = "sabnzbd"
result = autoProcessMovie.process(sys.argv[1], sys.argv[2], sys.argv[7], clientAgent)
else:
Logger.warn("Invalid number of arguments received from client.")
Logger.info("Running autoProcessMovie as a manual run...")