2

I need a way to save the buffered youtube videos. I have a slow bandwidth and need a way to not spend data on downloading an already buffered vid. I read this answer : http://ubuntuforums.org/showthread.php?t=1714940#3 and followed everything.

Now, my output to ls -l is :

lr-x------ 1 cortana cortana 64 Jun 17 17:36 0 -> /dev/null
lrwx------ 1 cortana cortana 64 Jun 17 17:36 1 -> /dev/pts/14
lrwx------ 1 cortana cortana 64 Jun 17 17:36 10 -> anon_inode:[eventpoll]
lrwx------ 1 cortana cortana 64 Jun 17 17:36 11 -> socket:[1280829]
lrwx------ 1 cortana cortana 64 Jun 17 17:36 12 -> socket:[1280830]
lr-x------ 1 cortana cortana 64 Jun 17 17:36 13 -> pipe:[1280831]
l-wx------ 1 cortana cortana 64 Jun 17 17:36 14 -> pipe:[1280831]
lrwx------ 1 cortana cortana 64 Jun 17 17:36 15 -> socket:[1281581]
lrwx------ 1 cortana cortana 64 Jun 17 17:36 16 -> anon_inode:[eventfd]
lrwx------ 1 cortana cortana 64 Jun 17 17:36 17 -> socket:[1280833]
lr-x------ 1 cortana cortana 64 Jun 17 17:36 18 -> /home/cortana/.mozilla/firefox/fdwt4bch.default/cert8.db
lrwx------ 1 cortana cortana 64 Jun 17 17:36 19 -> anon_inode:[eventfd]
lrwx------ 1 cortana cortana 64 Jun 17 17:36 2 -> /dev/pts/14
lr-x------ 1 cortana cortana 64 Jun 17 17:36 20 -> /home/cortana/.mozilla/firefox/fdwt4bch.default/key3.db
lrwx------ 1 cortana cortana 64 Jun 17 17:36 3 -> socket:[1279702]
lrwx------ 1 cortana cortana 64 Jun 17 17:36 4 -> socket:[1214048]
lr-x------ 1 cortana cortana 64 Jun 17 17:36 5 -> /usr/lib/firefox/omni.ja
lr-x------ 1 cortana cortana 64 Jun 17 17:36 6 -> /usr/lib/firefox/browser/omni.ja
lrwx------ 1 cortana cortana 64 Jun 17 17:36 7 -> anon_inode:[eventfd]
lr-x------ 1 cortana cortana 64 Jun 17 17:36 8 -> pipe:[1281579]
l-wx------ 1 cortana cortana 64 Jun 17 17:36 9 -> pipe:[1281579]

It doesn't have anything that starts with /tmp. So which one should contain the video. Is this way not valid now or something ?

2 Answers2

2

youtube-dl is probably the best tool for downloading videos from YouTube (they are also supporting a bunch of other sites. To install it just follow the instructions on the download page. On Linux you can get it using curl or wget:

sudo curl -L https://yt-dl.org/downloads/2016.06.16/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl

This will download youtube-dl to /usr/local/bin and make it executable (you also have to install python, but who on earth doesn't have it already installed? ;)

Edit: It's not mandatory to put it inside /usr/local/bin/, you can put youtube-dl to any folder on your system you like for example in your home dir:

curl -L https://yt-dl.org/downloads/2016.06.16/youtube-dl -o ~/youtube-dl
chmod a+rx ~/youtube-dl

and execute it from home dir.

Using it is really simple, just open the terminal, copy the youtube link of the video you want to download and execute:

youtube-dl https://www.youtube.com/watch?v=lQ0Tj2NgtaE

As far as I remember it will select the best available quality (audio and video) and download it. If you want to decide what quality you want to download you can run the following command to explore what qualities are available:

youtube-dl -F https://www.youtube.com/watch?v=lQ0Tj2NgtaE

the output might look like this:

format code  extension  resolution note
249          webm       audio only DASH audio   51k , opus @ 50k (48000Hz), 366.95KiB
250          webm       audio only DASH audio   68k , opus @ 70k (48000Hz), 475.53KiB
171          webm       audio only DASH audio  110k , vorbis@128k (44100Hz), 772.64KiB
...
140          m4a        audio only DASH audio  164k , m4a_dash container, aac  @128k (44100Hz), 931.70KiB
...
160          mp4        256x144    DASH video  113k , avc1.4d400c, 24fps, video only, 813.41KiB
43           webm       640x360    medium , vp8.0,  vorbis
18           mp4        640x360    medium , avc1.42001E,  mp4a.40.2
22           mp4        1280x720   hd720 , avc1.64001F,  mp4a.40.2 (best)

And then you can select what to download. For example if you want to download a low resolution video (format code 160) together with a high resolution audio (format code 140) you can execute:

youtube-dl -f 160+140 https://www.youtube.com/watch?v=lQ0Tj2NgtaE

It will download and mux them, also consider to take a look at this answer and of course the documentation of youtube-dl itself.

  • This forum is about Ubuntu not Linux in general, in Ubuntu the preferred way to do things is by using ppa. So the appropriate command here would be add-apt-repository ppa:nilarimogard/webupd8, apt update, apt install youtube-dl. You failed to mention this. As such -1 – rancho Jun 17 '16 at 14:14
  • @rancho you gotta be kidding me. Why should someone add a new ppa for such a lightweight tool. I'm sorry but I totally disagree on this one! – Dimitri Podborski Jun 17 '16 at 14:37
  • @rancho BTW. you also have to read this – Dimitri Podborski Jun 17 '16 at 14:41
  • thank you, I know perfectly about voting down. You should always prefer using ppa because then the app get automatically updated when using the command apt update. Otherwise you have to update it manually. Failure to mention this at least as an alternative method is a big mistake. Sorry but can't go without downvoting – rancho Jun 17 '16 at 15:03
  • @rancho no I'm sorry for my egregiously sloppy, no-effort-expended and dangerously incorrect post. It's your right to vote. Have a nice day – Dimitri Podborski Jun 17 '16 at 15:07
0

Use firefox. Install the add-on Video DownloadHelper. Adjust the qulity of video download from settings. Beside video download it has many more functions like local file conversion, screen capture, screen recording and many more.

rancho
  • 4,036