From d5d86e5ef567bfd89ad2001a7c7e426da0db8a34 Mon Sep 17 00:00:00 2001 From: schumi2004 Date: Fri, 7 Dec 2012 14:19:53 +0100 Subject: [PATCH 1/7] Few changes for failed download handling by clients --- nzbToCouchPotato.py | 38 ++++++------------ nzbToSickBeard.py | 40 +++++++------------ .../9.0/bin/nzbget-postprocess.sh | 26 +++++++++++- 3 files changed, 51 insertions(+), 53 deletions(-) diff --git a/nzbToCouchPotato.py b/nzbToCouchPotato.py index 1fc4cd6b..1d3f1da0 100644 --- a/nzbToCouchPotato.py +++ b/nzbToCouchPotato.py @@ -3,30 +3,18 @@ import sys import autoProcessMovie -# SABnzbd -if len(sys.argv) == 8: -# 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 - print "Script triggered from SABnzbd, starting autoProcessMovie..." +if len(sys.argv) < 8: + print "Invalid number of arguments received from client. Please update it." + sys.exit() +else: + print "Script triggered from client, starting autoProcessMovie..." autoProcessMovie.process(sys.argv[1], sys.argv[2], sys.argv[7]) -# NZBGet -elif len(sys.argv) == 3: -# NZBGet argv: -# 1 The final directory of the job (full path) -# 2 The original name of the NZB file -# From NZBGet only successful downloads are triggered so status is set to "0" - print "Script triggered from NZBGet, starting autoProcessMovie..." - - autoProcessMovie.process(sys.argv[1], sys.argv[2], 0) - -else: - print "Invalid number of arguments received from client." - print "Running autoProcessMovie as a manual run..." - autoProcessMovie.process('Manual Run', 'Manual Run', 0) +# sys.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 diff --git a/nzbToSickBeard.py b/nzbToSickBeard.py index a2cb2d7b..8dd360ec 100644 --- a/nzbToSickBeard.py +++ b/nzbToSickBeard.py @@ -21,33 +21,21 @@ # Edited by Clinton Hall to prevent processing of failed downloads. # Also added suppot for NZBGet. With help from thorli - import sys import autoProcessTV -# SABnzbd -if len(sys.argv) == 8: -# 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 - print "Script triggered from SABnzbd, starting autoProcessTV..." - autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[7]) - -# NZBGet -elif len(sys.argv) == 3: -# NZBGet argv: -# 1 The final directory of the job (full path) -# 2 The original name of the NZB file -# From NZBGet only successful downloads are triggered so status is set to "0" - print "Script triggered from NZBGet, starting autoProcessTV..." - - autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], 0) - +if len(sys.argv) < 8: + print "Invalid number of arguments received from client. Please update it." + sys.exit() else: - print "Invalid number of arguments received from client." - sys.exit() + print "Script triggered from client, starting autoProcessTV..." + autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[7]) + +# sys.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 diff --git a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh index 8d680134..905997c2 100644 --- a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh +++ b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh @@ -164,6 +164,17 @@ if [ "$NZBPP_PARSTATUS" -eq 1 -o "$NZBPP_PARSTATUS" -eq 3 -o "$NZBPP_PARFAILED" echo "[WARNING] Post-Process: Par-check successful, but Par-repair disabled, exiting" else echo "[WARNING] Post-Process: Par-check failed, exiting" + # Send notifications to SickBeard or CouchPotato that Par-check failed + if [ "$SickBeard" = "yes" -a "$NZBPP_CATEGORY" = "$SickBeardCategory" -a -e "$SabToSickBeard" ]; then + # Call SickBeard's postprocessing script + echo "[INFO] Post-Process: Running SickBeard's postprocessing script to notify Par-check failed" + $PythonCmd $SabToSickBeard "$NZBPP_DIRECTORY" "$NZBPP_NZBFILENAME" "" "" "" "" "1" >/dev/null 2>&1 + fi + if [ "$CouchPotato" = "yes" -a "$NZBPP_CATEGORY" = "$CouchPotatoCategory" -a -e "$nzbToCouchPotato" ]; then + # Call CouchPotato's postprocessing script + echo "[INFO] Post-Process: Running CouchPotato's postprocessing script to notify Par-check failed" + $PythonCmd $nzbToCouchPotato "$NZBPP_DIRECTORY" "$NZBPP_NZBFILENAME" "" "" "" "" "1" >/dev/null 2>&1 + fi fi exit $POSTPROCESS_ERROR fi @@ -226,6 +237,17 @@ if (ls *.rar >/dev/null 2>&1); then if (ls *.[pP][aA][rR]2 >/dev/null 2>&1); then echo "[INFO] Post-Process: Requesting par-repair" exit $POSTPROCESS_PARCHECK_ALL + # Send notifications to SickBeard or CouchPotato that unrar (second pass) failed + if [ "$SickBeard" = "yes" -a "$NZBPP_CATEGORY" = "$SickBeardCategory" -a -e "$SabToSickBeard" ]; then + # Call SickBeard's postprocessing script + echo "[INFO] Post-Process: Running SickBeard's postprocessing script to notify unrar (second pass) failed" + $PythonCmd $SabToSickBeard "$NZBPP_DIRECTORY" "$NZBPP_NZBFILENAME" "" "" "" "" "1">/dev/null 2>&1 + fi + if [ "$CouchPotato" = "yes" -a "$NZBPP_CATEGORY" = "$CouchPotatoCategory" -a -e "$nzbToCouchPotato" ]; then + # Call CouchPotato's postprocessing script + echo "[INFO] Post-Process: Running CouchPotato's postprocessing script to notify unrar (second pass) failed" + $PythonCmd $nzbToCouchPotato "$NZBPP_DIRECTORY" "$NZBPP_NZBFILENAME" "" "" "" "" "1">/dev/null 2>&1 + fi fi exit $POSTPROCESS_ERROR fi @@ -355,13 +377,13 @@ fi if [ "$SickBeard" = "yes" -a "$NZBPP_CATEGORY" = "$SickBeardCategory" -a -e "$NzbToSickBeard" ]; then # Call SickBeard's postprocessing script echo "[INFO] Post-Process: Running SickBeard's postprocessing script" - $PythonCmd $NzbToSickBeard "$NZBPP_DIRECTORY" "$NZBPP_NZBFILENAME" >/dev/null 2>&1 + $PythonCmd $NzbToSickBeard "$NZBPP_DIRECTORY" "$NZBPP_NZBFILENAME" "" "" "" "" "0" >/dev/null 2>&1 fi if [ "$CouchPotato" = "yes" -a "$NZBPP_CATEGORY" = "$CouchPotatoCategory" -a -e "$NzbToCouchPotato" ]; then # Call CouchPotato's postprocessing script echo "[INFO] Post-Process: Running CouchPotato's postprocessing script" - $PythonCmd $NzbToCouchPotato "$NZBPP_DIRECTORY" "$NZBPP_NZBFILENAME" >/dev/null 2>&1 + $PythonCmd $NzbToCouchPotato "$NZBPP_DIRECTORY" "$NZBPP_NZBFILENAME" "" "" "" "" "0" >/dev/null 2>&1 fi # Check if destination directory was set in postprocessing parameters From 1bd0a5e40102e6392ac352489eff6e32237438d7 Mon Sep 17 00:00:00 2001 From: schumi2004 Date: Fri, 7 Dec 2012 14:20:49 +0100 Subject: [PATCH 2/7] Added extra clean up items --- .../9.0/bin/nzbget-postprocess.sh | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh index 905997c2..51993ae4 100644 --- a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh +++ b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh @@ -308,6 +308,27 @@ rm *.nzb >/dev/null 2>&1 rm *.sfv >/dev/null 2>&1 rm *.1 >/dev/null 2>&1 rm _brokenlog.txt >/dev/null 2>&1 +# Extra clean up items +rm *.nfo >/dev/null 2>&1 +rm *.srr >/dev/null 2>&1 +rm *.srs >/dev/null 2>&1 +rm *.tbn >/dev/null 2>&1 +rm *.html >/dev/null 2>&1 +rm *.bat >/dev/null 2>&1 +rm *.htm >/dev/null 2>&1 +rm *.txt >/dev/null 2>&1 +rm *.png >/dev/null 2>&1 +rm *.exe >/dev/null 2>&1 +rm *.jpg >/dev/null 2>&1 +rm *.par2 >/dev/null 2>&1 +rm *.sample >/dev/null 2>&1 +rm *.sample.* >/dev/null 2>&1 +rm *.srs >/dev/null 2>&1 +rm *.url >/dev/null 2>&1 +rm *.idx >/dev/null 2>&1 +rm *.sub >/dev/null 2>&1 +rm *.info >/dev/null 2>&1 +rm *.md5 >/dev/null 2>&1 if [ "$Unrared" -eq 1 ]; then # Delete par2-file only if there were files for unpacking. rm *.[pP][aA][rR]2 >/dev/null 2>&1 From d880ae8b9cc466fc57ce216847e6a1c0ada4b420 Mon Sep 17 00:00:00 2001 From: schumi2004 Date: Fri, 7 Dec 2012 14:50:47 +0100 Subject: [PATCH 3/7] Modify clean up list from GUI --- .../9.0/bin/nzbget-postprocess.sh | 27 +++---------------- .../9.0/webui/nzbget-postprocess.conf | 2 ++ 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh index 51993ae4..1bfd7d4b 100644 --- a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh +++ b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh @@ -304,31 +304,10 @@ fi # Clean up echo "[INFO] Post-Process: Cleaning up" chmod -R a+rw . -rm *.nzb >/dev/null 2>&1 -rm *.sfv >/dev/null 2>&1 -rm *.1 >/dev/null 2>&1 +# Clean up list, space seperated from GUI +rm $CLEANUPEXT >/dev/null 2>&1 +# Removed by default rm _brokenlog.txt >/dev/null 2>&1 -# Extra clean up items -rm *.nfo >/dev/null 2>&1 -rm *.srr >/dev/null 2>&1 -rm *.srs >/dev/null 2>&1 -rm *.tbn >/dev/null 2>&1 -rm *.html >/dev/null 2>&1 -rm *.bat >/dev/null 2>&1 -rm *.htm >/dev/null 2>&1 -rm *.txt >/dev/null 2>&1 -rm *.png >/dev/null 2>&1 -rm *.exe >/dev/null 2>&1 -rm *.jpg >/dev/null 2>&1 -rm *.par2 >/dev/null 2>&1 -rm *.sample >/dev/null 2>&1 -rm *.sample.* >/dev/null 2>&1 -rm *.srs >/dev/null 2>&1 -rm *.url >/dev/null 2>&1 -rm *.idx >/dev/null 2>&1 -rm *.sub >/dev/null 2>&1 -rm *.info >/dev/null 2>&1 -rm *.md5 >/dev/null 2>&1 if [ "$Unrared" -eq 1 ]; then # Delete par2-file only if there were files for unpacking. rm *.[pP][aA][rR]2 >/dev/null 2>&1 diff --git a/nzbget-postprocessing-files/9.0/webui/nzbget-postprocess.conf b/nzbget-postprocessing-files/9.0/webui/nzbget-postprocess.conf index af6d01c2..a05b1d69 100644 --- a/nzbget-postprocessing-files/9.0/webui/nzbget-postprocess.conf +++ b/nzbget-postprocessing-files/9.0/webui/nzbget-postprocess.conf @@ -70,6 +70,8 @@ CouchPotato=yes # Category for Couchpotato's postprocessing. CouchPotatoCategory=movies +# Clean up list. (space seperated, default *.nzb *.sfv *.1) +CLAUNUPEXT=*.nzb *.sfv *.1 ############################################################################## ### POSTPROCESSING-PARAMETERS ### From 67dfcc5b136c14a65b174c13ebe1c3b38254b646 Mon Sep 17 00:00:00 2001 From: schumi2004 Date: Fri, 7 Dec 2012 15:55:23 +0100 Subject: [PATCH 4/7] Fix GUI cosmetics for clean up --- nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh | 2 +- nzbget-postprocessing-files/9.0/webui/nzbget-postprocess.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh index 1bfd7d4b..5505b444 100644 --- a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh +++ b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh @@ -305,7 +305,7 @@ fi echo "[INFO] Post-Process: Cleaning up" chmod -R a+rw . # Clean up list, space seperated from GUI -rm $CLEANUPEXT >/dev/null 2>&1 +rm $FileCleanUp >/dev/null 2>&1 # Removed by default rm _brokenlog.txt >/dev/null 2>&1 if [ "$Unrared" -eq 1 ]; then diff --git a/nzbget-postprocessing-files/9.0/webui/nzbget-postprocess.conf b/nzbget-postprocessing-files/9.0/webui/nzbget-postprocess.conf index a05b1d69..0549cba0 100644 --- a/nzbget-postprocessing-files/9.0/webui/nzbget-postprocess.conf +++ b/nzbget-postprocessing-files/9.0/webui/nzbget-postprocess.conf @@ -71,7 +71,7 @@ CouchPotato=yes CouchPotatoCategory=movies # Clean up list. (space seperated, default *.nzb *.sfv *.1) -CLAUNUPEXT=*.nzb *.sfv *.1 +FileCleanUp=*.nzb *.sfv *.1 ############################################################################## ### POSTPROCESSING-PARAMETERS ### From 3ea619634ee0a879392878f7cbd5e9677c7230ba Mon Sep 17 00:00:00 2001 From: schumi2004 Date: Sat, 8 Dec 2012 10:07:00 +0100 Subject: [PATCH 5/7] Update autoProcessTV.py --- autoProcessTV.py | 214 +++++++++++++++++++++++------------------------ 1 file changed, 105 insertions(+), 109 deletions(-) diff --git a/autoProcessTV.py b/autoProcessTV.py index acfca15a..7593c01d 100644 --- a/autoProcessTV.py +++ b/autoProcessTV.py @@ -1,109 +1,105 @@ -# Author: Nic Wolfe -# URL: http://code.google.com/p/sickbeard/ -# -# This file is part of Sick Beard. -# -# Sick Beard is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Sick Beard is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Sick Beard. If not, see . - - -import sys -import urllib -import os.path -import ConfigParser - -class AuthURLOpener(urllib.FancyURLopener): - def __init__(self, user, pw): - self.username = user - self.password = pw - self.numTries = 0 - urllib.FancyURLopener.__init__(self) - - def prompt_user_passwd(self, host, realm): - if self.numTries == 0: - self.numTries = 1 - return (self.username, self.password) - else: - return ('', '') - - def openit(self, url): - self.numTries = 0 - return urllib.FancyURLopener.open(self, url) - - -def processEpisode(dirName, nzbName=None, status=0): - - status = int(status) - if status > 0: - print "the download failed. nothing to process" - sys.exit() - - config = ConfigParser.ConfigParser() - configFilename = os.path.join(os.path.dirname(sys.argv[0]), "autoProcessTV.cfg") - print "Loading config from", configFilename - - if not os.path.isfile(configFilename): - print "ERROR: You need an autoProcessTV.cfg file - did you rename and edit the .sample?" - sys.exit(-1) - - try: - fp = open(configFilename, "r") - config.readfp(fp) - fp.close() - except IOError, e: - print "Could not read configuration file: ", str(e) - sys.exit(1) - - host = config.get("SickBeard", "host") - port = config.get("SickBeard", "port") - username = config.get("SickBeard", "username") - password = config.get("SickBeard", "password") - try: - ssl = int(config.get("SickBeard", "ssl")) - except (ConfigParser.NoOptionError, ValueError): - ssl = 0 - - try: - web_root = config.get("SickBeard", "web_root") - except ConfigParser.NoOptionError: - web_root = "" - - params = {} - - params['quiet'] = 1 - - params['dir'] = dirName - if nzbName != None: - params['nzbName'] = nzbName - - myOpener = AuthURLOpener(username, password) - - if ssl: - protocol = "https://" - else: - protocol = "http://" - - url = protocol + host + ":" + port + web_root + "/home/postprocess/processEpisode?" + urllib.urlencode(params) - - print "Opening URL:", url - - try: - urlObj = myOpener.openit(url) - except IOError, e: - print "Unable to open URL: ", str(e) - sys.exit(1) - - result = urlObj.readlines() - for line in result: - print line - +# Author: Nic Wolfe +# URL: http://code.google.com/p/sickbeard/ +# +# This file is part of Sick Beard. +# +# Sick Beard is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Sick Beard is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Sick Beard. If not, see . + + +import sys +import urllib +import os.path +import ConfigParser + +class AuthURLOpener(urllib.FancyURLopener): + def __init__(self, user, pw): + self.username = user + self.password = pw + self.numTries = 0 + urllib.FancyURLopener.__init__(self) + + def prompt_user_passwd(self, host, realm): + if self.numTries == 0: + self.numTries = 1 + return (self.username, self.password) + else: + return ('', '') + + def openit(self, url): + self.numTries = 0 + return urllib.FancyURLopener.open(self, url) + + +def processEpisode(dirName, nzbName=None, failed=False): + config = ConfigParser.ConfigParser() + configFilename = os.path.join(os.path.dirname(sys.argv[0]), "autoProcessTV.cfg") + print "Loading config from", configFilename + + if not os.path.isfile(configFilename): + print "ERROR: You need an autoProcessTV.cfg file - did you rename and edit the .sample?" + sys.exit(-1) + + try: + fp = open(configFilename, "r") + config.readfp(fp) + fp.close() + except IOError, e: + print "Could not read configuration file: ", str(e) + sys.exit(1) + + host = config.get("SickBeard", "host") + port = config.get("SickBeard", "port") + username = config.get("SickBeard", "username") + password = config.get("SickBeard", "password") + try: + ssl = int(config.get("SickBeard", "ssl")) + except (ConfigParser.NoOptionError, ValueError): + ssl = 0 + + try: + web_root = config.get("SickBeard", "web_root") + except ConfigParser.NoOptionError: + web_root = "" + + params = {} + + params['quiet'] = 1 + + params['dirName'] = dirName + if nzbName != None: + params['nzbName'] = nzbName + + params['failed'] = failed + + myOpener = AuthURLOpener(username, password) + + if ssl: + protocol = "https://" + else: + protocol = "http://" + + url = protocol + host + ":" + port + web_root + "/home/postprocess/processEpisode?" + urllib.urlencode(params) + + print "Opening URL:", url + + try: + urlObj = myOpener.openit(url) + except IOError, e: + print "Unable to open URL: ", str(e) + sys.exit(1) + + result = urlObj.readlines() + for line in result: + print line + From 1d6cf8e1d83a41fc155a5ba72971994698b72944 Mon Sep 17 00:00:00 2001 From: schumi2004 Date: Sat, 8 Dec 2012 22:56:56 +0100 Subject: [PATCH 6/7] Cosmetic and Typo changes --- .../9.0/bin/nzbget-postprocess.sh | 16 ++++++++-------- .../9.0/webui/nzbget-postprocess.conf | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh index 5505b444..22db89de 100644 --- a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh +++ b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh @@ -343,30 +343,30 @@ fi # Move categories to /share/yourdirectory and remove download destination directory if [ "$NZBPP_CATEGORY" = "$SickBeardCategory" ]; then - echo "[INFO] Post-Process: Moving TV shows to $TV_DL_DIR" - cp -R "$NZBPP_DIRECTORY" "$TV_DL_DIR" >/dev/null 2>&1 + echo "[INFO] Post-Process: Moving TV shows to $TvDownloadDir" + cp -R "$NZBPP_DIRECTORY" "$TvDownloadDir" >/dev/null 2>&1 if [ "$?" -ne 0 ]; then - echo "[ERROR] Post-Process: Moving to $TV_DL_DIR" + echo "[ERROR] Post-Process: Moving to $TvDownloadDir" exit $POSTPROCESS_ERROR else rm -fr * cd .. rmdir "$NZBPP_DIRECTORY" - NZBPP_DIRECTORY="$TV_DL_DIR" + NZBPP_DIRECTORY="$TvDownloadDir" fi fi if [ "$NZBPP_CATEGORY" = "$CouchPotatoCategory" ]; then - echo "[INFO] Post-Process: Moving Movies to $MOVIES_DL_DIR" - cp -R "$NZBPP_DIRECTORY" "$MOVIES_DL_DIR" >/dev/null 2>&1 + echo "[INFO] Post-Process: Moving Movies to $MoviesDownloadDir" + cp -R "$NZBPP_DIRECTORY" "$MoviesDownloadDir" >/dev/null 2>&1 if [ "$?" -ne 0 ]; then - echo "[ERROR] Post-Process: Moving to $MOVIES_DL_DIR" + echo "[ERROR] Post-Process: Moving to $MoviesDownloadDir" exit $POSTPROCESS_ERROR else rm -fr * cd .. rmdir "$NZBPP_DIRECTORY" - NZBPP_DIRECTORY="$MOVIES_DL_DIR" + NZBPP_DIRECTORY="$MoviesDownloadDir" fi fi diff --git a/nzbget-postprocessing-files/9.0/webui/nzbget-postprocess.conf b/nzbget-postprocessing-files/9.0/webui/nzbget-postprocess.conf index 0549cba0..61722981 100644 --- a/nzbget-postprocessing-files/9.0/webui/nzbget-postprocess.conf +++ b/nzbget-postprocessing-files/9.0/webui/nzbget-postprocess.conf @@ -36,15 +36,15 @@ PythonCmd=/usr/local/python/bin/python NzbToSickBeard=/usr/local/nzbget/var/nzbToSickBeard.py # Set the full path where completed movies should be placed -# before CouchPotato's Renamer is called -TV_DL_DIR=/usr/local/nzbget/complete/tv +# before SickBeard's Renamer is called +TvDownloadDir=/usr/local/nzbget/complete/tv # Set the full path to nzbToCouchpotato.py for Couchpotato's postprocessing NzbToCouchPotato=/usr/local/nzbget/var/nzbToCouchPotato.py # Set the full path where completed movies should be placed # before CouchPotato's Renamer is called -MOVIES_DL_DIR=/usr/local/nzbget/complete/movies +MoviesDownloadDir=/usr/local/nzbget/complete/movies ############################################################################## ### OPTIONS ### From 954149b55118bfe89f2cf982677df707ac5b5691 Mon Sep 17 00:00:00 2001 From: schumi2004 Date: Sat, 8 Dec 2012 23:04:23 +0100 Subject: [PATCH 7/7] Disable SickBeard Fail check --- .../9.0/bin/nzbget-postprocess.sh | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh index 22db89de..cb1eb1b9 100644 --- a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh +++ b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh @@ -165,11 +165,12 @@ if [ "$NZBPP_PARSTATUS" -eq 1 -o "$NZBPP_PARSTATUS" -eq 3 -o "$NZBPP_PARFAILED" else echo "[WARNING] Post-Process: Par-check failed, exiting" # Send notifications to SickBeard or CouchPotato that Par-check failed - if [ "$SickBeard" = "yes" -a "$NZBPP_CATEGORY" = "$SickBeardCategory" -a -e "$SabToSickBeard" ]; then - # Call SickBeard's postprocessing script - echo "[INFO] Post-Process: Running SickBeard's postprocessing script to notify Par-check failed" - $PythonCmd $SabToSickBeard "$NZBPP_DIRECTORY" "$NZBPP_NZBFILENAME" "" "" "" "" "1" >/dev/null 2>&1 - fi + # Uncomment if SickBeard Branch is fixed + #if [ "$SickBeard" = "yes" -a "$NZBPP_CATEGORY" = "$SickBeardCategory" -a -e "$SabToSickBeard" ]; then + # # Call SickBeard's postprocessing script + # echo "[INFO] Post-Process: Running SickBeard's postprocessing script to notify Par-check failed" + #$PythonCmd $SabToSickBeard "$NZBPP_DIRECTORY" "$NZBPP_NZBFILENAME" "" "" "" "" "1" >/dev/null 2>&1 + #fi if [ "$CouchPotato" = "yes" -a "$NZBPP_CATEGORY" = "$CouchPotatoCategory" -a -e "$nzbToCouchPotato" ]; then # Call CouchPotato's postprocessing script echo "[INFO] Post-Process: Running CouchPotato's postprocessing script to notify Par-check failed" @@ -238,11 +239,12 @@ if (ls *.rar >/dev/null 2>&1); then echo "[INFO] Post-Process: Requesting par-repair" exit $POSTPROCESS_PARCHECK_ALL # Send notifications to SickBeard or CouchPotato that unrar (second pass) failed - if [ "$SickBeard" = "yes" -a "$NZBPP_CATEGORY" = "$SickBeardCategory" -a -e "$SabToSickBeard" ]; then - # Call SickBeard's postprocessing script - echo "[INFO] Post-Process: Running SickBeard's postprocessing script to notify unrar (second pass) failed" - $PythonCmd $SabToSickBeard "$NZBPP_DIRECTORY" "$NZBPP_NZBFILENAME" "" "" "" "" "1">/dev/null 2>&1 - fi + # Uncomment if SickBeard Branch is fixed + #if [ "$SickBeard" = "yes" -a "$NZBPP_CATEGORY" = "$SickBeardCategory" -a -e "$SabToSickBeard" ]; then + # # Call SickBeard's postprocessing script + # echo "[INFO] Post-Process: Running SickBeard's postprocessing script to notify unrar (second pass) failed" + # $PythonCmd $SabToSickBeard "$NZBPP_DIRECTORY" "$NZBPP_NZBFILENAME" "" "" "" "" "1">/dev/null 2>&1 + #fi if [ "$CouchPotato" = "yes" -a "$NZBPP_CATEGORY" = "$CouchPotatoCategory" -a -e "$nzbToCouchPotato" ]; then # Call CouchPotato's postprocessing script echo "[INFO] Post-Process: Running CouchPotato's postprocessing script to notify unrar (second pass) failed"