remove surpluss debug, fix handling of None Password file, and fix invisible windows extraction.

added option for windows extraction debugging. Fixes #1399 #759
This commit is contained in:
clinton-hall 2018-12-06 19:24:04 +13:00
commit de869391b1
4 changed files with 15 additions and 12 deletions

View file

@ -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

View file

@ -1,15 +1,15 @@
set args = WScript.Arguments
num = args.Count
if num = 0 then
WScript.Echo "Usage: [CScript | WScript] invis.vbs aScript.bat <some script arguments>"
if num < 2 then
WScript.Echo "Usage: [CScript | WScript] invis.vbs aScript.bat <visible or invisible 1/0> <some script arguments>"
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)

View file

@ -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 = []