yt-dlp をインストールする。
YouTube や TVer などから動画のダウンロードが出来るコマンドラインプログラムです。
fedora43:~$ sudo dnf install yt-dlp
パスの通っているディレクトリに Deno をインストールする。
fedora43:~$ curl -fsSL https://deno.land/x/install/install.sh | sudo DENO_INSTALL=/usr/local sh
YouTube をダウンロードすると、webm が保存されます。mp4 にしたい場合は、
-f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b"
「File name too long」エラー対応。(タイトルを 50 文字に制限,ID を付けて重複回避)
--output "%(title).50s [%(id)s].%(ext)s"
GitHub からの EJS スクリプトの自動更新を有効にする。
--remote-components ejs:github
上記オプションを全部付けると、↓
fedora43:~$ yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b" --output "%(title).50s [%(id)s].%(ext)s" --remote-components ejs:github 動画URL
カレントディレクトリにダウンロードされます。