1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-11-02 23:55:13 +00:00

Expand and escape environment variables correctly in outtmpl

Fixes: https://www.reddit.com/r/youtubedl/comments/otfmq3/ytdlp_same_parameters_different_results
This commit is contained in:
pukkandan
2021-07-29 05:19:26 +05:30
parent c0bc527bca
commit 901130bbcf
5 changed files with 60 additions and 37 deletions

View File

@@ -23,7 +23,7 @@ class ExecAfterDownloadPP(PostProcessor):
def parse_cmd(self, cmd, info):
tmpl, tmpl_dict = self._downloader.prepare_outtmpl(cmd, info)
if tmpl_dict: # if there are no replacements, tmpl_dict = {}
return tmpl % tmpl_dict
return self._downloader.escape_outtmpl(tmpl) % tmpl_dict
# If no replacements are found, replace {} for backard compatibility
if '{}' not in cmd: