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
|
autoProcessMedia.cfg
|
||||||
|
logging.cfg
|
||||||
|
|
||||||
*.pyc
|
*.pyc
|
||||||
*.pyo
|
*.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':
|
if os.environ['NZBOP_UNPACK'] != 'yes':
|
||||||
print "Please enable option \"Unpack\" in nzbget configuration file, exiting."
|
print "Please enable option \"Unpack\" in nzbget configuration file, exiting."
|
||||||
sys.exit(config().POSTPROCESS_ERROR)
|
sys.exit(config.NZBGET_POSTPROCESS_ERROR)
|
||||||
|
|
||||||
# Check par status
|
# Check par status
|
||||||
if os.environ['NZBPP_PARSTATUS'] == '3':
|
if os.environ['NZBPP_PARSTATUS'] == '3':
|
||||||
print "Par-check successful, but Par-repair disabled, exiting."
|
print "Par-check successful, but Par-repair disabled, exiting."
|
||||||
print "Please check your Par-repair settings for future downloads."
|
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':
|
if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_PARSTATUS'] == '4':
|
||||||
print "Par-repair failed, setting status \"failed\"."
|
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.
|
# All checks done, now launching the script.
|
||||||
|
|
||||||
if status == 1:
|
if status == 1:
|
||||||
sys.exit(config().POSTPROCESS_NONE)
|
sys.exit(config.NZBGET_POSTPROCESS_NONE)
|
||||||
|
|
||||||
mediaContainer = os.environ['NZBPO_MEDIAEXTENSIONS'].split(',')
|
mediaContainer = os.environ['NZBPO_MEDIAEXTENSIONS'].split(',')
|
||||||
SampleIDs = os.environ['NZBPO_SAMPLEIDS'].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)
|
os.unlink(filePath)
|
||||||
except:
|
except:
|
||||||
print "Error: unable to delete file", filePath
|
print "Error: unable to delete file", filePath
|
||||||
sys.exit(config().POSTPROCESS_ERROR)
|
sys.exit(config.NZBGET_POSTPROCESS_ERROR)
|
||||||
sys.exit(config().POSTPROCESS_SUCCESS)
|
sys.exit(config.NZBGET_POSTPROCESS_SUCCESS)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print "This script can only be called from NZBGet (11.0 or later)."
|
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':
|
if os.environ['NZBOP_UNPACK'] != 'yes':
|
||||||
print "Please enable option \"Unpack\" in nzbget configuration file, exiting."
|
print "Please enable option \"Unpack\" in nzbget configuration file, exiting."
|
||||||
sys.exit(config().POSTPROCESS_ERROR)
|
sys.exit(config.NZBGET_POSTPROCESS_ERROR)
|
||||||
|
|
||||||
# Check par status
|
# Check par status
|
||||||
if os.environ['NZBPP_PARSTATUS'] == '3':
|
if os.environ['NZBPP_PARSTATUS'] == '3':
|
||||||
print "Par-check successful, but Par-repair disabled, exiting."
|
print "Par-check successful, but Par-repair disabled, exiting."
|
||||||
print "Please check your Par-repair settings for future downloads."
|
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':
|
if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ['NZBPP_PARSTATUS'] == '4':
|
||||||
print "Par-repair failed, setting status \"failed\"."
|
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.
|
# All checks done, now launching the script.
|
||||||
|
|
||||||
if status == 1:
|
if status == 1:
|
||||||
sys.exit(config().POSTPROCESS_NONE)
|
sys.exit(config.NZBGET_POSTPROCESS_NONE)
|
||||||
|
|
||||||
directory = os.path.normpath(os.environ['NZBPP_DIRECTORY'])
|
directory = os.path.normpath(os.environ['NZBPP_DIRECTORY'])
|
||||||
for dirpath, dirnames, filenames in os.walk(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
|
continue
|
||||||
except:
|
except:
|
||||||
print "Error: unable to reset time for file", file
|
print "Error: unable to reset time for file", file
|
||||||
sys.exit(config().POSTPROCESS_ERROR)
|
sys.exit(config.NZBGET_POSTPROCESS_ERROR)
|
||||||
sys.exit(config().POSTPROCESS_SUCCESS)
|
sys.exit(config.NZBGET_POSTPROCESS_SUCCESS)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print "This script can only be called from NZBGet (11.0 or later)."
|
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.
|
# SickBeard script category.
|
||||||
#
|
#
|
||||||
# category that gets called for post-processing with SickBeard.
|
# category that gets called for post-processing with SickBeard.
|
||||||
#config().sbCategory=tv
|
#sbCategory=tv
|
||||||
|
|
||||||
# SickBeard host.
|
# SickBeard host.
|
||||||
#sbhost=localhost
|
#sbhost=localhost
|
||||||
|
|
|
@ -133,62 +133,71 @@ class migratecfg:
|
||||||
envCatKey = 'NZBPO_CPSCATEGORY'
|
envCatKey = 'NZBPO_CPSCATEGORY'
|
||||||
envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT', 'DELAY', 'METHOD', 'DELETE_FAILED', 'REMOTECPS', 'WAIT_FOR', 'TIMEPERGIB']
|
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']
|
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)):
|
for index in range(len(envKeys)):
|
||||||
key = 'NZBPO_CPS' + envKeys[index]
|
key = 'NZBPO_CPS' + envKeys[index]
|
||||||
if os.environ.has_key(key):
|
if os.environ.has_key(key):
|
||||||
option = cfgKeys[index]
|
option = cfgKeys[index]
|
||||||
value = os.environ[key]
|
value = os.environ[key]
|
||||||
if os.environ[envCatKey] in confignew[section].sections:
|
if os.environ[envCatKey] not in confignew[section].sections:
|
||||||
confignew[section][envCatKey][option] = value
|
confignew[section][os.environ[envCatKey]] = {}
|
||||||
|
confignew[section][os.environ[envCatKey]][option] = value
|
||||||
|
|
||||||
section = "SickBeard"
|
section = "SickBeard"
|
||||||
envCatKey = 'NZBPO_SBCATEGORY'
|
envCatKey = 'NZBPO_SBCATEGORY'
|
||||||
envKeys = ['HOST', 'PORT', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT', 'WATCH_DIR', 'FORK', 'DELETE_FAILED', 'DELAY', 'TIMEPERGIB', 'PROCESS_METHOD']
|
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']
|
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)):
|
for index in range(len(envKeys)):
|
||||||
key = 'NZBPO_SB' + envKeys[index]
|
key = 'NZBPO_SB' + envKeys[index]
|
||||||
if os.environ.has_key(key):
|
if os.environ.has_key(key):
|
||||||
option = cfgKeys[index]
|
option = cfgKeys[index]
|
||||||
value = os.environ[key]
|
value = os.environ[key]
|
||||||
if os.environ[envCatKey] in confignew[section].sections:
|
if os.environ[envCatKey] not in confignew[section].sections:
|
||||||
confignew[section][envCatKey][option] = value
|
confignew[section][os.environ[envCatKey]] = {}
|
||||||
|
confignew[section][os.environ[envCatKey]][option] = value
|
||||||
|
|
||||||
section = "HeadPhones"
|
section = "HeadPhones"
|
||||||
envCatKey = 'NZBPO_HPCATEGORY'
|
envCatKey = 'NZBPO_HPCATEGORY'
|
||||||
envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT', 'DELAY', 'TIMEPERGIB']
|
envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT', 'DELAY', 'TIMEPERGIB']
|
||||||
cfgKeys = ['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)):
|
for index in range(len(envKeys)):
|
||||||
key = 'NZBPO_HP' + envKeys[index]
|
key = 'NZBPO_HP' + envKeys[index]
|
||||||
if os.environ.has_key(key):
|
if os.environ.has_key(key):
|
||||||
option = cfgKeys[index]
|
option = cfgKeys[index]
|
||||||
value = os.environ[key]
|
value = os.environ[key]
|
||||||
if os.environ[envCatKey] in confignew[section].sections:
|
if os.environ[envCatKey] not in confignew[section].sections:
|
||||||
confignew[section][envCatKey][option] = value
|
confignew[section][os.environ[envCatKey]] = {}
|
||||||
|
confignew[section][os.environ[envCatKey]][option] = value
|
||||||
|
|
||||||
section = "Mylar"
|
section = "Mylar"
|
||||||
envCatKey = 'NZBPO_MYCATEGORY'
|
envCatKey = 'NZBPO_MYCATEGORY'
|
||||||
envKeys = ['HOST', 'PORT', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT']
|
envKeys = ['HOST', 'PORT', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT']
|
||||||
cfgKeys = ['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)):
|
for index in range(len(envKeys)):
|
||||||
key = 'NZBPO_MY' + envKeys[index]
|
key = 'NZBPO_MY' + envKeys[index]
|
||||||
if os.environ.has_key(key):
|
if os.environ.has_key(key):
|
||||||
option = cfgKeys[index]
|
option = cfgKeys[index]
|
||||||
value = os.environ[key]
|
value = os.environ[key]
|
||||||
if os.environ[envCatKey] in confignew[section].sections:
|
if os.environ[envCatKey] not in confignew[section].sections:
|
||||||
confignew[section][envCatKey][option] = value
|
confignew[section][os.environ[envCatKey]] = {}
|
||||||
|
confignew[section][os.environ[envCatKey]][option] = value
|
||||||
|
|
||||||
section = "Gamez"
|
section = "Gamez"
|
||||||
envCatKey = 'NZBPO_GZCATEGORY'
|
envCatKey = 'NZBPO_GZCATEGORY'
|
||||||
envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT']
|
envKeys = ['APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT']
|
||||||
cfgKeys = ['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)):
|
for index in range(len(envKeys)):
|
||||||
key = 'NZBPO_GZ' + envKeys[index]
|
key = 'NZBPO_GZ' + envKeys[index]
|
||||||
if os.environ.has_key(key):
|
if os.environ.has_key(key):
|
||||||
option = cfgKeys[index]
|
option = cfgKeys[index]
|
||||||
value = os.environ[key]
|
value = os.environ[key]
|
||||||
if os.environ[envCatKey] in confignew[section].sections:
|
if os.environ[envCatKey] not in confignew[section].sections:
|
||||||
confignew[section][envCatKey][option] = value
|
confignew[section][os.environ[envCatKey]] = {}
|
||||||
|
confignew[section][os.environ[envCatKey]][option] = value
|
||||||
|
|
||||||
section = "Extensions"
|
section = "Extensions"
|
||||||
envKeys = ['COMPRESSEDEXTENSIONS', 'MEDIAEXTENSIONS', 'METAEXTENSIONS']
|
envKeys = ['COMPRESSEDEXTENSIONS', 'MEDIAEXTENSIONS', 'METAEXTENSIONS']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue