Using youtube-dl/ffmpeg to download Youtube videos/playlists and convert to mp3

youtube-dl is a small command-line python program to download videos from YouTube.com and a few more sites.

## install
$(el) sudo yum install youtube-dl ffmpeg(RPMforge)
$(deb) sudo apt-get install youtube-dl ffmpeg(>=15.04)|libav-tools(<=14.10)
$(osx) brew install youtube-dl ffmpeg
$(arch) sudo pacman -S youtube-dl ffmpeg
$(pip) sudo pip install -U youtube-dl
$(bin) sudo wget https://yt-dl.org/latest/youtube-dl -O /usr/local/bin/youtube-dl ; sudo chmod a+x /usr/local/bin/youtube-dl

youtube-dl [OPTIONS] URL [URL...] (where URL can also be a playlist)

# video formats
'-F,--list-formats' list available formats
'-f,--format FORMAT' download selected format
'--max-quality FORMAT' highest quality format to download
$ youtube-dl -f 17 URL

# filesystem/download options
'-a,--batch-file FILE' file containing URLs to download, - to stdin
'-o,--output TEMPLATE' output filename template, e.g.: 'downloads/%(uploader)s/%(title)s-%(id)s.%(ext)s'
'-c,--continue' force resume of partially downloaded files
'-i,--ignore-errors' continue on download errors, e.g.: skip unavailable videos in a playlist
'-w,--no-overwrites' do not overwrite files
$ youtube-dl -a FILE

# post-processing (e.g: extract audio)
'-x,--extract-audio' convert video files to audio-only files (requires ffmpeg or avconv and ffprobe or avprobe)
'--audio-format FORMAT' best(default), aac, vorbis, mp3,m4a, opus or wav
'--recode-video FORMAT' encode the video to another format (mp4,flv,ogg,webm,mkv)
$ youtube-dl PlaylistURL -cit --max-quality FORMAT --extract-audio --audio-format mp3

from save youtube videos, install ffmpeg and download youtube playlist

clipgrab is an alternative to youtube-dl. Its a GUI app that grabs URLs from clipboard and adds them to a download list.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s