Download Video Youtube With FreeBSD Youtube dl Command Line

Have you at least once in your life had the desire to save your favorite video or audio from the Internet on your computer? But how could it be that the website didn’t have the treasured Download button? It is for such cases that the free cross-platform utility youtube-dl is intended: it allows you to download audio and video files, knowing only the address of the page where the file is located.

The youtube-dl application is a small command line program for downloading videos from YouTube.com, metacafe.com, google videos, photobucket videos, yahoo video, dailymotion and others. youtube-dl is a Python-based utility for downloading videos from various websites. The application can be run on Linux, FreeBSD or Windows operating systems.

This article will study how to use youtube-dl, what capabilities this utility provides the user, and what useful functions the developers provide. In writing this article we used the FreeBSD operating system.


1. Installing Youtube dl

On the FreeBSD operating system, youtube-dl installation can be done in several ways. The fastest way is to use the PKG package, but with PKG not all dependent libraries are completely installed. The best way is to use the FreeBSD ports system.

As a first step, install the Youtube dl dependency.
root@ns6:~ # pkg install tex-xetex tex-formats texlive-base ghc hs-pandoc rtmpdump
After all the dependencies above are installed, continue by installing the Youtube dl application.
root@ns6:~ # cd /usr/ports/www/youtube_dl
root@ns6:/usr/ports/www/youtube_dl # make config



If you want to use mp3 audio conversion please make sure multimedia/ffmpeg is built with the "LAME" option enabled. Use the "make clean" command to start the installation.
root@ns6:/usr/ports/www/youtube_dl # make install clean


2. How to Download Youtube dl

To successfully use the utility, you must correctly write commands in the terminal. The utility syntax is simple:

youtube-dl [OPTIONS] URL [URL...]

Main options:

-h, --help:                                Print this help text and exit
--version:                                Print program version and exit
-U, --update:                           Update this program to latest version.
-i, --ignore-errors:                 Continue on download errors
--abort-on-error:                    Abort downloading of further videos.
--dump-user-agent:                Display the current browser identification
--list-extractors:                      List all supported extractors
--extractor-descriptions:        Output descriptions of all supported extractors
--force-generic-extractor:      Force extraction to use the generic extractor
--default-search:                     Use this prefix for unqualified URLs.                                   
--ignore-config:                       Do not read configuration files. 
--config-location:                    Path Location of the configuration file                                   
--flat-playlist:                          Do not extract the videos of a playlist, only list them.
--mark-watched:                     Mark videos watched (YouTube only)
--no-mark-watched:                Do not mark videos watched (YouTube  only)
--no-color:                                Do not emit color codes in output

To download videos, our first step is to create a download folder "/tmp/YTDownload".
root@ns6:~ # mkdir -p /tmp/YTDownload
root@ns6:~ # cd /tmp/YTDownload
Then open the YouTube website, and copy the URL in the address bar menu, as shown below.



Run the following command in the terminal.



root@ns6:/tmp/YTDownload # youtube-dl 'https://www.youtube.com/watch?v=dMoCmLnak4w'
[youtube] dMoCmLnak4w: Downloading webpage
[dashsegments] Total fragments: 1
[download] Destination: Satu Keluarga Diserang Pria Bersenjata Tajam Terekam CCTV - LIS 21_11-dMoCmLnak4w.f136.mp4
[download] 100% of 9.07MiB in 00:06
[dashsegments] Total fragments: 1
[download] Destination: Satu Keluarga Diserang Pria Bersenjata Tajam Terekam CCTV - LIS 21_11-dMoCmLnak4w.f140.m4a
[download] 100% of 1022.10KiB in 00:00
[ffmpeg] Merging formats into "Satu Keluarga Diserang Pria Bersenjata Tajam Terekam CCTV - LIS 21_11-dMoCmLnak4w.mp4"
Deleting original file Satu Keluarga Diserang Pria Bersenjata Tajam Terekam CCTV - LIS 21_11-dMoCmLnak4w.f136.mp4 (pass -k to keep)
Deleting original file Satu Keluarga Diserang Pria Bersenjata Tajam Terekam CCTV - LIS 21_11-dMoCmLnak4w.f140.m4a (pass -k to keep)
root@ns6:/tmp/YTDownload #

The youtube-dl utility will be useful for anyone who wants to download music and videos from sites that do not provide a download function. It has many flexible settings and only one drawback, poor graphic display.
Iwan Setiawan

I Like Adventure: Mahameru Mount, Rinjani Mount I Like Writer FreeBSD

Post a Comment

Previous Post Next Post