Make yt-dlp easy to use
From Pengwings
Easy-ish to use short-term replacement for GRAB.BAT for Linux. Make yt-dlp command line less of a headache by aliasing it.
Install yt-dlp from your package manager e.g.
sudo rpm-ostree install yt-dlp
Add grab aliases:
mkdir ~/.bashrc.d vim ~/.bashrc.d/grab
alias grab='printf "=====================================================\nLazy grab commands for Linux (yt-dlp)\n=====================================================\nTo grab single files:\n grab-audio <url>\n grab-video <url>\nTo grab playlists:\n grab-audios <url>\n grab-videos <url>\nFiles are downloaded into the working directory.\n"' alias grab-audio='yt-dlp --format "bestaudio/best" --audio-format mp3 --extract-audio -o "%(title)s-%(id)s.%(ext)s" --verbose' alias grab-video='yt-dlp --format "bestvideo+bestaudio[ext=m4a]/bestvideo+bestaudio/best" --merge-output-format mp4 -o "%(title)s-%(id)s.%(ext)s" --verbose' alias grab-audios='grab-audio -a' alias grab-videos='grab-video -a'
For help:
grab
Which prints:
=====================================================
Lazy grab commands for Linux (yt-dlp)
=====================================================
To grab single files:
grab-audio <url>
grab-video <url>
To grab playlists:
grab-audios <playlist.txt>
grab-videos <playlist.txt>
Files are downloaded into the working directory.
To grab audio:
grab-audio https://www.youtube.com/watch?v=rvAGUO27FNw
To grab video:
grab-video https://www.youtube.com/watch?v=9HXT7fDkf9I
To grab a playlist of audio tracks:
grab-audios playlist.txt
To grab a playlist of video tracks:
grab-videos playlist.txt