Add option --exec-before-download

Closes #530
This commit is contained in:
pukkandan
2021-07-19 23:26:22 +05:30
parent 8d9b902243
commit 5520aa2dc9
4 changed files with 15 additions and 1 deletions

View File

@@ -28,7 +28,8 @@ class ExecAfterDownloadPP(PostProcessor):
# If no replacements are found, replace {} for backard compatibility
if '{}' not in cmd:
cmd += ' {}'
return cmd.replace('{}', compat_shlex_quote(info['filepath']))
return cmd.replace('{}', compat_shlex_quote(
info.get('filepath') or info['_filename']))
def run(self, info):
cmd = self.parse_cmd(self.exec_cmd, info)