aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/postprocessor/exec.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2025-12-20 05:49:11 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2025-12-20 05:49:11 -0500
commitc586ea4b3c871f5696626f9820e8c88a4e78f4a6 (patch)
treee6d7bae96282c3d147159f091d451e53bdaa2efe /gallery_dl/postprocessor/exec.py
parent01a2bf622c31072d1322884584404b9bd59b28cc (diff)
parenta24ec1647aeac35a63b744ea856011ad6e06be3b (diff)
Update upstream source from tag 'upstream/1.31.1'
Update to upstream version '1.31.1' with Debian dir b5d91c25143175f933b1c69c7e82249cd7e145ab
Diffstat (limited to 'gallery_dl/postprocessor/exec.py')
-rw-r--r--gallery_dl/postprocessor/exec.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/gallery_dl/postprocessor/exec.py b/gallery_dl/postprocessor/exec.py
index 3b0ab22..9e2e4df 100644
--- a/gallery_dl/postprocessor/exec.py
+++ b/gallery_dl/postprocessor/exec.py
@@ -22,6 +22,10 @@ else:
from shlex import quote
+def trim(args):
+ return (args.partition(" ") if isinstance(args, str) else args)[0]
+
+
class ExecPP(PostProcessor):
def __init__(self, job, options):
@@ -35,6 +39,7 @@ class ExecPP(PostProcessor):
if options.get("async", False):
self._exec = self._popen
+ self.verbose = options.get("verbose", True)
self.session = False
self.creationflags = 0
if options.get("session"):
@@ -115,11 +120,11 @@ class ExecPP(PostProcessor):
def _exec(self, args, shell):
if retcode := self._popen(args, shell).wait():
self.log.warning("'%s' returned with non-zero exit status (%d)",
- args, retcode)
+ args if self.verbose else trim(args), retcode)
return retcode
def _popen(self, args, shell):
- self.log.debug("Running '%s'", args)
+ self.log.debug("Running '%s'", args if self.verbose else trim(args))
return util.Popen(
args,
shell=shell,