I found this cool Reddit link here which basically does what the title says, but this stuff felt a bit confusing to me. Can somebody please suggest if there's a better way to download the automatically generated YouTube captions / subtitles if you want to call those that from a playlist which can be either public or private?
1 Answer
The script you linked to is overkill because it tries to grab subtitles from several videos in a playlist without taking advantage of the fact that, for several years now, youtube-dl
has accepted playlists as input in addition to videos. Regardless, what you want can be done in a line of code.
Download and install the latest version of
youtube-dl
for your operating system.Run the following command:
youtube-dl <URL-to-video-or-playlist> --skip-download --write-auto-sub
If you want the video in addition to the subtitle file remove the
--skip-download
option.Once the files have been downloaded, you'll find them in the folder you ran the command in. They will likely be
.vtt
files but could also be.srt
or other common subtitle formats.
-
1