mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-13 08:19:32 +01:00
[metadatafromfield] Do not detect numbers as field names
Related: https://github.com/yt-dlp/yt-dlp/issues/486#issuecomment-877820394
This commit is contained in:
parent
75722b037d
commit
501dd1ad55
@ -27,7 +27,7 @@ def __init__(self, downloader, formats):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def field_to_template(tmpl):
|
def field_to_template(tmpl):
|
||||||
if re.match(r'\w+$', tmpl):
|
if re.match(r'[a-zA-Z_]+$', tmpl):
|
||||||
return '%%(%s)s' % tmpl
|
return '%%(%s)s' % tmpl
|
||||||
return tmpl
|
return tmpl
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ def run(self, info):
|
|||||||
continue
|
continue
|
||||||
for attribute, value in match.groupdict().items():
|
for attribute, value in match.groupdict().items():
|
||||||
info[attribute] = value
|
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
|
return [], info
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user