mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-16 02:02:53 -07:00
fixed extractor for linux
This commit is contained in:
parent
0a3a2491d8
commit
af2bcb3fd6
1 changed files with 4 additions and 4 deletions
|
@ -63,7 +63,7 @@ def extract(dirpath, file, outputDestination):
|
||||||
# ".bz2": ["bzip2", "-d --keep"],
|
# ".bz2": ["bzip2", "-d --keep"],
|
||||||
|
|
||||||
EXTRACT_COMMANDS = {
|
EXTRACT_COMMANDS = {
|
||||||
".rar": ["unrar", "x -o+ -y"],
|
".rar": ["unrar", "x"],
|
||||||
".tar": ["tar", "-xf"],
|
".tar": ["tar", "-xf"],
|
||||||
".zip": ["unzip", ""],
|
".zip": ["unzip", ""],
|
||||||
".tar.gz": ["tar", "-xzf"], ".tgz": ["tar", "-xzf"],
|
".tar.gz": ["tar", "-xzf"], ".tgz": ["tar", "-xzf"],
|
||||||
|
@ -74,10 +74,10 @@ def extract(dirpath, file, outputDestination):
|
||||||
}
|
}
|
||||||
# Test command exists and if not, remove
|
# Test command exists and if not, remove
|
||||||
for cmd in required_cmds:
|
for cmd in required_cmds:
|
||||||
if not which(cmd):
|
if call(['which', cmd]): #note, returns 0 if exists, or 1 if doesn't exist.
|
||||||
for k,v in EXTRACT_COMMANDS.items():
|
for k, v in EXTRACT_COMMANDS.items():
|
||||||
if cmd in v[0]:
|
if cmd in v[0]:
|
||||||
log.error("EXTRACTOR: %s not found, disabling support for %s", cmd, k)
|
Logger.error("EXTRACTOR: %s not found, disabling support for %s", cmd, k)
|
||||||
del EXTRACT_COMMANDS[k]
|
del EXTRACT_COMMANDS[k]
|
||||||
if not EXTRACT_COMMANDS:
|
if not EXTRACT_COMMANDS:
|
||||||
Logger.warn("EXTRACTOR: No archive extracting programs found, plugin will be disabled")
|
Logger.warn("EXTRACTOR: No archive extracting programs found, plugin will be disabled")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue