Updated 2024-10-27: Recent blocking attempts have made downloading videos more difficult. I recommend downloading videos outside of the USA. I also recommend looking at alternative clients for watching videos such as Invidious and GrayJay.
YouTube’s been forcing creators to censor their works more and more, and often times after a successful publish of said content. More history and valuable information is being lost every day because a corporation controls the largest source of video content freely available.
At the same time, I’ve been running commands using yt-dlp over and over again for my own purposes, aside from this censorship. The syntax is relatively easy to forget despite being very clearly defined, so I finally made a script to handle it for me.
It’s in Lua because that’s what I prefer to use, and available on GitHub. Because it is based on yt-dlp, it works for any website supported by yt-dlp. Here’s how to use it:
Usage:
./video-dl.lua [action] <url>
[action]: What is desired.
video (default): Highest quality video (maximum 720p).
backup, clone, copy: English subtitles (including automatic subtitles), thumbnail, description, highest quality video (maximum 720p).
music, audio: Highest quality audio only.
metadata, meta: English subtitles (including automatic subtitles), thumbnail, description.
<url>: Source. YouTube URL expected, but should work with anything yt-dlp works with.
Information wants to be free. Help it.