Friday 21 November 2014

Downloading Youtube video based on Command in Fedora Linux

You all will be wondered on how to Downloading youtube.com videos to local machine is always a challenge as the streaming sites keep on updating their policies in blocking the videos.
Here is a tool that is available in the command line (Terminal based) on Linux Operating Systems.
That is youtube-dl, this is a python based code and can be executed in linux OS without any hassles.

youtube-dl in windows or Mac OS can be achieved by installing python interpreter and try it.
for installing in linux, the command is
 
$prompt] sudo yum install youtube-dl (in redhat or centos or fedora)
$prompt] sudo apt-get install youtube-dl (ubuntu or linux mint)


For Ubuntu users, you can update the sudo package before installing the youtube-dl.
sudo apt-get update

To download videos 
$prompt] youtube-dl https://www.youtube.com/watch?v=cYg5VCV3zeU


The above is output and to download the corresponding video format, then here is the command
$prompt] youtube-dl -f 18 To view all formats, use the following command,
$prompt] youtube-dl -F http://www.youtube.com/watch?v=cYg5VCV3zeU
[youtube] Setting language
[youtube] cYg5VCV3zeU: Downloading webpage
[youtube]cYg5VCV3zeU: Downloading video info webpage
[youtube] cYg5VCV3zeU: Extracting video information
[info] Available formats for cYg5VCV3zeU:
 

format code extension resolution  note
139         m4a       audio only  DASH audio , audio@ 48k (worst)
140         m4a       audio only  DASH audio , audio@128k
160         mp4       192p        DASH video
133         mp4       240p        DASH video
17          3gp       176x144  
36          3gp       320x240  
5           flv       400x240  
18          mp4       640x360     

43          webm      640x360     (best)


The above is output and to download the corresponding video format, then here is the command
$prompt] youtube-dl -f 18 http://www.youtube.com/watch?v=cYg5VCV3zeU
The above command will download the file in the mp4 format as specified in the option obtained in the previous command.

if you need any help on the commands, you can use the following command
$prompt] youtube-dl --help

Often, youtube-dl is updated, it can be easily updated as given below,
$prompt] sudo youtube-dl -U

Also now youtube-dl supports various other video streaming sites also, to name a few, vimeo.com, dailymotion.com, etc.

If you are behind the proxy, type the command in the terminal use this
export http_proxy=172.16.1.1:8080/ 
or else copy the above line in /etc/profile.d/proxy.sh (this will be set for all the users of the computer, also need root password)


The above command will download the file in the mp4 format as specified in the option obtained in the previous command.

if you need any help on the commands, you can use the following command
$prompt] youtube-dl --help

Often, youtube-dl is updated, it can be easily updated as given below,
$prompt] sudo youtube-dl -U

Also now youtube-dl supports various other video streaming sites also, to name a few, vimeo.com, dailymotion.com, etc.

If you are behind the proxy, type the command in the terminal
export http_proxy=172.16.1.1:8080/ 
or copy the above line in /etc/profile.d/proxy.sh (this will be set for all the users of the computer, also need root password)

 

No comments:

Post a Comment