Make yt-dlp easy to use: Difference between revisions
From Pengwings
No edit summary |
No edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Easy-ish to use short-term replacement for GRAB.BAT for Linux. Make yt-dlp command line less of a headache by aliasing it. | Easy-ish to use short-term replacement for GRAB.BAT for Linux. Make yt-dlp command line less of a headache by aliasing it. Also adds a shitty help command in case you forgot how to use it. | ||
Install yt-dlp from your package manager e.g. | Install yt-dlp from your package manager e.g. | ||
| Line 7: | Line 7: | ||
vim ~/.bashrc.d/grab | vim ~/.bashrc.d/grab | ||
alias grab='printf "=========================================\nLazy grab commands for Linux (yt-dlp)\n=========================================\ | 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-audiolist <url>\n grab-videolist <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-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-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- | alias grab-audiolist='grab-audio -a' | ||
alias grab- | alias grab-videolist='grab-video -a' | ||
For help: | For help: | ||
grab | 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: | To grab audio: | ||
grab-audio <nowiki>https://www.youtube.com/watch?v=rvAGUO27FNw</nowiki> | grab-audio <nowiki>https://www.youtube.com/watch?v=rvAGUO27FNw</nowiki> | ||
| Line 20: | Line 32: | ||
grab-video <nowiki>https://www.youtube.com/watch?v=9HXT7fDkf9I</nowiki> | grab-video <nowiki>https://www.youtube.com/watch?v=9HXT7fDkf9I</nowiki> | ||
To grab a playlist of audio tracks: | To grab a playlist of audio tracks: | ||
grab- | grab-audios playlist.txt | ||
To grab a playlist of video tracks: | To grab a playlist of video tracks: | ||
grab- | grab-videos playlist.txt | ||
Latest revision as of 00:32, 8 March 2026
Easy-ish to use short-term replacement for GRAB.BAT for Linux. Make yt-dlp command line less of a headache by aliasing it. Also adds a shitty help command in case you forgot how to use 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-audiolist <url>\n grab-videolist <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-audiolist='grab-audio -a' alias grab-videolist='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