Version: 0.8.9 Updated: 23 November 2023
Downloads video and audio files from YouTube using the yt-dlp(1) utility.
$ kimono.sh --help
...
$ CONFIG="options" kimono.sh ids...
...
$ kimono.sh --options ids...
...
This script can be called with different names to perform particular functions. To download files using configuration values that are optimised for specific types of content, the following script names have been defined:
- youtube.sh: Download videos as MP4 with qualty audio at up to 1080p resolution.
- podcast.sh: Download a podcast with low quality video and decent audio.
- audio.sh: Download the audio only as best quality MP3.
- video.sh: Download videos with best overall quality.
The following environment variables can be used to apply or override configuration:
FORMAT
: Configure the format to download directly, using theyt-dlp
format specifications. Use--format-list
to get a list of the available formats, and check the manual page and documentation foryt-dlp
itself for more in-depth information about creating custom specifications.QUALITY
: Set different pre-defined format specifications.SCRIPT
: Enable different script functionality.FRAGMENTS
: Enable downloading multiple fragments in parallel.PLAYLIST
: Set the name of the file containing ids or urls.TARGET
: Set the target folder to save files to.ORDER
: Either random or sequential order for playlist downloads.CONFIG
: Additional configuration options foryt-dlp
.
These variables can be set in the global shell environment to set the base folder used for all file downloads of specific types:
MOVIES
: Sets the target folder base for video files. Defaults to the~/Movies
folder.MUSIC
: Sets the target folder base for audio files. Defaults to the~/Music
folder.
These variables can be set to configure output logging:
DRYRUN
: Displayyt-dlp
command without executing.DEBUG
: Enable script debug output. Set to trace for full command logging.QUIET
: Only show progress of downloads.VERBOSE
: Verbose logging foryt-dlp
process.
Various command-line options can be used in combination with the environment variables above to configure operation. The following options require a value to be specified:
--format
|-F
|-f
format ; seeFORMAT
--quality
|-Q
|-q
quality ; seeQUALITY
--script
|-S
|-s
script ; seeSCRIPT
--playlist
|-P
|-p
filename ; seePLAYLIST
--fragments
n ; seeFRAGMENTS
--target
|-T
|-t
folder ; seeTARGET
--order
order ; seeORDER
These options for debugging and output configuration do not need a value:
--debug
; seeDEBUG
--trace
; seeDEBUG
--dryrun
; seeDRYRUN
--quiet
; seeQUIET
--verbose
; seeVERBOSE
These options will execute portions of the script which provide additional functionality. The script operates differently from its default behaviour, but still uses the same shared variables and configuration:
--list-formats
: List available formats for the video ids.--javascript
: Generate the JS code to create a playlist file from a YouTube mix.--find-ids
: Search for files in the targetMovies
folder by id.--duplicates
: Search the targetMovies
folder for files with the same id.
These options display usage, help or version information:
--usage
--help
|-h
|-?
--version
|-v
The configuration values set using environment variables will be overridden
by values set using the command-line options. So, the following command will
download the video into the ${MOVIES}/Lectures/MIT-1001/
target folder:
TARGET=Courses/MIT-1001 kimono.sh --target Lectures/MIT-1001 XXXXXXXX
kimono.sh --format 18 -T Interesting/Science XXXXXXXX YYYYYYYY ZZZZZZZZ
FORMAT="139+340" FRAGMENTS="2" PLAYLIST="catalog.out" kimono.sh
kimono.sh --quality "podcast" XXXXXXXX
youtube.sh --order PPPPPPPPPPPPPPPP
audio.sh -P mixtape.txt
podcast.sh XXXXXXXX
video.sh --quiet XXXXXXXX
cut -d, -f2 videos.csv | youtube.sh
DEBUG=y SCRIPT=video kimono.sh XXXXXXXX
kimono.sh --list-formats --playlist "index.txt"
kimono.sh --find-ids XXXXXXXX YYYYYYYY
PLAYLIST="mixtape.txt" kimono.sh --javascript
kimono.sh --duplicates -T Recent
Copyright: 2023 by Andrew Donald Kennedy
License: CC BY-SA 4.0
Author: andrew.international@gmail.com
Source: grkvlt/kimono-channel-access