diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-07-12 05:10:08 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-07-12 05:20:12 +0530 |
commit | 501dd1ad55c141020c0c3b922facbca30b6584a9 (patch) | |
tree | 60b6bce92be44b25da1b56cd1c94fb5ef9d259f6 /yt_dlp/postprocessor/metadatafromfield.py | |
parent | 75722b037d0d1a273dceced9cfa82cc6a80d8adb (diff) | |
download | hypervideo-pre-501dd1ad55c141020c0c3b922facbca30b6584a9.tar.lz hypervideo-pre-501dd1ad55c141020c0c3b922facbca30b6584a9.tar.xz hypervideo-pre-501dd1ad55c141020c0c3b922facbca30b6584a9.zip |
[metadatafromfield] Do not detect numbers as field names
Related: https://github.com/yt-dlp/yt-dlp/issues/486#issuecomment-877820394
Diffstat (limited to 'yt_dlp/postprocessor/metadatafromfield.py')
-rw-r--r-- | yt_dlp/postprocessor/metadatafromfield.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/yt_dlp/postprocessor/metadatafromfield.py b/yt_dlp/postprocessor/metadatafromfield.py index 8c795586c..d41ab4bfc 100644 --- a/yt_dlp/postprocessor/metadatafromfield.py +++ b/yt_dlp/postprocessor/metadatafromfield.py @@ -27,7 +27,7 @@ class MetadataFromFieldPP(PostProcessor): @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 @@ class MetadataFromFieldPP(PostProcessor): 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 |