mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
logging
This commit is contained in:
parent
3d9675f66e
commit
9562b47794
1 changed files with 11 additions and 6 deletions
|
@ -1,11 +1,16 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import logging
|
||||
|
||||
import autoProcessMovie
|
||||
|
||||
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
|
||||
if len(sys.argv) == 8:
|
||||
|
@ -17,7 +22,7 @@ if len(sys.argv) == 8:
|
|||
# 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
|
||||
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])
|
||||
|
||||
# NZBGet
|
||||
|
@ -26,11 +31,11 @@ elif len(sys.argv) == 4:
|
|||
# 1 The final directory of the job (full path)
|
||||
# 2 The original name of the NZB file
|
||||
# 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])
|
||||
|
||||
else:
|
||||
print "Invalid number of arguments received from client."
|
||||
print "Running autoProcessMovie as a manual run..."
|
||||
Logger.debug("Invalid number of arguments received from client.")
|
||||
Logger.info("Running autoProcessMovie as a manual run...")
|
||||
autoProcessMovie.process('Manual Run', 'Manual Run', 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue