aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/postprocessor/execafterdownload.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-07-19 23:26:22 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-07-19 23:47:45 +0530
commit5520aa2dc9119a091b96944d373e33251a3b9ba7 (patch)
treeafbeb04fc58311903d037856372a93990e87f8b7 /yt_dlp/postprocessor/execafterdownload.py
parent8d9b9022435abcc24790b5dcce8d323b167d7954 (diff)
downloadhypervideo-pre-5520aa2dc9119a091b96944d373e33251a3b9ba7.tar.lz
hypervideo-pre-5520aa2dc9119a091b96944d373e33251a3b9ba7.tar.xz
hypervideo-pre-5520aa2dc9119a091b96944d373e33251a3b9ba7.zip
Add option `--exec-before-download`
Closes #530
Diffstat (limited to 'yt_dlp/postprocessor/execafterdownload.py')
-rw-r--r--yt_dlp/postprocessor/execafterdownload.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yt_dlp/postprocessor/execafterdownload.py b/yt_dlp/postprocessor/execafterdownload.py
index 948b3ffb3..336671d14 100644
--- a/yt_dlp/postprocessor/execafterdownload.py
+++ b/yt_dlp/postprocessor/execafterdownload.py
@@ -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)