mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -07:00
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:
parent
e2accb9ec2
commit
de869391b1
4 changed files with 15 additions and 12 deletions
|
@ -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.
|
# 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
|
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]
|
[CouchPotato]
|
||||||
#### autoProcessing for Movies
|
#### autoProcessing for Movies
|
||||||
#### movie - category that gets called for post-processing with CPS
|
#### movie - category that gets called for post-processing with CPS
|
||||||
|
|
|
@ -202,6 +202,7 @@ OUTPUTFASTSTART = None
|
||||||
OUTPUTQUALITYPERCENT = None
|
OUTPUTQUALITYPERCENT = None
|
||||||
FFMPEG = None
|
FFMPEG = None
|
||||||
SEVENZIP = None
|
SEVENZIP = None
|
||||||
|
SHOWEXTRACT = 0
|
||||||
PAR2CMD = None
|
PAR2CMD = None
|
||||||
FFPROBE = None
|
FFPROBE = None
|
||||||
CHECK_MEDIA = None
|
CHECK_MEDIA = None
|
||||||
|
@ -225,7 +226,7 @@ __INITIALIZED__ = False
|
||||||
|
|
||||||
def initialize(section=None):
|
def initialize(section=None):
|
||||||
global NZBGET_POSTPROCESS_ERROR, NZBGET_POSTPROCESS_NONE, NZBGET_POSTPROCESS_PARCHECK, NZBGET_POSTPROCESS_SUCCESS, \
|
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, \
|
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, \
|
SABNZB_NO_OF_ARGUMENTS, SABNZB_0717_NO_OF_ARGUMENTS, CATEGORIES, TORRENT_CLIENTAGENT, USELINK, OUTPUTDIRECTORY, \
|
||||||
NOFLATTEN, UTORRENTPWD, UTORRENTUSR, UTORRENTWEBUI, DELUGEHOST, DELUGEPORT, DELUGEUSR, DELUGEPWD, VLEVEL, \
|
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')
|
FFMPEG = os.path.join(FFMPEG_PATH, 'ffmpeg.exe')
|
||||||
FFPROBE = os.path.join(FFMPEG_PATH, 'ffprobe.exe')
|
FFPROBE = os.path.join(FFMPEG_PATH, 'ffprobe.exe')
|
||||||
SEVENZIP = os.path.join(PROGRAM_DIR, 'core', 'extractor', 'bin', platform.machine(), '7z.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
|
if not (os.path.isfile(FFMPEG)): # problem
|
||||||
FFMPEG = None
|
FFMPEG = None
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
set args = WScript.Arguments
|
set args = WScript.Arguments
|
||||||
num = args.Count
|
num = args.Count
|
||||||
|
|
||||||
if num = 0 then
|
if num < 2 then
|
||||||
WScript.Echo "Usage: [CScript | WScript] invis.vbs aScript.bat <some script arguments>"
|
WScript.Echo "Usage: [CScript | WScript] invis.vbs aScript.bat <visible or invisible 1/0> <some script arguments>"
|
||||||
WScript.Quit 1
|
WScript.Quit 1
|
||||||
end if
|
end if
|
||||||
|
|
||||||
sargs = ""
|
sargs = ""
|
||||||
if num > 1 then
|
if num > 2 then
|
||||||
sargs = " "
|
sargs = " "
|
||||||
for k = 1 to num - 1
|
for k = 2 to num - 1
|
||||||
anArg = args.Item(k)
|
anArg = args.Item(k)
|
||||||
sargs = sargs & anArg & " "
|
sargs = sargs & anArg & " "
|
||||||
next
|
next
|
||||||
|
@ -17,5 +17,5 @@ end if
|
||||||
|
|
||||||
Set WshShell = WScript.CreateObject("WScript.Shell")
|
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)
|
WScript.Quit(returnValue)
|
||||||
|
|
|
@ -18,7 +18,7 @@ def extract(filePath, outputDestination):
|
||||||
core.logger.error("EXTRACTOR: Could not find 7-zip, Exiting")
|
core.logger.error("EXTRACTOR: Could not find 7-zip, Exiting")
|
||||||
return False
|
return False
|
||||||
invislocation = os.path.join(core.PROGRAM_DIR, 'core', 'extractor', 'bin', 'invisible.cmd')
|
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"]
|
ext_7zip = [".rar", ".zip", ".tar.gz", "tgz", ".tar.bz2", ".tbz", ".tar.lzma", ".tlz", ".7z", ".xz"]
|
||||||
EXTRACT_COMMANDS = dict.fromkeys(ext_7zip, cmd_7zip)
|
EXTRACT_COMMANDS = dict.fromkeys(ext_7zip, cmd_7zip)
|
||||||
# Using unix
|
# Using unix
|
||||||
|
@ -80,8 +80,6 @@ def extract(filePath, outputDestination):
|
||||||
else:
|
else:
|
||||||
if ext[1] in EXTRACT_COMMANDS:
|
if ext[1] in EXTRACT_COMMANDS:
|
||||||
cmd = EXTRACT_COMMANDS[ext[1]]
|
cmd = EXTRACT_COMMANDS[ext[1]]
|
||||||
core.logger.debug("EXTRACTOR: cmd: {cmd} set for file: {file}".format
|
|
||||||
(cmd=cmd, file=filePath))
|
|
||||||
else:
|
else:
|
||||||
core.logger.debug("EXTRACTOR: Unknown file type: {ext}".format
|
core.logger.debug("EXTRACTOR: Unknown file type: {ext}".format
|
||||||
(ext=ext[1]))
|
(ext=ext[1]))
|
||||||
|
@ -89,10 +87,8 @@ def extract(filePath, outputDestination):
|
||||||
|
|
||||||
# Create outputDestination folder
|
# Create outputDestination folder
|
||||||
core.makeDir(outputDestination)
|
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))]
|
passwords = [line.strip() for line in open(os.path.normpath(core.PASSWORDSFILE))]
|
||||||
else:
|
else:
|
||||||
passwords = []
|
passwords = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue