mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
added new argument for SABnzbd0.7.17+. fixes #222
This commit is contained in:
parent
22c07653cb
commit
6720aa463c
8 changed files with 90 additions and 6 deletions
|
@ -5,6 +5,7 @@ VERSION = 'V8.6'
|
|||
|
||||
# Constants pertinant to SabNzb
|
||||
SABNZB_NO_OF_ARGUMENTS = 8
|
||||
SABNZB_0717_NO_OF_ARGUMENTS = 9
|
||||
|
||||
# Constants pertaining to SickBeard Branches:
|
||||
# extend this list to include all branches/forks that use "failed" to handle failed downloads.
|
||||
|
|
|
@ -2,6 +2,9 @@ Change_LOG / History
|
|||
|
||||
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
|
||||
Moved delete to end of routine, only when succesful process occurs.
|
||||
Don't flatten hp category (in case multi cd album)
|
||||
|
|
|
@ -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...")
|
||||
|
|
|
@ -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.
|
||||
Logger.info("Script triggered from NZBGet, starting autoProcessGames...")
|
||||
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:
|
||||
# SABnzbd argv:
|
||||
# 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
|
||||
Logger.info("Script triggered from SABnzbd, starting autoProcessGames...")
|
||||
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:
|
||||
Logger.warn("Invalid number of arguments received from client. Exiting")
|
||||
sys.exit(1)
|
||||
|
|
|
@ -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
|
||||
Logger.info("Script triggered from NZBGet, starting autoProcessMusic...")
|
||||
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:
|
||||
# SABnzbd argv:
|
||||
# 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
|
||||
Logger.info("Script triggered from SABnzbd, starting autoProcessMusic...")
|
||||
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:
|
||||
Logger.warn("Invalid number of arguments received from client.")
|
||||
Logger.info("Running autoProcessMusic as a manual run...")
|
||||
|
|
|
@ -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'):
|
||||
download_id = os.environ['NZBPR_COUCHPOTATO']
|
||||
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:
|
||||
# SABnzbd argv:
|
||||
# 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")
|
||||
clientAgent = "sabnzbd"
|
||||
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.
|
||||
Logger.warn("MAIN: Invalid number of arguments received from client.")
|
||||
Logger.info("MAIN: Running autoProcessMovie as a manual run...")
|
||||
|
|
|
@ -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.
|
||||
Logger.info("Script triggered from NZBGet, starting autoProcessComics...")
|
||||
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:
|
||||
# SABnzbd argv:
|
||||
# 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
|
||||
Logger.info("Script triggered from SABnzbd, starting autoProcessComics...")
|
||||
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:
|
||||
Logger.warn("Invalid number of arguments received from client.")
|
||||
Logger.info("Running autoProcessComics as a manual run...")
|
||||
|
|
|
@ -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.
|
||||
Logger.info("Script triggered from NZBGet, starting autoProcessTV...")
|
||||
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:
|
||||
# SABnzbd argv:
|
||||
# 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
|
||||
Logger.info("Script triggered from SABnzbd, starting autoProcessTV...")
|
||||
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:
|
||||
Logger.debug("Invalid number of arguments received from client.")
|
||||
Logger.info("Running autoProcessTV as a manual run...")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue