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

@ -5,6 +5,7 @@ VERSION = 'V8.6'
# Constants pertinant to SabNzb # Constants pertinant to SabNzb
SABNZB_NO_OF_ARGUMENTS = 8 SABNZB_NO_OF_ARGUMENTS = 8
SABNZB_0717_NO_OF_ARGUMENTS = 9
# Constants pertaining to SickBeard Branches: # Constants pertaining to SickBeard Branches:
# extend this list to include all branches/forks that use "failed" to handle failed downloads. # extend this list to include all branches/forks that use "failed" to handle failed downloads.

View file

@ -2,6 +2,9 @@ Change_LOG / History
V8.6 xx/xx/2013 V8.6 xx/xx/2013
Impacts NZBs
SABnzbd 0.7.17+ now uses 8 arguments, not 7. These scripts now support the extra argument.
Impacts Torrents Impacts Torrents
Moved delete to end of routine, only when succesful process occurs. Moved delete to end of routine, only when succesful process occurs.
Don't flatten hp category (in case multi cd album) Don't flatten hp category (in case multi cd album)

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...") Logger.info("Script triggered from NZBGet, starting autoProcessMovie...")
clientAgent = "nzbget" clientAgent = "nzbget"
result = autoProcessMovie.process(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBNAME'], status, clientAgent, download_id) 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: elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# SABnzbd argv: # SABnzbd argv:
# 1 The final directory of the job (full path) # 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...") Logger.info("Script triggered from SABnzbd, starting autoProcessMovie...")
clientAgent = "sabnzbd" clientAgent = "sabnzbd"
result = autoProcessMovie.process(sys.argv[1], sys.argv[2], sys.argv[7], clientAgent) 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: else:
Logger.warn("Invalid number of arguments received from client.") Logger.warn("Invalid number of arguments received from client.")
Logger.info("Running autoProcessMovie as a manual run...") Logger.info("Running autoProcessMovie as a manual run...")

View file

@ -146,7 +146,7 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
# All checks done, now launching the script. # All checks done, now launching the script.
Logger.info("Script triggered from NZBGet, starting autoProcessGames...") Logger.info("Script triggered from NZBGet, starting autoProcessGames...")
result = autoProcessGames.process(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBNAME'], status) result = autoProcessGames.process(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBNAME'], status)
# SABnzbd # SABnzbd Pre 0.7.17
elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS: elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# SABnzbd argv: # SABnzbd argv:
# 1 The final directory of the job (full path) # 1 The final directory of the job (full path)
@ -158,6 +158,19 @@ elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2 # 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2
Logger.info("Script triggered from SABnzbd, starting autoProcessGames...") Logger.info("Script triggered from SABnzbd, starting autoProcessGames...")
result = autoProcessGames.process(sys.argv[1], sys.argv[3], sys.argv[7]) result = autoProcessGames.process(sys.argv[1], sys.argv[3], sys.argv[7])
# 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 autoProcessGames...")
result = autoProcessGames.process(sys.argv[1], sys.argv[3], sys.argv[7])
else: else:
Logger.warn("Invalid number of arguments received from client. Exiting") Logger.warn("Invalid number of arguments received from client. Exiting")
sys.exit(1) sys.exit(1)

View file

@ -151,7 +151,7 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
# All checks done, now launching the script # All checks done, now launching the script
Logger.info("Script triggered from NZBGet, starting autoProcessMusic...") Logger.info("Script triggered from NZBGet, starting autoProcessMusic...")
result = autoProcessMusic.process(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBNAME'], status) result = autoProcessMusic.process(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBNAME'], status)
# SABnzbd # SABnzbd Pre 0.7.17
elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS: elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# SABnzbd argv: # SABnzbd argv:
# 1 The final directory of the job (full path) # 1 The final directory of the job (full path)
@ -163,6 +163,19 @@ elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2 # 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2
Logger.info("Script triggered from SABnzbd, starting autoProcessMusic...") Logger.info("Script triggered from SABnzbd, starting autoProcessMusic...")
result = autoProcessMusic.process(sys.argv[1], sys.argv[2], sys.argv[7]) result = autoProcessMusic.process(sys.argv[1], sys.argv[2], sys.argv[7])
# 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 Failue URL
Logger.info("Script triggered from SABnzbd 0.7.17+, starting autoProcessMusic...")
result = autoProcessMusic.process(sys.argv[1], sys.argv[2], sys.argv[7])
else: else:
Logger.warn("Invalid number of arguments received from client.") Logger.warn("Invalid number of arguments received from client.")
Logger.info("Running autoProcessMusic as a manual run...") Logger.info("Running autoProcessMusic as a manual run...")

