bengreen.eu Circle Device

 

Techie Stuff

Projects

Quick Reference

Will be moved to Quick Reference soon

Downloading YouTube Video with Firebug

Important Note: Although this method might work for some of the time it will not work all the time. Please see the addendum for more details.

Firebug is a cool bit of software that lets you see requests that your browser (Firefox only of course) is making to the server. For YouTube this includes the video file from Google's CDN. Firstly, install Firebug

Then go to YouTube, open the Firebug panel and turn on the Net panel.

Search for the video you want to download and click it.


Look in the list at the bottom for all the requests that have been sent from your browser when loading this page... wao, lots eh? Look for the one that is still being downloaded, generally you will find "videoplayback" in the URL, in the picture above (click for a larger version) you can see it highlighted in blue. Right click on this and open in new tab.

Unfortunatley in some versions of Firefox (most of the new ones that support H.264) this will just start playing the video in a new tab :-( in that case you should copy it into the clipboard (to do this right click and then click Copy Location) then paste it into the box below:

Then click "Show", right click on the link and "Save Link As...". That is it! You now have a file called videoplayback that you can play with MPlayer (you may want to rename it so it has a .flv or .mp4 extension.

Addendum

Sometimes YouTube will chunk video into 1.7MB chunks, I tried getting all these chunks and concatenating them but that did not work. To fix this problem you first have to seek the video to the end and then look for the last videoplayback request. Copy the request to the clipboard paste it into a notepad window and then change the starting offset to 0. I will explan this in more detail, and with pictures:

In the image below you can see the various requests my browser has made to the server a is a 1.7Mb chunk and b is a 1.5Mb chunk at the end of the file, this is the important one because in the request for this file is the end offset of the whole video.

Picture of my browser and the last request

Right click on this URL and click Copy Location then change the beggining offset (the first number after range= to 0. I left the second number alone (172830719) this is the end offset. Your URL should look a little like this (the URL is long so I have cut some of it out, but you still need all of it!)

http://o-o.preferred.lga15s26.v5.lscache4.youtube.com/...CUT...mt=1342690584&mv=m&range=0-172830719&signature=6C4B980479...

Paste the resulting URL into the box on this page then right click, save as and job done ;-) When I get chance I will write a quick chrome plugin to do this... it is not that hard is it?

As you can see the file I downloaded is bigger than 1.7Mb!

The downloaded file list Terminal window showing file sizes

Extracting the Audio

So, you have downloaded that wonderful video of talking cats and now you want to put it onto your mobile phone as a ringtone.

Get audiostream out of a video file with ffmpeg.

Quick Links: Techie Stuff | General | Personal | Quick Reference