Skip to content

Commit dbcea05

Browse files
committed
[outtmpl] Handle -o "" better
Since the specific type of file is not downloaded when giving `-o "<type>:"`, now `-o ""` acts as an alias to `--skip-download`
1 parent f7d4854 commit dbcea05

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ To summarize, the general syntax for a field is:
11371137
%(name[.keys][addition][>strf][,alternate][&replacement][|default])[flags][width][.precision][length]type
11381138
```
11391139

1140-
Additionally, you can set different output templates for the various metadata files separately from the general output template by specifying the type of file followed by the template separated by a colon `:`. The different file types supported are `subtitle`, `thumbnail`, `description`, `annotation` (deprecated), `infojson`, `link`, `pl_thumbnail`, `pl_description`, `pl_infojson`, `chapter`, `pl_video`. For example, `-o "%(title)s.%(ext)s" -o "thumbnail:%(title)s\%(title)s.%(ext)s"` will put the thumbnails in a folder with the same name as the video. If any of the templates (except default) is empty, that type of file will not be written. Eg: `--write-thumbnail -o "thumbnail:"` will write thumbnails only for playlists and not for video.
1140+
Additionally, you can set different output templates for the various metadata files separately from the general output template by specifying the type of file followed by the template separated by a colon `:`. The different file types supported are `subtitle`, `thumbnail`, `description`, `annotation` (deprecated), `infojson`, `link`, `pl_thumbnail`, `pl_description`, `pl_infojson`, `chapter`, `pl_video`. For example, `-o "%(title)s.%(ext)s" -o "thumbnail:%(title)s\%(title)s.%(ext)s"` will put the thumbnails in a folder with the same name as the video. If any of the templates is empty, that type of file will not be written. Eg: `--write-thumbnail -o "thumbnail:"` will write thumbnails only for playlists and not for video.
11411141

11421142
The available fields are:
11431143

yt_dlp/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ def set_default_compat(compat_name, opt_name, default=True, remove_compat=True):
335335
if _video_multistreams_set is False and _audio_multistreams_set is False:
336336
_unused_compat_opt('multistreams')
337337
outtmpl_default = opts.outtmpl.get('default')
338+
if outtmpl_default == '':
339+
outtmpl_default, opts.skip_download = None, True
340+
del opts.outtmpl['default']
338341
if opts.useid:
339342
if outtmpl_default is None:
340343
outtmpl_default = opts.outtmpl['default'] = '%(id)s.%(ext)s'

0 commit comments

Comments
 (0)