Skip to content

Commit

Permalink
sickrage
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Higgins committed Mar 4, 2015
1 parent ba73dc3 commit 86458da
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
16 changes: 12 additions & 4 deletions NZBGetPostProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
#SONARR_CAT=Sonarr

# Category for Sickbeard
#SICK_CAT=Sickbeard
#SICKBEARD_CAT=Sickbeard

# Category for Sickrage
#SICKRAGE_CAT=Sickrage

# Category for bypassing any further processing but still converting
#BYPASS_CAT=Bypass
Expand All @@ -50,6 +53,7 @@
from mkvtomp4 import MkvtoMp4
import autoProcessMovie
import autoProcessTV
import autoProcessTVSR
except ImportError:
pass
print "[ERROR] Wrong path to sickbeard_mp4_automator: "+os.environ['NZBPO_MP4_FOLDER']
Expand All @@ -68,10 +72,11 @@

couchcat = os.environ['NZBPO_CP_CAT'].lower()
sonarrcat = os.environ['NZBPO_SONARR_CAT'].lower()
sickcat = os.environ['NZBPO_SICK_CAT'].lower()
sickcat = os.environ['NZBPO_BYPASS_CAT'].lower()
sickbeardcat = os.environ['NZBPO_SICKBEARD_CAT'].lower()
sickragecat = os.environ['NZBPO_SICKRAGE_CAT'].lower()
bypass = os.environ['NZBPO_BYPASS_CAT'].lower()

categories = [sickcat, couchcat, sonarrcat]
categories = [sickbeardcat, couchcat, sonarrcat, sickragecat, bypass]

# NZBGet argv: all passed as environment variables.
clientAgent = "nzbget"
Expand Down Expand Up @@ -208,6 +213,9 @@
sys.exit(POSTPROCESS_ERROR)
sys.exit(POSTPROCESS_SUCCESS)
elif (category.lower() == categories[3]):
#DEBUG#print "Sickrage Processing Activated"
autoProcessTVSR.processEpisode(path, settings, nzb)
elif (category.lower() == categories[4]):
#DEBUG#print "Bypass Further Processing"
pass

Expand Down
16 changes: 12 additions & 4 deletions SABPostProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os
import sys
import autoProcessTV, autoProcessMovie
import autoProcessTV, autoProcessMovie, autoProcessTVSR
from readSettings import ReadSettings
from mkvtomp4 import MkvtoMp4

Expand All @@ -16,7 +16,7 @@
# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2

settings = ReadSettings(os.path.dirname(sys.argv[0]), "autoProcess.ini")
categories = [settings.SAB['sb'], settings.SAB['cp'], settings.SAB['sonarr'], settings.SAB['bypass']]
categories = [settings.SAB['sb'], settings.SAB['cp'], settings.SAB['sonarr'], settings.SAB['sr'], settings.SAB['bypass']]
category = str(sys.argv[5]).lower()

if category.lower() not in categories:
Expand Down Expand Up @@ -63,8 +63,6 @@
except ImportError:
print "[ERROR] Python module REQUESTS is required. Install with 'pip install requests' then try again."
sys.exit()
elif (category == categories[3]):
print "Bypassing any further processing as per category"

host=settings.Sonarr['host']
port=settings.Sonarr['port']
Expand All @@ -89,4 +87,14 @@
print "[INFO] Sonarr responds as "+rstate['state']+"."
except:
print "[WARNING] Update to Sonarr failed, check if Sonarr is running, autoProcess.ini for errors, or check install of python modules requests."
elif (category == categories[3]):
if len(sys.argv) < 2:
print "No folder supplied - is this being called from SABnzbd?"
sys.exit()
elif len(sys.argv) >= 3:
autoProcessTVSR.processEpisode(path, settings, nzb)
else:
autoProcessTVSR.processEpisode(path, settings)
elif (category == categories[4]):
print "Bypassing any further processing as per category"

4 changes: 4 additions & 0 deletions readSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def __init__(self, directory, filename):
# Default uTorrent settings
utorrent_defaults = { 'couchpotato-label': 'couchpotato',
'sickbeard-label': 'sickbeard',
'sickrage-label': 'sickrage',
'sonarr-label': 'sonarr',
'bypass-label': 'bypass',
'convert': 'True',
Expand All @@ -88,6 +89,7 @@ def __init__(self, directory, filename):
# Default SAB settings
sab_defaults = { 'convert': 'True',
'Sickbeard-category': 'sickbeard',
'Sickrage-category': 'sickrage',
'Couchpotato-category': 'couchpotato',
'Sonarr-category': 'sonarr',
'Bypass-category': 'bypass' }
Expand Down Expand Up @@ -317,6 +319,7 @@ def __init__(self, directory, filename):
self.uTorrent = {}
self.uTorrent['cp'] = config.get(section, "couchpotato-label").lower()
self.uTorrent['sb'] = config.get(section, "sickbeard-label").lower()
self.uTorrent['sr'] = config.get(section, "sickrage-label").lower()
self.uTorrent['sonarr'] = config.get(section, "sonarr-label").lower()
self.uTorrent['bypass'] = config.get(section, "bypass-label").lower()
try:
Expand Down Expand Up @@ -358,6 +361,7 @@ def __init__(self, directory, filename):
self.SAB['convert'] = False
self.SAB['cp'] = config.get(section, "Couchpotato-category").lower()
self.SAB['sb'] = config.get(section, "Sickbeard-category").lower()
self.SAB['sr'] = config.get(section, "Sickrage-category").lower()
self.SAB['sonarr'] = config.get(section, "Sonarr-category").lower()
self.SAB['bypass'] = config.get(section, "Bypass-category").lower()

Expand Down

0 comments on commit 86458da

Please sign in to comment.