未验证 提交 501dd1ad 编写于 作者: P pukkandan

[metadatafromfield] Do not detect numbers as field names

Related: https://github.com/yt-dlp/yt-dlp/issues/486#issuecomment-877820394
上级 75722b03
......@@ -27,7 +27,7 @@ def __init__(self, downloader, formats):
@staticmethod
def field_to_template(tmpl):
if re.match(r'\w+$', tmpl):
if re.match(r'[a-zA-Z_]+$', tmpl):
return '%%(%s)s' % tmpl
return tmpl
......@@ -63,7 +63,7 @@ def run(self, info):
continue
for attribute, value in match.groupdict().items():
info[attribute] = value
self.to_screen('parsed %s from "%s": %s' % (attribute, dictn['in'], value if value is not None else 'NA'))
self.to_screen('parsed %s from "%s": %s' % (attribute, dictn['tmpl'], value if value is not None else 'NA'))
return [], info
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册