sunmingtao / sample-code

3 stars 4 forks source link

How to use command line to download Youtube videos #172

Closed sunmingtao closed 3 years ago

sunmingtao commented 3 years ago
homebrew install youtube-dl
homebrew install youtube-dl ffmpeg

To download a single video:

youtube-dl https://www.youtube.com/watch?v=F4zhJHw-BpA&list=PLkvG4EWPDB0lfJhiP-M9JYlW-IRph5RI7&index=2&t=0s

To download the entire play list:

youtube-dl --yes-playlist -v https://www.youtube.com/playlist?list=PLkvG4EWPDB0lfJhiP-M9JYlW-IRph5RI7

If on ubuntu,

/usr/local/bin/youtube-dl --yes-playlist -v https://www.youtube.com/playlist?list=PLtt_YYUGi1gV5RkVA3BSaPtENyH-5AcX6

sunmingtao commented 3 years ago

To uninstall youtube-dl

sudo apt-get remove youtube-dl

To install the latest youtube-dl on ubuntu

sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
sunmingtao commented 2 years ago

Download part of the list

/usr/local/bin/youtube-dl --playlist-start 20 --playlist-end 100 <play list>