Youtube-dl snippets

Youtube-dl is a powerful command line utility for downloading video and audio from youtube. Here is my list of most common usages.

Installation & Update

Best way to get it using python’s pip.

$ pip install youtube-dl

If you’re getting an error, there’s a great chance that updating will fix the issue. To update run:

$ pip install -U youtube-dl

List of snippets

# download as mp3 in best quality
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 --add-metadata <youtube-url>

# download playlist 
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 --add-metadata -i <plailist-id>

# get available format 
youtube-dl -F <youtube-url>

# download thumbnail
youtube-dl <youtube-url> --skip-download --write-thumbnail

# download description
youtube-dl --skip-download --write-description <youtube-url>

# download best audio quality in a specific format
youtube-dl -ci -f "bestaudio[ext=m4a]" <youtube-url>

# download best audio quality in original format with thumbnail
youtube-dl -ci -f "bestaudio" --write-thumbnail <youtube-url>

# download playlist in best quality, original format, with thumbnails and description
youtube-dl -ci -f "bestaudio" --write-thumbnail --write-description <plailist-id>

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s