]> jfr.im git - yt-dlp.git/commitdiff
[outtmpl] Handle `-o ""` better
authorpukkandan <redacted>
Tue, 1 Feb 2022 00:45:36 +0000 (06:15 +0530)
committerpukkandan <redacted>
Tue, 1 Feb 2022 00:51:36 +0000 (06:21 +0530)
Since the specific type of file is not downloaded when giving `-o "<type>:"`,
now `-o ""` acts as an alias to `--skip-download`

README.md
yt_dlp/__init__.py

index ae09262c37124e6ec250c4a697b4d9167b5a7966..01325e906da1b262badc6cc9a6a2681c68cdeea2 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1137,7 +1137,7 @@ # OUTPUT TEMPLATE
 %(name[.keys][addition][>strf][,alternate][&replacement][|default])[flags][width][.precision][length]type
 ```
 
-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.
+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.
 
 The available fields are:
 
index f9ebfa053566605bf33cf16d48f269fcf689a8f7..b93f47ecc9be42c101b9603266a45b778f82a93c 100644 (file)
@@ -335,6 +335,9 @@ def set_default_compat(compat_name, opt_name, default=True, remove_compat=True):
     if _video_multistreams_set is False and _audio_multistreams_set is False:
         _unused_compat_opt('multistreams')
     outtmpl_default = opts.outtmpl.get('default')
+    if outtmpl_default == '':
+        outtmpl_default, opts.skip_download = None, True
+        del opts.outtmpl['default']
     if opts.useid:
         if outtmpl_default is None:
             outtmpl_default = opts.outtmpl['default'] = '%(id)s.%(ext)s'