aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/postprocessor/metadatafromfield.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-07-29 05:19:26 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-07-29 08:38:18 +0530
commit901130bbcf799573255ade3e2882dec4670feda8 (patch)
tree92ee87557874b07266d25c14a2e49d53844041f8 /yt_dlp/postprocessor/metadatafromfield.py
parentc0bc527bca735ee8a8b32857466d75f7d47aa22a (diff)
downloadhypervideo-pre-901130bbcf799573255ade3e2882dec4670feda8.tar.lz
hypervideo-pre-901130bbcf799573255ade3e2882dec4670feda8.tar.xz
hypervideo-pre-901130bbcf799573255ade3e2882dec4670feda8.zip
Expand and escape environment variables correctly in outtmpl
Fixes: https://www.reddit.com/r/youtubedl/comments/otfmq3/ytdlp_same_parameters_different_results
Diffstat (limited to 'yt_dlp/postprocessor/metadatafromfield.py')
-rw-r--r--yt_dlp/postprocessor/metadatafromfield.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/yt_dlp/postprocessor/metadatafromfield.py b/yt_dlp/postprocessor/metadatafromfield.py
index d41ab4bfc..002794765 100644
--- a/yt_dlp/postprocessor/metadatafromfield.py
+++ b/yt_dlp/postprocessor/metadatafromfield.py
@@ -55,7 +55,7 @@ class MetadataFromFieldPP(PostProcessor):
def run(self, info):
for dictn in self._data:
tmpl, tmpl_dict = self._downloader.prepare_outtmpl(dictn['tmpl'], info)
- data_to_parse = tmpl % tmpl_dict
+ data_to_parse = self._downloader.escape_outtmpl(tmpl) % tmpl_dict
self.write_debug('Searching for r"%s" in %s' % (dictn['regex'], dictn['tmpl']))
match = re.search(dictn['regex'], data_to_parse)
if match is None: