Sometimes you need videos for offline viewing, whether it’s for a presentation, a flight, or just spotty internet. youtube-dl handles individual videos, playlists, and even lets you pick the quality. The file size limit flag is handy when you’re on a metered connection.
Download the binary form youtube-dl website
1
2
3
4
5
6
7
| $ tar -xvf youtube-dl-xxxx.xx.xx.tar.gz
$ cp youtube-dl to /usr/local/bin
$ cd /usr/local/bin
$ chmod u+x youtube-dl
|
1
| $ youtube-dl <youtube video ulr> or <the section after v=>
|
1
2
3
4
5
| $ youtube-dl https://www.youtube.com/watch\?v\=1322fas
$ #or
$ youtube-dl 1322fas
|
1
| $ youtube-dl <youtube playlist ulr> or <the section after list=>
|
1
2
3
4
5
| $ youtube-dl https://www.youtube.com/watch?v=NB11111115k8&list=PLGpUl111111111113fasmkN&ab_channel=channelname
$ #or
$ youtube-dl PLGpUl111111111113fasmkN
|
- restrict file size of video or playlist
1
| $ youtube-dl -if 'best[filesize<200M]' URL
|
- get the availabale files for download
1
| $ youtube-dl -F https://www.youtube.com/watch\?v\=1322fas
|
- download the best file (audio + video)
1
| $ youtube-dl -f best https://www.youtube.com/watch\?v\=1322fas
|