aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/options.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2021-01-26 15:50:20 +0530
committerpukkandan <pukkandan@gmail.com>2021-01-26 16:14:31 +0530
commit5bfa48620542d9ee34958d7c96aa45465b058fbd (patch)
tree60220c27fb40122909c00d43a59cd08c2edf661b /youtube_dlc/options.py
parent9882064024abdad7d37771459e9df11bcdec1115 (diff)
downloadhypervideo-pre-5bfa48620542d9ee34958d7c96aa45465b058fbd.tar.lz
hypervideo-pre-5bfa48620542d9ee34958d7c96aa45465b058fbd.tar.xz
hypervideo-pre-5bfa48620542d9ee34958d7c96aa45465b058fbd.zip
Add option `--parse-metadata`
* The fields extracted by this can be used in `--output` * Deprecated `--metadata-from-title` :ci skip dl
Diffstat (limited to 'youtube_dlc/options.py')
-rw-r--r--youtube_dlc/options.py16
1 files changed, 11 insertions, 5 deletions
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<artist>.+?) - (?P<title>.+)"'))
+ 'Example (regex): --parse-metadata "description:Artist - (?P<artist>.+?)"'))
postproc.add_option(
'--xattrs',
action='store_true', dest='xattrs', default=False,