NAME
ytunnel
—
download content from YouTube in large
batches
SYNOPSIS
ytunnel |
[-Vv ]
[-f register]
[-t type] dir |
DESCRIPTION
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
register. 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 mp4, 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:
-f
register- Use the register file specified by register rather than the default location (see section FILES).
-t
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.
-V
- Display the version number and exit.
-v
- Download video files rather than audio files. Note that this does
not 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.
FILES
- $XDG_CONFIG_HOME/ytunnel/register
- Default register file location. If
XDG_CONFIG_HOME
is not set, $HOME/.config is used in its place.
EXAMPLES
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 mkv, 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 .