mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 22:03:13 -07:00
Dev branch fixes
This commit is contained in:
commit
2791139c6b
5 changed files with 57 additions and 47 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
autoProcessMedia.cfg
|
||||
logging.cfg
|
||||
|
||||
*.pyc
|
||||
*.pyo
|
||||
|
|
10
DeleteSamples.py
Normal file → Executable file
10
DeleteSamples.py
Normal file → Executable file
|
@ -62,13 +62,13 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
|
|||
|
||||
if os.environ['NZBOP_UNPACK'] != 'yes':
|
||||
print "Please enable option \"Unpack\" in nzbget configuration file, exiting."
|
||||
sys.exit(config().POSTPROCESS_ERROR)
|
||||
sys.exit(config.NZBGET_POSTPROCESS_ERROR)
|
||||
|
||||
# Check par status
|
||||
if os.environ['NZBPP_PARSTATUS'] == '3':
|
||||
print "Par-check successful, but Par-repair disabled, exiting."
|
||||
print "Please check your Par-repair settings for future downloads."
|
||||
sys.exit(config().POSTPROCESS_NONE)
|
||||
sys.exit(config.NZBGET_POSTPROCESS_NONE)
|
||||
|
||||
if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_PARSTATUS'] == '4':
|
||||
print "Par-repair failed, setting status \"failed\"."
|
||||
|
@ -99,7 +99,7 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
|
|||
# All checks done, now launching the script.
|
||||
|
||||
if status == 1:
|
||||
sys.exit(config().POSTPROCESS_NONE)
|
||||
sys.exit(config.NZBGET_POSTPROCESS_NONE)
|
||||
|
||||
mediaContainer = os.environ['NZBPO_MEDIAEXTENSIONS'].split(',')
|
||||
SampleIDs = os.environ['NZBPO_SAMPLEIDS'].split(',')
|
||||
|
@ -116,8 +116,8 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
|
|||
os.unlink(filePath)
|
||||
except:
|
||||
print "Error: unable to delete file", filePath
|
||||
sys.exit(config().POSTPROCESS_ERROR)
|
||||
sys.exit(config().POSTPROCESS_SUCCESS)
|
||||
sys.exit(config.NZBGET_POSTPROCESS_ERROR)
|
||||
sys.exit(config.NZBGET_POSTPROCESS_SUCCESS)
|
||||
|
||||
else:
|
||||
print "This script can only be called from NZBGet (11.0 or later)."
|
||||
|
|
10
ResetDateTime.py
Normal file → Executable file
10
ResetDateTime.py
Normal file → Executable file
|
@ -29,13 +29,13 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
|
|||
|
||||
if os.environ['NZBOP_UNPACK'] != 'yes':
|
||||
print "Please enable option \"Unpack\" in nzbget configuration file, exiting."
|
||||
sys.exit(config().POSTPROCESS_ERROR)
|
||||
sys.exit(config.NZBGET_POSTPROCESS_ERROR)
|
||||
|
||||
# Check par status
|
||||
if os.environ['NZBPP_PARSTATUS'] == '3':
|
||||
print "Par-check successful, but Par-repair disabled, exiting."
|
||||
print "Please check your Par-repair settings for future downloads."
|
||||
sys.exit(config().POSTPROCESS_NONE)
|
||||
sys.exit(config.NZBGET_POSTPROCESS_NONE)
|
||||
|
||||
if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_PARSTATUS'] == '4':
|
||||
print "Par-repair failed, setting status \"failed\"."
|
||||
|
@ -66,7 +66,7 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
|
|||
# All checks done, now launching the script.
|
||||
|
||||
if status == 1:
|
||||
sys.exit(config().POSTPROCESS_NONE)
|
||||
sys.exit(config.NZBGET_POSTPROCESS_NONE)
|
||||
|
||||
directory = os.path.normpath(os.environ['NZBPP_DIRECTORY'])
|
||||
for dirpath, dirnames, filenames in os.walk(directory):
|
||||
|
@ -78,8 +78,8 @@ if os.environ.has_key('NZBOP_SCRIPTDIR') and not os.environ['NZBOP_VERSION'][0:5
|
|||
continue
|
||||
except:
|
||||
print "Error: unable to reset time for file", file
|
||||
sys.exit(config().POSTPROCESS_ERROR)
|
||||
sys.exit(config().POSTPROCESS_SUCCESS)
|
||||
sys.exit(config.NZBGET_POSTPROCESS_ERROR)
|
||||
sys.exit(config.NZBGET_POSTPROCESS_SUCCESS)
|
||||
|
||||
else:
|
||||
print "This script can only be called from NZBGet (11.0 or later)."
|
||||
|
|
|
@ -79,7 +79,7 @@ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib'
|
|||
# SickBeard script category.
|
||||
#
|
||||
# category that gets called for post-processing with SickBeard.
|
||||
#config().sbCategory=tv
|
||||
#sbCategory=tv
|
||||
|
||||
# SickBeard host.
|
||||
#sbhost=localhost
|
||||
|
|
|
@ -133,62 +133,71 @@ class migratecfg:
|
|||
envCatKey = 'NZBPO_CPSCATEGORY'
|
||||
envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT', 'DELAY', 'METHOD', 'DELETE_FAILED', 'REMOTECPS', 'WAIT_FOR', 'TIMEPERGIB']
|
||||
cfgKeys = ['apikey', 'host', 'port', 'ssl', 'web_root', 'delay', 'method', 'delete_failed', 'remoteCPS', 'wait_for', 'TimePerGiB']
|
||||
if os.environ.has_key(envCatKey):
|
||||
for index in range(len(envKeys)):
|
||||
key = 'NZBPO_CPS' + envKeys[index]
|
||||
if os.environ.has_key(key):
|
||||
option = cfgKeys[index]
|
||||
value = os.environ[key]
|
||||
if os.environ[envCatKey] in confignew[section].sections:
|
||||
confignew[section][envCatKey][option] = value
|
||||
|
||||
if os.environ[envCatKey] not in confignew[section].sections:
|
||||
confignew[section][os.environ[envCatKey]] = {}
|
||||
confignew[section][os.environ[envCatKey]][option] = value
|
||||
|
||||
section = "SickBeard"
|
||||
envCatKey = 'NZBPO_SBCATEGORY'
|
||||
envKeys = ['HOST', 'PORT', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED', 'DELAY', 'TIMEPERGIB', 'PROCESS_METHOD']
|
||||
cfgKeys = ['host', 'port', 'username', 'password', 'ssl', 'web_root', 'watch_dir', 'fork', 'delete_failed', 'delay', 'TimePerGiB', 'process_method']
|
||||
if os.environ.has_key(envCatKey):
|
||||
for index in range(len(envKeys)):
|
||||
key = 'NZBPO_SB' + envKeys[index]
|
||||
if os.environ.has_key(key):
|
||||
option = cfgKeys[index]
|
||||
value = os.environ[key]
|
||||
if os.environ[envCatKey] in confignew[section].sections:
|
||||
confignew[section][envCatKey][option] = value
|
||||
if os.environ[envCatKey] not in confignew[section].sections:
|
||||
confignew[section][os.environ[envCatKey]] = {}
|
||||
confignew[section][os.environ[envCatKey]][option] = value
|
||||
|
||||
section = "HeadPhones"
|
||||
envCatKey = 'NZBPO_HPCATEGORY'
|
||||
envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT', 'DELAY', 'TIMEPERGIB']
|
||||
cfgKeys = ['apikey', 'host', 'port', 'ssl', 'web_root', 'delay', 'TimePerGiB']
|
||||
if os.environ.has_key(envCatKey):
|
||||
for index in range(len(envKeys)):
|
||||
key = 'NZBPO_HP' + envKeys[index]
|
||||
if os.environ.has_key(key):
|
||||
option = cfgKeys[index]
|
||||
value = os.environ[key]
|
||||
if os.environ[envCatKey] in confignew[section].sections:
|
||||
confignew[section][envCatKey][option] = value
|
||||
if os.environ[envCatKey] not in confignew[section].sections:
|
||||
confignew[section][os.environ[envCatKey]] = {}
|
||||
confignew[section][os.environ[envCatKey]][option] = value
|
||||
|
||||
section = "Mylar"
|
||||
envCatKey = 'NZBPO_MYCATEGORY'
|
||||
envKeys = ['HOST', 'PORT', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT']
|
||||
cfgKeys = ['host', 'port', 'username', 'password', 'ssl', 'web_root']
|
||||
if os.environ.has_key(envCatKey):
|
||||
for index in range(len(envKeys)):
|
||||
key = 'NZBPO_MY' + envKeys[index]
|
||||
if os.environ.has_key(key):
|
||||
option = cfgKeys[index]
|
||||
value = os.environ[key]
|
||||
if os.environ[envCatKey] in confignew[section].sections:
|
||||
confignew[section][envCatKey][option] = value
|
||||
if os.environ[envCatKey] not in confignew[section].sections:
|
||||
confignew[section][os.environ[envCatKey]] = {}
|
||||
confignew[section][os.environ[envCatKey]][option] = value
|
||||
|
||||
section = "Gamez"
|
||||
envCatKey = 'NZBPO_GZCATEGORY'
|
||||
envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT']
|
||||
cfgKeys = ['apikey', 'host', 'port', 'ssl', 'web_root']
|
||||
if os.environ.has_key(envCatKey):
|
||||
for index in range(len(envKeys)):
|
||||
key = 'NZBPO_GZ' + envKeys[index]
|
||||
if os.environ.has_key(key):
|
||||
option = cfgKeys[index]
|
||||
value = os.environ[key]
|
||||
if os.environ[envCatKey] in confignew[section].sections:
|
||||
confignew[section][envCatKey][option] = value
|
||||
if os.environ[envCatKey] not in confignew[section].sections:
|
||||
confignew[section][os.environ[envCatKey]] = {}
|
||||
confignew[section][os.environ[envCatKey]][option] = value
|
||||
|
||||
section = "Extensions"
|
||||
envKeys = ['COMPRESSEDEXTENSIONS', 'MEDIAEXTENSIONS', 'METAEXTENSIONS']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue