-
Notifications
You must be signed in to change notification settings - Fork 0
/
ytunnel.1
149 lines (147 loc) · 3.57 KB
/
ytunnel.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
.Dd $Mdocdate: Dec 20 2023 $
.Dt YTUNNEL 1
.Os
.Sh NAME
.Nm ytunnel
.Nd download content from YouTube in large batches
.Sh SYNOPSIS
.Nm ytunnel
.Bk -words
.Op Fl Vv
.Op Fl f Ar register
.Op Fl t Ar type
.Ar dir
.Ek
.Sh DESCRIPTION
.Nm
downloads content from the Internet video website YouTube.
It leverages
.Xr yt-dlp 1
to download the content, and
.Xr ffmpeg 1
to convert the content to the specified format.
The content, once downloaded and converted, will be placed in the
directory specified by
.Ar dir .
By default
.Nm
outputs audio files of file type
.Em flac ,
but this can be changed by specifying the
.Fl v
and
.Fl t
options described below.
.Pp
.Nm
uses a file written in a certain format to describe the content that
should be retrieved. This file is named the
.Em 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
.Sx FILES
section of this manual.
.Pp
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.
.Pp
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
.Em mp4 ,
a title
.Dq Learn the Greek Alphabet in 10 minutes
would become
.Dq Learn the Greek Alphabet in 10 minutes.mp4 .
.Pp
If a line begins with a hash character
.Sm off
(
.Dq #
),
.Sm on
it is classified as a
.Dq comment line
and is ignored. This can be used to divide a register into different sections
for instance.
.Pp
As an example, here is a valid register file:
.Pp
.Dl # videos
.Dl https://www.youtube.com/watch?v=BaW_jenozKc
.Dl https://youtu.be/w0JzdPqlSmg
.Dl jNQXAC9IVRw Me at the zoo
.Pp
The options are as follows:
.Bl -tag -width keyword
.It Fl f Ar register
Use the register file specified by
.Ar register
rather than the default location (see section
.Sm off
.Sx FILES
).
.Sm on
.It Fl t Ar type
Convert content to the file type specified by
.Ar type
(default is
.Sm off
.Em flac
).
.Sm on
The
.Ar type
argument is not checked for errors and is directly passed to
.Xr ffmpeg 1 ,
which will fail if
.Ar type
is invalid.
.It Fl V
Display the version number and exit.
.It Fl v
Download video files rather than audio files. Note that this does
.Sy not
change the default conversion file type from
.Em flac
to a video format, meaning your video files will be converted to
audio after they are downloaded. Use
.Fl 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.
.Sh FILES
.Bl -tag -width iiii
.It Pa $XDG_CONFIG_HOME/ytunnel/register
Default register file location. If
.Ev XDG_CONFIG_HOME
is not set,
.Pa $HOME/.config
is used in its place.
.El
.Sh EXAMPLES
Retrieve all content in the register at path
.Pa myregister
and place them in the directory
.Pa ~/music :
.Pp
.Dl ytunnel -f myregister ~/music
.Pp
Retrieve all content in the register as video files of type
.Em mkv ,
and place them in the directory
.Pa videos :
.Pp
.Dl ytunnel -v -t mkv videos
.Pp
Retrieve all content in the default register with default settings, and
place them in the current directory:
.Pp
.Dl ytunnel\ .
.Pp
.Sh SEE ALSO
.Xr ffmpeg 1