Video Download Tool - youtube-dl

Youtube-dl is a very useful tool which can be used to download videos from many supported sites. You can find the list of sites supported in this link. I thought to share some of the useful codes that can be used to download videos from various popular sites.
Download and installation instructions and documentation.


Useful commands:

Suppress output, error messages and download in background
[pre class="brush:bash"]
nohup youtube-dl https://www.youtube.com/***** -i &
[/pre]
Download the videos listed in a text file
[pre class="brush:bash"]
nohup youtube-dl -a down.txt -i &
[/pre]
Download the highest quality video
[pre class="brush:bash"]
nohup youtube-dl -f 22 -a down.txt -i &
[/pre]
download the highest quality video
[pre class="brush:bash"]
nohup youtube-dl -f 22 -a down.txt -i &
[/pre]
download the playlist and start from 1
[pre class="brush:bash"]
nohup youtube-dl -f 22 -a down.txt --playlist-start 1 -i &
[/pre]
download the highest quality video (even 1080p) - this requires installation of avconv or ffmpeg
[pre class="brush:bash"]
nohup youtube-dl -f bestvideo+bestaudio -a down.txt -i &
[/pre]
extract the audio only
[pre class="brush:bash"]
nohup youtube-dl https://www.youtube.com/jkIeAuOWdFRwF -x --audio-format "mp3" --audio-quality 0 --playlist-start 29 -i &
[/pre]
download the best quality video and audio separately and combine them
[pre class="brush:bash"]
nohup youtube-dl -f bestvideo+bestaudio -a down.txt -i &
[/pre]
download the best quality video and audio separately and combine them into a mp4 format
[pre class="brush:bash"]
nohup youtube-dl -f bestvideo+bestaudio -a down.txt --merge-output-format "mp4" -R "infinite" --prefer-avconv -i &
[/pre]
code to testing the video link (this outputs the available formats and other parameters)
[pre class="brush:bash"]
youtube-dl link -F --skip-download -v
[/pre]
another way to download the high quality video is to identify the video format using the above command and use them in the callback
[pre class="brush:bash"]
nohup youtube-dl -f 137+140 -a down.txt --merge-output-format "mp4" -R "infinite" --socket-timeout 5000 -i &
[/pre]
playlist download (working)
[pre class="brush:bash"]
nohup youtube-dl -f 137+140 -a down.txt --playlist-start 18 --playlist-end 24 --merge-output-format "mp4" -R "infinite" -i &
[/pre]
auto numbering
[pre class="brush:bash"]
nohup youtube-dl -a down --autonumber-start 1 -o '%(autonumber)s_%(title)s.%(ext)s' &
[/pre]
it is difficult or impossible to install ffmpeg in osmc, use following command to install avconv
[pre class="brush:bash"]
sudo apt-get install libav-tools
[/pre]
copying the file at a regular interval to another drive in the background
[pre class="brush:bash"]
while true; do sleep 1800; mv *.mp4 /sda1/data; done &
[/pre]
[pre class="brush:bash"][/pre]


You may also interested in reading:

No comments:

Post a Comment