Archive

Archive for October, 2014

Downloading youtube videos with youtube-dl

October 4, 2014 Leave a comment

Problem:
I wanted to download lots of youtube videos, but I did not want to do so by my usual watch and download method.

Solution:
youtube-dl is a small command-line program to download videos from YouTube.com and a few more sites.

A short feature list of things you can do.

1. You can download entire playlists.

user@computer:~/lectures/discrete_maths$ youtube-dl --rate-limit 4M https://www.youtube.com/playlist?list=PLTdIp1DywMlUpLHEg3ADhE6rrxhW_T5Rx
 PLTdIp1DywMlUpLHEg3ADhE6rrxhW_T5Rx: Downloading webpage
[download] Downloading playlist: Discrete Mathematics
 playlist Discrete Mathematics: Collected 19 video ids (downloading 19 of them)
[download] Downloading video #1 of 19
 Setting language
 Confirming age
 h_9WjWENWV8: Downloading webpage
 h_9WjWENWV8: Downloading video info webpage
 h_9WjWENWV8: Extracting video information
[download] Destination: Arsdigita 02 (Discrete Mathematics) Lecture 1_20-h_9WjWENWV8.mp4
[download]  42.6% of 184.48MiB at 525.55KiB/s ETA 03:26

2. You can interupt and continue from where you stopped.

user@computer:~/lectures/discrete_maths$ youtube-dl --rate-limit 1M https://www.youtube.com/playlist?list=PLTdIp1DywMlUpLHEg3ADhE6rrxhW_T5Rx
 PLTdIp1DywMlUpLHEg3ADhE6rrxhW_T5Rx: Downloading webpage
[download] Downloading playlist: Discrete Mathematics
 playlist Discrete Mathematics: Collected 19 video ids (downloading 19 of them)
[download] Downloading video #1 of 19
 Setting language
 Confirming age
 h_9WjWENWV8: Downloading webpage
 h_9WjWENWV8: Downloading video info webpage
 h_9WjWENWV8: Extracting video information
[download] Resuming download at byte 82488037
[download] Destination: Arsdigita 02 (Discrete Mathematics) Lecture 1_20-h_9WjWENWV8.mp4
[download] 100% of 184.48MiB in 03:22
[download] Downloading video #2 of 19
 BrDto0heyaQ: Downloading webpage
 BrDto0heyaQ: Downloading video info webpage
 BrDto0heyaQ: Extracting video information
[download] Destination: Arsdigita 02 (Discrete Mathematics) Lecture 2_20-BrDto0heyaQ.mp4
[download]  20.7% of 221.93MiB at 529.26KiB/s ETA 05:40^C
ERROR: Interrupted by user

user@computer:~/lectures/discrete_maths$ youtube-dl --rate-limit 1M https://www.youtube.com/playlist?list=PLTdIp1DywMlUpLHEg3ADhE6rrxhW_T5Rx
 PLTdIp1DywMlUpLHEg3ADhE6rrxhW_T5Rx: Downloading webpage
[download] Downloading playlist: Discrete Mathematics
 playlist Discrete Mathematics: Collected 19 video ids (downloading 19 of them)
[download] Downloading video #1 of 19
 Setting language
 Confirming age
 h_9WjWENWV8: Downloading webpage
 h_9WjWENWV8: Downloading video info webpage
 h_9WjWENWV8: Extracting video information
[download] Arsdigita 02 (Discrete Mathematics) Lecture 1_20-h_9WjWENWV8.mp4 has already been downloaded
[download] Downloading video #2 of 19
 BrDto0heyaQ: Downloading webpage
 BrDto0heyaQ: Downloading video info webpage
 BrDto0heyaQ: Extracting video information
[download] Resuming download at byte 48193596
[download] Destination: Arsdigita 02 (Discrete Mathematics) Lecture 2_20-BrDto0heyaQ.mp4
[download]  48.0% of 221.93MiB at 533.93KiB/s ETA 03:41^C
ERROR: Interrupted by user

It tracks where you reached in the play list and when you restart is skips through videos that have been downloaded and proceeds from there.

3. You can limit the amount of bandwidth that is used.

Download Options:
-r, –rate-limit LIMIT maximum download rate in bytes per second
(e.g. 50K or 4.2M)

youtube-dl --rate-limit 1M https://www.youtube.com/playlist?list=PLTdIp1DywMlUpLHEg3ADhE6rrxhW_T5Rx

Subtitle Options:
–write-sub write subtitle file
–write-auto-sub write automatic subtitle file (youtube
only)
–all-subs downloads all the available subtitles of
the video
–list-subs lists all available subtitles for the video
–sub-format FORMAT subtitle format (default=srt) ([sbv/vtt]
youtube only)
–sub-lang LANGS languages of the subtitles to download
(optional) separated by commas, use IETF
language tags like ‘en,pt’

4. You can check for available subtitles.

user@computer:~/Movies$ youtube-dl --list-subs http://www.youtube.com/watch?v=9RPWATPdImw
 Setting language
 Confirming age
 9RPWATPdImw: Downloading webpage
 9RPWATPdImw: Downloading video info webpage
 9RPWATPdImw: Extracting video information
 9RPWATPdImw: Looking for automatic captions
 9RPWATPdImw: Downloading XML
WARNING: Video doesn't have automatic captions
 9RPWATPdImw: Available subtitles for video: en
 9RPWATPdImw: Available automatic captions for video:

5. You can download movie with available subtitles.

user@computer:~/Movies$ youtube-dl --all-subs http://www.youtube.com/watch?v=9RPWATPdImw
 Setting language
 Confirming age
 9RPWATPdImw: Downloading webpage
 9RPWATPdImw: Downloading video info webpage
 9RPWATPdImw: Extracting video information
[info] Writing video subtitles to: [English Sub] Jet Li 2011 Flying.Swords.Of.Dragon.Gate [turn on caption for sub]-9RPWATPdImw.en.srt
[download] Destination: [English Sub] Jet Li 2011 Flying.Swords.Of.Dragon.Gate [turn on caption for sub]-9RPWATPdImw.mp4
[download] 100% of 431.77MiB in 12:32

Source:
http://rg3.github.io/youtube-dl/index.html

E: Internal Error, No file name for gdb:amd64

October 2, 2014 Leave a comment

Problem:

I was trying to install FLTK on 64bit debian and was installing one of the prerequisites gdb when I got the following error

E: Internal Error, No file name for gdb:amd64

Solution:
My friend google had this as a solution that worked for me. (Although it would be nice if I knew what it means.)

dpkg -i /var/cache/apt/archives/*.deb
dpkg --configure -a 

Source:
http://askubuntu.com/questions/266450/how-to-fix-e-internal-error-no-file-name-for-libc6
http://ubuntuforums.org/showthread.php?t=2185185

Categories: debian Tags: ,