Update nzbToSickBeard.py

This commit is contained in:
nivong 2013-01-29 14:37:10 +01:00
commit 34ab8ddedc

View file

@ -17,18 +17,17 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>. # along with Sick Beard. If not, see <http://www.gnu.org/licenses/>.
#
# Edited by Clinton Hall to prevent processing of failed downloads.
# Also added suppot for NZBGet. With help from thorli
import sys import sys
import autoProcessTV import autoProcessTV
print "nzbToSickBeard V4.0" if len(sys.argv) < 8:
print "Not enough arguments received from SABnzbd. Please update it."
sys.exit()
else:
autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[7])
# SABnzbd
if len(sys.argv) == 8:
# SABnzbd argv: # SABnzbd argv:
# 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
@ -36,20 +35,4 @@ if len(sys.argv) == 8:
# 4 Indexer's report number (if supported) # 4 Indexer's report number (if supported)
# 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+21
print "Script triggered from SABnzbd, starting autoProcessTV..."
autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[7])
# NZBGet
elif len(sys.argv) == 4:
# NZBGet argv:
# 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 autoProcessTV..."
autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[3])
else:
print "Invalid number of arguments received from client."
sys.exit()