aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/postprocessor/metadatafromfield.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-06-03 23:30:38 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-06-06 00:59:04 +0530
commit752cda3880f30a46bed1d27b69188ab93ad1a368 (patch)
tree1a6bc38ff775f70f4723be63d6f635f6781d38d6 /yt_dlp/postprocessor/metadatafromfield.py
parent9d83ad93d04a1e16fe4a2acadf5f9f10bef6d1b9 (diff)
Fix and refactor `prepare_outtmpl`
The following tests would have failed previously: %(id)d %(id)r %(ext)s-%(ext|def)d %(width|)d %(id)r %(height)r %(formats.0)r %s
Diffstat (limited to 'yt_dlp/postprocessor/metadatafromfield.py')
-rw-r--r--yt_dlp/postprocessor/metadatafromfield.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/yt_dlp/postprocessor/metadatafromfield.py b/yt_dlp/postprocessor/metadatafromfield.py
index 1def868e8..8c795586c 100644
--- a/yt_dlp/postprocessor/metadatafromfield.py
+++ b/yt_dlp/postprocessor/metadatafromfield.py
@@ -54,9 +54,9 @@ class MetadataFromFieldPP(PostProcessor):
def run(self, info):
for dictn in self._data:
- tmpl, info_copy = self._downloader.prepare_outtmpl(dictn['tmpl'], info)
- data_to_parse = tmpl % info_copy
- self.write_debug('Searching for r"%s" in %s' % (dictn['regex'], tmpl))
+ tmpl, tmpl_dict = self._downloader.prepare_outtmpl(dictn['tmpl'], info)
+ data_to_parse = 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:
self.report_warning('Could not interpret video %s as "%s"' % (dictn['in'], dictn['out']))