diff options
author | Jesús <heckyel@hyperbola.info> | 2022-02-05 10:48:13 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2022-02-05 10:48:13 -0500 |
commit | c4b763b19f54ed5dfc2fd408adb9ed74126f6740 (patch) | |
tree | 1bbf4450644370608f97bf6d4d7db818c5039f55 /yt_dlp/postprocessor/exec.py | |
parent | 5aac4e0267e32d98eb68692afedafda3b41ea629 (diff) | |
parent | a3125791c7a5cdf2c8c025b99788bf686edd1a8a (diff) | |
download | hypervideo-pre-c4b763b19f54ed5dfc2fd408adb9ed74126f6740.tar.lz hypervideo-pre-c4b763b19f54ed5dfc2fd408adb9ed74126f6740.tar.xz hypervideo-pre-c4b763b19f54ed5dfc2fd408adb9ed74126f6740.zip |
updated from upstream | 05/02/2022 at 10:48
Diffstat (limited to 'yt_dlp/postprocessor/exec.py')
-rw-r--r-- | yt_dlp/postprocessor/exec.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/yt_dlp/postprocessor/exec.py b/yt_dlp/postprocessor/exec.py index 28a7c3d70..63f4d23f2 100644 --- a/yt_dlp/postprocessor/exec.py +++ b/yt_dlp/postprocessor/exec.py @@ -22,11 +22,13 @@ class ExecPP(PostProcessor): if tmpl_dict: # if there are no replacements, tmpl_dict = {} return self._downloader.escape_outtmpl(tmpl) % tmpl_dict - # If no replacements are found, replace {} for backard compatibility - if '{}' not in cmd: - cmd += ' {}' - return cmd.replace('{}', compat_shlex_quote( - info.get('filepath') or info['_filename'])) + filepath = info.get('filepath', info.get('_filename')) + # If video, and no replacements are found, replace {} for backard compatibility + if filepath: + if '{}' not in cmd: + cmd += ' {}' + cmd = cmd.replace('{}', compat_shlex_quote(filepath)) + return cmd def run(self, info): for tmpl in self.exec_cmd: |