diff --git a/autoProcessMedia.cfg.spec b/autoProcessMedia.cfg.spec index e04f2dc2..ef3c362b 100644 --- a/autoProcessMedia.cfg.spec +++ b/autoProcessMedia.cfg.spec @@ -40,6 +40,11 @@ # Set the ionice scheduling class data. This defines the class data, if the class accepts an argument. For real time and best-effort, 0-7 is valid data. ionice_classdata = 0 +[Windows] + ### Set specific settings for Windows systems + # Set this to 1 to allow extraction (7zip) windows to be lunched visble (for debugging) otherwise 0 to have this run in background. + show_extraction = 0 + [CouchPotato] #### autoProcessing for Movies #### movie - category that gets called for post-processing with CPS diff --git a/core/__init__.py b/core/__init__.py index f406439e..01d1262d 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -202,6 +202,7 @@ OUTPUTFASTSTART = None OUTPUTQUALITYPERCENT = None FFMPEG = None SEVENZIP = None +SHOWEXTRACT = 0 PAR2CMD = None FFPROBE = None CHECK_MEDIA = None @@ -225,7 +226,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, NOEXTRACTFAILED, \ + NZBTOMEDIA_TIMEOUT, FORKS, FORK_DEFAULT, FORK_FAILED_TORRENT, FORK_FAILED, NOEXTRACTFAILED, SHOWEXTRACT, \ 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, \ @@ -743,6 +744,7 @@ def initialize(section=None): FFMPEG = os.path.join(FFMPEG_PATH, 'ffmpeg.exe') FFPROBE = os.path.join(FFMPEG_PATH, 'ffprobe.exe') SEVENZIP = os.path.join(PROGRAM_DIR, 'core', 'extractor', 'bin', platform.machine(), '7z.exe') + SHOWEXTRACT = int(str(CFG["Windows"]["show_extraction"]), 0) if not (os.path.isfile(FFMPEG)): # problem FFMPEG = None diff --git a/core/extractor/bin/invisible.vbs b/core/extractor/bin/invisible.vbs index 0b6de65c..415fc7cc 100755 --- a/core/extractor/bin/invisible.vbs +++ b/core/extractor/bin/invisible.vbs @@ -1,15 +1,15 @@ set args = WScript.Arguments num = args.Count -if num = 0 then - WScript.Echo "Usage: [CScript | WScript] invis.vbs aScript.bat " +if num < 2 then + WScript.Echo "Usage: [CScript | WScript] invis.vbs aScript.bat " WScript.Quit 1 end if sargs = "" -if num > 1 then +if num > 2 then sargs = " " - for k = 1 to num - 1 + for k = 2 to num - 1 anArg = args.Item(k) sargs = sargs & anArg & " " next @@ -17,5 +17,5 @@ end if Set WshShell = WScript.CreateObject("WScript.Shell") -returnValue = WshShell.Run("""" & WScript.Arguments(0) & """" & sargs, 1, True) +returnValue = WshShell.Run("""" & WScript.Arguments(1) & """" & sargs, WScript.Arguments(0), True) WScript.Quit(returnValue) diff --git a/core/extractor/extractor.py b/core/extractor/extractor.py index 83ec1b6a..47e10acc 100644 --- a/core/extractor/extractor.py +++ b/core/extractor/extractor.py @@ -18,7 +18,7 @@ def extract(filePath, outputDestination): core.logger.error("EXTRACTOR: Could not find 7-zip, Exiting") return False invislocation = os.path.join(core.PROGRAM_DIR, 'core', 'extractor', 'bin', 'invisible.cmd') - cmd_7zip = [invislocation, core.SEVENZIP, "x", "-y"] + cmd_7zip = [invislocation, core.SHOWEXTRACT, core.SEVENZIP, "x", "-y"] ext_7zip = [".rar", ".zip", ".tar.gz", "tgz", ".tar.bz2", ".tbz", ".tar.lzma", ".tlz", ".7z", ".xz"] EXTRACT_COMMANDS = dict.fromkeys(ext_7zip, cmd_7zip) # Using unix @@ -80,8 +80,6 @@ def extract(filePath, outputDestination): else: if ext[1] in EXTRACT_COMMANDS: cmd = EXTRACT_COMMANDS[ext[1]] - core.logger.debug("EXTRACTOR: cmd: {cmd} set for file: {file}".format - (cmd=cmd, file=filePath)) else: core.logger.debug("EXTRACTOR: Unknown file type: {ext}".format (ext=ext[1])) @@ -89,10 +87,8 @@ def extract(filePath, outputDestination): # Create outputDestination folder core.makeDir(outputDestination) - core.logger.debug("EXTRACTOR: output folder: {folder} exists".format - (folder=outputDestination)) - if core.PASSWORDSFILE != "" and os.path.isfile(os.path.normpath(core.PASSWORDSFILE)): + if core.PASSWORDSFILE and os.path.isfile(os.path.normpath(core.PASSWORDSFILE)): passwords = [line.strip() for line in open(os.path.normpath(core.PASSWORDSFILE))] else: passwords = []