mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
parent
55cd83d4ec
commit
1e309b5891
4 changed files with 25 additions and 9 deletions
Binary file not shown.
1
nzbtomedia/extractor/bin/invisible.cmd
Executable file
1
nzbtomedia/extractor/bin/invisible.cmd
Executable file
|
@ -0,0 +1 @@
|
||||||
|
start /wait wscript "%~dp0\invisible.vbs" %*
|
20
nzbtomedia/extractor/bin/invisible.vbs
Executable file
20
nzbtomedia/extractor/bin/invisible.vbs
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
set args = WScript.Arguments
|
||||||
|
num = args.Count
|
||||||
|
|
||||||
|
if num = 0 then
|
||||||
|
WScript.Echo "Usage: [CScript | WScript] invis.vbs aScript.bat <some script arguments>"
|
||||||
|
WScript.Quit 1
|
||||||
|
end if
|
||||||
|
|
||||||
|
sargs = ""
|
||||||
|
if num > 1 then
|
||||||
|
sargs = " "
|
||||||
|
for k = 1 to num - 1
|
||||||
|
anArg = args.Item(k)
|
||||||
|
sargs = sargs & anArg & " "
|
||||||
|
next
|
||||||
|
end if
|
||||||
|
|
||||||
|
Set WshShell = WScript.CreateObject("WScript.Shell")
|
||||||
|
|
||||||
|
WshShell.Run """" & WScript.Arguments(0) & """" & sargs, 0, True
|
|
@ -10,18 +10,13 @@ def extract(filePath, outputDestination):
|
||||||
success = 0
|
success = 0
|
||||||
# Using Windows
|
# Using Windows
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
chplocation = os.path.join(nzbtomedia.PROGRAM_DIR, 'nzbtomedia', 'extractor', 'bin', 'chp.exe')
|
|
||||||
|
|
||||||
if not os.path.exists(nzbtomedia.SEVENZIP):
|
if not os.path.exists(nzbtomedia.SEVENZIP):
|
||||||
nzbtomedia.logger.error("EXTRACTOR: Could not find 7-zip, Exiting")
|
nzbtomedia.logger.error("EXTRACTOR: Could not find 7-zip, Exiting")
|
||||||
return False
|
return False
|
||||||
else:
|
invislocation = os.path.join(nzbtomedia.PROGRAM_DIR, 'nzbtomedia', 'extractor', 'bin', 'invisible.cmd')
|
||||||
if not os.path.exists(chplocation):
|
cmd_7zip = [invislocation, nzbtomedia.SEVENZIP, "x", "-y"]
|
||||||
cmd_7zip = [nzbtomedia.SEVENZIP, "x", "-y"]
|
ext_7zip = [".rar", ".zip", ".tar.gz", "tgz", ".tar.bz2", ".tbz", ".tar.lzma", ".tlz", ".7z", ".xz"]
|
||||||
else:
|
EXTRACT_COMMANDS = dict.fromkeys(ext_7zip, cmd_7zip)
|
||||||
cmd_7zip = [chplocation, nzbtomedia.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
|
# Using unix
|
||||||
else:
|
else:
|
||||||
required_cmds = ["unrar", "unzip", "tar", "unxz", "unlzma", "7zr", "bunzip2"]
|
required_cmds = ["unrar", "unzip", "tar", "unxz", "unlzma", "7zr", "bunzip2"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue