diff --git a/autoProcessMedia.cfg.spec b/autoProcessMedia.cfg.spec index 02992a4c..1a07534f 100644 --- a/autoProcessMedia.cfg.spec +++ b/autoProcessMedia.cfg.spec @@ -28,6 +28,8 @@ check_media = 1 # Enable/Disable a safety check to ensure we don't process all downloads in the default_downloadDirectories by mistake. safe_mode = 1 + # Turn this on to disable additional extraction attempts for failed downloads. Default = 0 will attempt to extract and verify if media is present. + no_extract_failed = 0 [Posix] ### Process priority setting for External commands (Extractor and Transcoder) on Posix (Unix/Linux/OSX) systems. diff --git a/core/__init__.py b/core/__init__.py index 21a1108e..e8b4e98e 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -100,6 +100,7 @@ GIT_BRANCH = None GIT_REPO = None FORCE_CLEAN = None SAFE_MODE = None +NOEXTRACTFAILED = None NZB_CLIENTAGENT = None SABNZBDHOST = None @@ -216,7 +217,7 @@ __INITIALIZED__ = False def initialize(section=None): global NZBGET_POSTPROCESS_ERROR, NZBGET_POSTPROCESS_NONE, NZBGET_POSTPROCESS_PARCHECK, NZBGET_POSTPROCESS_SUCCESS, \ - NZBTOMEDIA_TIMEOUT, FORKS, FORK_DEFAULT, FORK_FAILED_TORRENT, FORK_FAILED, \ + NZBTOMEDIA_TIMEOUT, FORKS, FORK_DEFAULT, FORK_FAILED_TORRENT, FORK_FAILED, NOEXTRACTFAILED, \ NZBTOMEDIA_BRANCH, NZBTOMEDIA_VERSION, NEWEST_VERSION, NEWEST_VERSION_STRING, VERSION_NOTIFY, SYS_ARGV, CFG, \ SABNZB_NO_OF_ARGUMENTS, SABNZB_0717_NO_OF_ARGUMENTS, CATEGORIES, TORRENT_CLIENTAGENT, USELINK, OUTPUTDIRECTORY, \ NOFLATTEN, UTORRENTPWD, UTORRENTUSR, UTORRENTWEBUI, DELUGEHOST, DELUGEPORT, DELUGEUSR, DELUGEPWD, VLEVEL, \ @@ -319,6 +320,7 @@ def initialize(section=None): FFMPEG_PATH = CFG["General"]["ffmpeg_path"] CHECK_MEDIA = int(CFG["General"]["check_media"]) SAFE_MODE = int(CFG["General"]["safe_mode"]) + NOEXTRACTFAILED = int(CFG["General"]["no_extract_failed"]) # Check for updates via GitHUB if versionCheck.CheckVersion().check_for_new_version(): diff --git a/core/autoProcess/autoProcessMovie.py b/core/autoProcess/autoProcessMovie.py index af2ca947..c60dd9ea 100644 --- a/core/autoProcess/autoProcessMovie.py +++ b/core/autoProcess/autoProcessMovie.py @@ -116,8 +116,12 @@ class autoProcessMovie(object): ssl = int(cfg.get("ssl", 0)) web_root = cfg.get("web_root", "") remote_path = int(cfg.get("remote_path", 0)) - extract = int(cfg.get("extract", 0)) protocol = "https://" if ssl else "http://" + status = int(status) + if status == 1 and core.NOEXTRACTFAILED: + extract = 0 + else: + extract = int(cfg.get("extract", 0)) baseURL = "{0}{1}:{2}{3}/api/{4}".format(protocol, host, port, web_root, apikey) if not server_responding(baseURL): @@ -163,7 +167,6 @@ class autoProcessMovie(object): good_files = 0 num_files = 0 # Check video files for corruption - status = int(status) for video in listMediaFiles(dirName, media=True, audio=False, meta=False, archives=False): num_files += 1 if transcoder.isVideoGood(video, status): diff --git a/core/autoProcess/autoProcessMusic.py b/core/autoProcess/autoProcessMusic.py index b4b93dbf..64c48173 100644 --- a/core/autoProcess/autoProcessMusic.py +++ b/core/autoProcess/autoProcessMusic.py @@ -51,8 +51,12 @@ class autoProcessMusic(object): ssl = int(cfg.get("ssl", 0)) web_root = cfg.get("web_root", "") remote_path = int(cfg.get("remote_path", 0)) - extract = int(cfg.get("extract", 0)) protocol = "https://" if ssl else "http://" + status = int(status) + if status == 1 and core.NOEXTRACTFAILED: + extract = 0 + else: + extract = int(cfg.get("extract", 0)) url = "{0}{1}:{2}{3}/api".format(protocol, host, port, web_root) if not server_responding(url): diff --git a/core/autoProcess/autoProcessTV.py b/core/autoProcess/autoProcessTV.py index 2c2bf9a3..34d44daf 100644 --- a/core/autoProcess/autoProcessTV.py +++ b/core/autoProcess/autoProcessTV.py @@ -79,7 +79,11 @@ class autoProcessTV(object): force = int(cfg.get("force", 0)) delete_on = int(cfg.get("delete_on", 0)) ignore_subs = int(cfg.get("ignore_subs", 0)) - extract = int(cfg.get("extract", 0)) + status = int(failed) + if status == 1 and core.NOEXTRACTFAILED: + extract = 0 + else: + extract = int(cfg.get("extract", 0)) if not os.path.isdir(dirName) and os.path.isfile(dirName): # If the input directory is a file, assume single file download and split dir/name. dirName = os.path.split(os.path.normpath(dirName))[0] @@ -117,7 +121,6 @@ class autoProcessTV(object): flatten(dirName) # Check video files for corruption - status = int(failed) good_files = 0 num_files = 0 for video in listMediaFiles(dirName, media=True, audio=False, meta=False, archives=False): diff --git a/core/nzbToMediaConfig.py b/core/nzbToMediaConfig.py index 1db3d987..f29c8db4 100644 --- a/core/nzbToMediaConfig.py +++ b/core/nzbToMediaConfig.py @@ -267,8 +267,8 @@ class ConfigObj(configobj.ConfigObj, Section): CFG_NEW[section][option] = value section = "General" - envKeys = ['AUTO_UPDATE', 'CHECK_MEDIA', 'SAFE_MODE'] - cfgKeys = ['auto_update', 'check_media', 'safe_mode'] + envKeys = ['AUTO_UPDATE', 'CHECK_MEDIA', 'SAFE_MODE', 'NO_EXTRACT_FAILED'] + cfgKeys = ['auto_update', 'check_media', 'safe_mode', 'no_extract_failed'] for index in range(len(envKeys)): key = 'NZBPO_{index}'.format(index=envKeys[index]) if key in os.environ: diff --git a/nzbToCouchPotato.py b/nzbToCouchPotato.py index 3df7f420..c74d2b15 100755 --- a/nzbToCouchPotato.py +++ b/nzbToCouchPotato.py @@ -30,6 +30,11 @@ # Enable/Disable a safety check to ensure we don't process all downloads in the default_downloadDirectory by mistake. #safe_mode=1 +# Disable additional extraction checks for failed (0, 1). +# +# Turn this on to disable additional extraction attempts for failed downloads. Default = 0 this will attempt to extract and verify if media is present. +#no_extract_failed = 0 + ## CouchPotato # CouchPotato script category. diff --git a/nzbToHeadPhones.py b/nzbToHeadPhones.py index 8b1b3067..5e949a60 100755 --- a/nzbToHeadPhones.py +++ b/nzbToHeadPhones.py @@ -25,6 +25,11 @@ # Enable/Disable a safety check to ensure we don't process all downloads in the default_downloadDirectory by mistake. #safe_mode=1 +# Disable additional extraction checks for failed (0, 1). +# +# Turn this on to disable additional extraction attempts for failed downloads. Default = 0 this will attempt to extract and verify if media is present. +#no_extract_failed = 0 + ## HeadPhones # HeadPhones script category. diff --git a/nzbToMedia.py b/nzbToMedia.py index 80f8c48a..87845514 100755 --- a/nzbToMedia.py +++ b/nzbToMedia.py @@ -30,6 +30,11 @@ # Enable/Disable a safety check to ensure we don't process all downloads in the default_downloadDirectory by mistake. #safe_mode=1 +# Disable additional extraction checks for failed (0, 1). +# +# Turn this on to disable additional extraction attempts for failed downloads. Default = 0 this will attempt to extract and verify if media is present. +#no_extract_failed = 0 + ## CouchPotato # CouchPotato script category. diff --git a/nzbToNzbDrone.py b/nzbToNzbDrone.py index 4cd1f860..9951a1fd 100755 --- a/nzbToNzbDrone.py +++ b/nzbToNzbDrone.py @@ -30,6 +30,11 @@ # Enable/Disable a safety check to ensure we don't process all downloads in the default_downloadDirectory by mistake. #safe_mode=1 +# Disable additional extraction checks for failed (0, 1). +# +# Turn this on to disable additional extraction attempts for failed downloads. Default = 0 this will attempt to extract and verify if media is present. +#no_extract_failed = 0 + ## NzbDrone # NzbDrone script category. diff --git a/nzbToSickBeard.py b/nzbToSickBeard.py index 1bff8fc7..1d4b636d 100755 --- a/nzbToSickBeard.py +++ b/nzbToSickBeard.py @@ -30,6 +30,11 @@ # Enable/Disable a safety check to ensure we don't process all downloads in the default_downloadDirectory by mistake. #safe_mode=1 +# Disable additional extraction checks for failed (0, 1). +# +# Turn this on to disable additional extraction attempts for failed downloads. Default = 0 this will attempt to extract and verify if media is present. +#no_extract_failed = 0 + ## SickBeard # SickBeard script category.