1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2026-01-15 03:11:18 +00:00

Fix --parse-metadata when TO is a single field name (#14577)

Closes #14576
Authored by: clayote, bashonly

Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
This commit is contained in:
clayote
2026-01-05 16:19:30 +13:00
committed by GitHub
parent ba499ab0dc
commit cec1f1df79
3 changed files with 11 additions and 0 deletions

View File

@@ -42,6 +42,9 @@ class MetadataParserPP(PostProcessor):
to a regex like
'(?P<title>.+)\ \-\ (?P<artist>.+)'
"""
if re.fullmatch(r'\w+', fmt):
# convert a single field name into regex pattern that matches the entire input
return rf'(?s)(?P<{fmt}>.+)'
if not re.search(r'%\(\w+\)s', fmt):
return fmt
lastpos = 0