YT-DLP aliases
Aliases for yt-dlp for 720p, 1080p and 4k. You can use them on Windows as well, just put yt-dlp in PATH and use GitBash or WSL. File goes to Documents, mp4 format.
Prereq: FFmpeg
You need this dep. On windows you can get it here: https://www.gyan.dev/ffmpeg/builds/
1
2
3
4
5
6
7
8
# yt-dlp 1080p
alias ytdl1080='f(){ yt-dlp -f "bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" -o "~/Documents/%(title)s.%(ext)s" "$1"; unset -f f; }; f'
# yt-dlp 720p
alias ytdl720='f(){ yt-dlp -f "bestvideo[height<=720][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" -o "~/Documents/%(title)s.%(ext)s" "$1"; unset -f f; }; f'
# yt-dlp 4k
alias ytdl4k='f(){ yt-dlp -f "bestvideo[height<=2160][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" -o "~/Documents/%(title)s.%(ext)s" "$1"; unset -f f; }; f'
For powershell
1
2
3
function ytdl1080($url) { yt-dlp -f "bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" -o "$HOME\Documents\%(title)s.%(ext)s" $url }
function ytdl720($url) { yt-dlp -f "bestvideo[height<=720][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" -o "$HOME\Documents\%(title)s.%(ext)s" $url }
function ytdl4k($url) { yt-dlp -f "bestvideo[height<=2160][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" -o "$HOME\Documents\%(title)s.%(ext)s" $url }
Usage
1
ytdl1080 "https://www.youtube.com/watch?v=example"
This post is licensed under
CC BY 4.0
by the author.