From 5bfa48620542d9ee34958d7c96aa45465b058fbd Mon Sep 17 00:00:00 2001 From: pukkandan Date: Tue, 26 Jan 2021 15:50:20 +0530 Subject: Add option `--parse-metadata` * The fields extracted by this can be used in `--output` * Deprecated `--metadata-from-title` :ci skip dl --- youtube_dlc/options.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'youtube_dlc/options.py') diff --git a/youtube_dlc/options.py b/youtube_dlc/options.py index 4910c2083..859f28e2b 100644 --- a/youtube_dlc/options.py +++ b/youtube_dlc/options.py @@ -1078,14 +1078,20 @@ def parseOpts(overrideArguments=None): postproc.add_option( '--metadata-from-title', metavar='FORMAT', dest='metafromtitle', + help=optparse.SUPPRESS_HELP) + postproc.add_option( + '--parse-metadata', + metavar='FIELD:FORMAT', dest='metafromfield', action='append', help=( - 'Parse additional metadata like song title / artist from the video title. ' - 'The format syntax is the same as --output. Regular expression with ' - 'named capture groups may also be used. ' + 'Parse additional metadata like title/artist from other fields. ' + 'Give field name to extract data from, and format of the field seperated by a ":". ' + 'The format syntax is the same as --output. ' + 'Regular expression with named capture groups may also be used. ' 'The parsed parameters replace existing values. ' - 'Example: --metadata-from-title "%(artist)s - %(title)s" matches a title like ' + 'This option can be used multiple times. ' + 'Example: --parse-metadata "title:%(artist)s - %(title)s" matches a title like ' '"Coldplay - Paradise". ' - 'Example (regex): --metadata-from-title "(?P.+?) - (?P.+)"')) + 'Example (regex): --parse-metadata "description:Artist - (?P<artist>.+?)"')) postproc.add_option( '--xattrs', action='store_true', dest='xattrs', default=False, -- cgit v1.2.3