YTUNNEL(1) General Commands Manual YTUNNEL(1)

ytunneldownload content from YouTube in large batches

ytunnel [-Vv] [-f register] [-t typedir

ytunnel downloads content from the Internet video website YouTube. It leverages yt-dlp(1) to download the content, and ffmpeg(1) to convert the content to the specified format. The content, once downloaded and converted, will be placed in the directory specified by dir. By default ytunnel outputs audio files of file type flac, but this can be changed by specifying the -v and -t options described below.

ytunnel uses a file written in a certain format to describe the content that should be retrieved. This file is named the . In this file, each line should consist of a YouTube video URL. The plain video ID is also accepted. Its location can be found in the FILES section of this manual.

Following the URL, a title can optionally be provided after a space character. This specifies the name of the output file that is downloaded from the given YouTube video. If this is not given, a request is made to youtube.com to retrieve the video's title, and this is done before any content is retrieved.

After the content has been converted, the name of the output file takes the name of the content given in the register, or if this is not given, the name of the YouTube video. The title, manually provided or not, always has a dot character followed by the file type concatenated on the end of the file name. Using the file type , a title “Learn the Greek Alphabet in 10 minutes” would become “Learn the Greek Alphabet in 10 minutes.mp4”.

If a line begins with a hash character ( “#”), it is classified as a “comment line” and is ignored. This can be used to divide a register into different sections for instance.

As an example, here is a valid register file:

# videos
https://www.youtube.com/watch?v=BaW_jenozKc
https://youtu.be/w0JzdPqlSmg
jNQXAC9IVRw Me at the zoo

The options are as follows:

register
Use the register file specified by register rather than the default location (see section FILES).
type
Convert content to the file type specified by type (default is flac). The type argument is not checked for errors and is directly passed to ffmpeg(1), which will fail if type is invalid.
Display the version number and exit.
Download video files rather than audio files. Note that this does change the default conversion file type from flac to a video format, meaning your video files will be converted to audio after they are downloaded. Use -t with this flag to set a sensible video format to convert to afterwards, otherwise your content will be converted to audio, slowing your download speeds with no good result.

$XDG_CONFIG_HOME/ytunnel/register
Default register file location. If XDG_CONFIG_HOME is not set, $HOME/.config is used in its place.

Retrieve all content in the register at path myregister and place them in the directory ~/music:

ytunnel -f myregister ~/music

Retrieve all content in the register as video files of type , and place them in the directory videos:

ytunnel -v -t mkv videos

Retrieve all content in the default register with default settings, and place them in the current directory:

ytunnel .

ffmpeg(1)

December 20, 2023 OpenBSD 7.4