How to download videos or audios

Do you need an easy way to download audios and videos from youtube?
Youtube-dl is the answer.
You can read how to do it (easy way) by terminal or web further below:

PMYTD (Poor Man’s Youtube Downloader)

Youtube-dl is the first app in my list when I need to download a Youtube video or audio.
But, when I want to do this, I don’t remember the options what i have to type.
Then, I need to google it or to read the “man pages” to remember that.

PMYTD makes using youtube-dl very easy.

With PMYTD you can:

  • Download videos from YouTube in 4K and 1080P.
  • Download and extract HQ audio (320 kbps MP3) from YouTube videos.
  • Download entire YouTube video playlists in 4K and 1080P.
  • Download and extract HQ audio (320 kbps MP3) from YouTube playlists.
  • Install youtube-dl if it’s not available.
  • Update youtube-dl to the latest version.

Instalation

You need to have following applications installed in order to function: youtube-dl, Python, Wget and FFmpeg.

Download pmytd-master zip, extract its contents and copy pmytd file to /usr/local/bin/ directory,

$ sudo cp pmytd /usr/local/bin/

Make it executable

$ sudo chmod a+x /usr/local/bin/pmytd  

Usage

$ pmytd

Aliases

An Alias allows to create simple names or abbreviations (even consisting of just a single character) for commands regardless of how complex the original commands are and then use them in the same way that ordinary commands are used.

Create an alias for downlaod best quallity video:

$ echo alias yt-best='youtube-dl -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio" ' >> ~/.bash_aliases && source ~/.bash_aliases  

Create an alias for download best quallity audio:

$ echo alias yt-mp3='youtube-dl --extract-audio -f bestaudio[ext=mp3] --no-playlist ' >> ~/.bash_aliases && source ~/.bash_aliases  

Maybe the mp3 format is not available, then just create a more simple command:

$ echo alias yt-audio='youtube-dl --extract-audio ' >> ~/.bash_aliases && source ~/.bash_aliases  

Create an alias for download a video playlist:

$ echo alias yt-vplaylist='youtube-dl -o "./%(playlist_title)s/%(playlist_index)s_%(title)s.%(ext)s" ' >> ~/.bash_aliases && source ~/.bash_aliases  

Create an alias for download an audio playlst:

$ echo alias yt-aplaylist='youtube-dl --extract-audio --audio-format mp3 -o "./%(playlist_title)s/%(playlist_index)s_%(title)s.%(ext)s" ' >> ~/.bash_aliases && source ~/.bash_aliases  

If you want to check your current aliases just type:

$ alias  

For refresh aliases and functions after defining new aliases and functions:

$ source ~/.bashrc

And then to use. Example:

$ yt-best <link>  

Websites to Download audios and videos

Videos: alltubedownload.net

Audio and videos: clipconverter.cc

References