mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-16 02:02:53 -07:00
Too broad exceptions.
* Use .get() with default value instead.
This commit is contained in:
parent
1cd073cd52
commit
df8c6bc20f
4 changed files with 37 additions and 129 deletions
|
@ -16,11 +16,10 @@ def external_script(outputDestination, torrentName, torrentLabel, settings):
|
|||
core.USER_SCRIPT_MEDIAEXTENSIONS = core.USER_SCRIPT_MEDIAEXTENSIONS.split(',')
|
||||
except:
|
||||
core.USER_SCRIPT_MEDIAEXTENSIONS = []
|
||||
try:
|
||||
core.USER_SCRIPT = settings["user_script_path"]
|
||||
except:
|
||||
core.USER_SCRIPT = None
|
||||
if core.USER_SCRIPT is None or core.USER_SCRIPT == "None": # do nothing and return success.
|
||||
|
||||
core.USER_SCRIPT = settings.get("user_script_path")
|
||||
|
||||
if not core.USER_SCRIPT or core.USER_SCRIPT == "None": # do nothing and return success.
|
||||
return [0, ""]
|
||||
try:
|
||||
core.USER_SCRIPT_PARAM = settings["user_script_param"]
|
||||
|
@ -34,14 +33,9 @@ def external_script(outputDestination, torrentName, torrentLabel, settings):
|
|||
core.USER_SCRIPT_SUCCESSCODES = core.USER_SCRIPT_SUCCESSCODES.split(',')
|
||||
except:
|
||||
core.USER_SCRIPT_SUCCESSCODES = 0
|
||||
try:
|
||||
core.USER_SCRIPT_CLEAN = int(settings["user_script_clean"])
|
||||
except:
|
||||
core.USER_SCRIPT_CLEAN = 1
|
||||
try:
|
||||
core.USER_SCRIPT_RUNONCE = int(settings["user_script_runOnce"])
|
||||
except:
|
||||
core.USER_SCRIPT_RUNONCE = 1
|
||||
|
||||
core.USER_SCRIPT_CLEAN = int(settings.get("user_script_clean", 1))
|
||||
core.USER_SCRIPT_RUNONCE = int(settings.get("user_script_runOnce", 1))
|
||||
|
||||
if core.CHECK_MEDIA:
|
||||
for video in listMediaFiles(outputDestination, media=True, audio=False, meta=False, archives=False):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue