mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 10:36:52 -07:00
parent
55cd83d4ec
commit
1e309b5891
4 changed files with 25 additions and 9 deletions
|
@ -10,18 +10,13 @@ def extract(filePath, outputDestination):
|
|||
success = 0
|
||||
# Using Windows
|
||||
if platform.system() == 'Windows':
|
||||
chplocation = os.path.join(nzbtomedia.PROGRAM_DIR, 'nzbtomedia', 'extractor', 'bin', 'chp.exe')
|
||||
|
||||
if not os.path.exists(nzbtomedia.SEVENZIP):
|
||||
nzbtomedia.logger.error("EXTRACTOR: Could not find 7-zip, Exiting")
|
||||
return False
|
||||
else:
|
||||
if not os.path.exists(chplocation):
|
||||
cmd_7zip = [nzbtomedia.SEVENZIP, "x", "-y"]
|
||||
else:
|
||||
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)
|
||||
invislocation = os.path.join(nzbtomedia.PROGRAM_DIR, 'nzbtomedia', 'extractor', 'bin', 'invisible.cmd')
|
||||
cmd_7zip = [invislocation, 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
|
||||
else:
|
||||
required_cmds = ["unrar", "unzip", "tar", "unxz", "unlzma", "7zr", "bunzip2"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue