Youtube-dl

Jump to: navigation, search


youtube-dl is a popular open source cross-platform CLI (Command Line Interface) tool written in python and used for downloading videos/audio from YouTube, Vimeo, Twitter, among other media sites

Installation

To install youtube-dl

zypper in youtube-dl

Basic usage

you can start simple by using: (which will download the best avaliable format)

youtube-dl -f 22 $link

List available resolutions and formats

youtube-dl -F $link

Tips and tricks

Use -q flag to enter quiet mode and hide all download details.

youtube-dl -q $link

if your download got interrupted or failed you can use -c flag to resume downloading instead of starting over. Remeber to check if you're still in the same directory.

youtube-dl -c $link

In case you want to pipe a youtube video (for example) to another streaming tool like ffmpeg, you can use -g or --get-url flag to return a direct link

youtube-dl -g $link

When you're downloading seperate video/audio and there's a need to merge them you can use --merge-output-format <FORMAT>

youtube-dl -f "bestvideo[height<=720][ext=mp4]+bestaudio/best" --merge-output-format mp4 $link

Use -o <TEMPLATE> to make filenames follow a certain pattern, like:

youtube-dl -o "%(playlist_index)s-%(title)s.%(ext)s" $link

Finally, you can save your prefered commands in ~/.config/youtube-dl/config to always use them as preferences, like so:

# Lines starting with # are comments

# Always extract audio
-x

# Do not copy the mtime
--no-mtime

# Use this proxy
--proxy 127.0.0.1:3128

# Save all videos under Movies directory in your home directory
-o ~/Movies/%(title)s.%(ext)s


See also

External links