diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-05-03 22:36:03 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-05-06 20:28:58 +0530 |
commit | e625be0d10d96a20702d630dcc88e3269554e172 (patch) | |
tree | 73f96152c871708a9c1430dc205fdd7089f144ab /yt_dlp/postprocessor/execafterdownload.py | |
parent | 12e73423f1df25bfe2fa00434b2688dd7dd9d227 (diff) | |
download | hypervideo-pre-e625be0d10d96a20702d630dcc88e3269554e172.tar.lz hypervideo-pre-e625be0d10d96a20702d630dcc88e3269554e172.tar.xz hypervideo-pre-e625be0d10d96a20702d630dcc88e3269554e172.zip |
Improve output template internal formatting
* Allow slicing lists/strings using `field.start:end:step`
* A field can also be used as offset like `field1+num+field2`
* A default value can be given using `field|default`
* Capture all format strings and set it to `None` if invalid. This prevents invalid fields from causing errors
Diffstat (limited to 'yt_dlp/postprocessor/execafterdownload.py')
-rw-r--r-- | yt_dlp/postprocessor/execafterdownload.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/yt_dlp/postprocessor/execafterdownload.py b/yt_dlp/postprocessor/execafterdownload.py index 4a0649680..9d68583e7 100644 --- a/yt_dlp/postprocessor/execafterdownload.py +++ b/yt_dlp/postprocessor/execafterdownload.py @@ -24,7 +24,7 @@ class ExecAfterDownloadPP(PostProcessor): def parse_cmd(self, cmd, info): # If no %(key)s is found, replace {} for backard compatibility - if not re.search(FORMAT_RE.format(r'[-\w>.+]+'), cmd): + if not re.search(FORMAT_RE.format(r'[^)]*'), cmd): if '{}' not in cmd: cmd += ' {}' return cmd.replace('{}', compat_shlex_quote(info['filepath'])) |