This commit is contained in:
Clinton Hall 2013-02-27 18:31:38 -08:00
commit 9562b47794

View file

@ -1,11 +1,16 @@
#!/usr/bin/env python #!/usr/bin/env python
import sys import sys
import logging
import autoProcessMovie import autoProcessMovie
from nzbToMediaEnv import * from nzbToMediaEnv import *
from nzbToMediaUtil import *
print "nzbToCouchPotato %s" % VERSION nzbtomedia_configure_logging(os.path.dirname(sys.argv[0]))
Logger = logging.getLogger(__name__)
Logger.info("nzbToCouchPotato %s", VERSION)
# SABnzbd # SABnzbd
if len(sys.argv) == 8: if len(sys.argv) == 8:
@ -17,7 +22,7 @@ if len(sys.argv) == 8:
# 5 User-defined category # 5 User-defined category
# 6 Group that the NZB was posted in e.g. alt.binaries.x # 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 # 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2
print "Script triggered from SABnzbd, starting autoProcessMovie..." Logger.info("Script triggered from SABnzbd, starting autoProcessMovie...")
autoProcessMovie.process(sys.argv[1], sys.argv[2], sys.argv[7]) autoProcessMovie.process(sys.argv[1], sys.argv[2], sys.argv[7])
# NZBGet # NZBGet
@ -26,11 +31,11 @@ elif len(sys.argv) == 4:
# 1 The final directory of the job (full path) # 1 The final directory of the job (full path)
# 2 The original name of the NZB file # 2 The original name of the NZB file
# 3 The status of the download: 0 == successful # 3 The status of the download: 0 == successful
print "Script triggered from NZBGet, starting autoProcessMovie..." Logger.info("Script triggered from NZBGet, starting autoProcessMovie...")
autoProcessMovie.process(sys.argv[1], sys.argv[2], sys.argv[3]) autoProcessMovie.process(sys.argv[1], sys.argv[2], sys.argv[3])
else: else:
print "Invalid number of arguments received from client." Logger.debug("Invalid number of arguments received from client.")
print "Running autoProcessMovie as a manual run..." Logger.info("Running autoProcessMovie as a manual run...")
autoProcessMovie.process('Manual Run', 'Manual Run', 0) autoProcessMovie.process('Manual Run', 'Manual Run', 0)