View file

@ -353,7 +353,7 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
if os.environ.has_key('NZBPR_COUCHPOTATO'): if os.environ.has_key('NZBPR_COUCHPOTATO'):
download_id = os.environ['NZBPR_COUCHPOTATO'] download_id = os.environ['NZBPR_COUCHPOTATO']
nzbDir, inputName, inputCategory = (os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBFILENAME'], os.environ['NZBPP_CATEGORY']) nzbDir, inputName, inputCategory = (os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBFILENAME'], os.environ['NZBPP_CATEGORY'])
# SABnzbd # SABnzbd Pre 0.7.17
elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS: elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# SABnzbd argv: # SABnzbd argv:
# 1 The final directory of the job (full path) # 1 The final directory of the job (full path)
@ -366,6 +366,20 @@ elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
Logger.info("MAIN: Script triggered from SABnzbd") Logger.info("MAIN: Script triggered from SABnzbd")
clientAgent = "sabnzbd" clientAgent = "sabnzbd"
nzbDir, inputName, status, inputCategory, download_id = (sys.argv[1], sys.argv[2], sys.argv[7], sys.argv[5], '') nzbDir, inputName, status, inputCategory, download_id = (sys.argv[1], sys.argv[2], sys.argv[7], sys.argv[5], '')
# 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("MAIN: Script triggered from SABnzbd 0.7.17+")
clientAgent = "sabnzbd"
nzbDir, inputName, status, inputCategory, download_id = (sys.argv[1], sys.argv[2], sys.argv[7], sys.argv[5], '')
else: # only CPS supports this manual run for now. else: # only CPS supports this manual run for now.
Logger.warn("MAIN: Invalid number of arguments received from client.") Logger.warn("MAIN: Invalid number of arguments received from client.")
Logger.info("MAIN: Running autoProcessMovie as a manual run...") Logger.info("MAIN: Running autoProcessMovie as a manual run...")

View file

@ -149,7 +149,7 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
# All checks done, now launching the script. # All checks done, now launching the script.
Logger.info("Script triggered from NZBGet, starting autoProcessComics...") Logger.info("Script triggered from NZBGet, starting autoProcessComics...")
result = autoProcessComics.processEpisode(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBNAME'], status) result = autoProcessComics.processEpisode(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBNAME'], status)
# SABnzbd # SABnzbd Pre 0.7.17
elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS: elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# SABnzbd argv: # SABnzbd argv:
# 1 The final directory of the job (full path) # 1 The final directory of the job (full path)
@ -161,6 +161,19 @@ elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2 # 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2
Logger.info("Script triggered from SABnzbd, starting autoProcessComics...") Logger.info("Script triggered from SABnzbd, starting autoProcessComics...")
result = autoProcessComics.processEpisode(sys.argv[1], sys.argv[3], sys.argv[7]) result = autoProcessComics.processEpisode(sys.argv[1], sys.argv[3], sys.argv[7])
# 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 autoProcessComics...")
result = autoProcessComics.processEpisode(sys.argv[1], sys.argv[3], sys.argv[7])
else: else:
Logger.warn("Invalid number of arguments received from client.") Logger.warn("Invalid number of arguments received from client.")
Logger.info("Running autoProcessComics as a manual run...") Logger.info("Running autoProcessComics as a manual run...")

View file

@ -198,7 +198,7 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
# All checks done, now launching the script. # All checks done, now launching the script.
Logger.info("Script triggered from NZBGet, starting autoProcessTV...") Logger.info("Script triggered from NZBGet, starting autoProcessTV...")
result = autoProcessTV.processEpisode(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBFILENAME'], status) result = autoProcessTV.processEpisode(os.environ['NZBPP_DIRECTORY'], os.environ['NZBPP_NZBFILENAME'], status)
# SABnzbd # SABnzbd Pre 0.7.17
elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS: elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# SABnzbd argv: # SABnzbd argv:
# 1 The final directory of the job (full path) # 1 The final directory of the job (full path)
@ -210,6 +210,19 @@ elif len(sys.argv) == SABNZB_NO_OF_ARGUMENTS:
# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2 # 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2
Logger.info("Script triggered from SABnzbd, starting autoProcessTV...") Logger.info("Script triggered from SABnzbd, starting autoProcessTV...")
result = autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[7]) result = autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[7])
# 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 autoProcessTV...")
result = autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[7])
else: else:
Logger.debug("Invalid number of arguments received from client.") Logger.debug("Invalid number of arguments received from client.")
Logger.info("Running autoProcessTV as a manual run...") Logger.info("Running autoProcessTV as a manual run...")