Simple Way to Download YouTube HTML5 Videos

Submitted by tomo on November 24, 2010 - 3:52am

A lot of the existing YouTube video download scripts don't work today as YouTube have changed their "API" so those hacks no longer work. Programs that simple detect whatever media files get downloaded should still work.

Here's a dead simple way to download HTML5 videos from YouTube. Drag the following link to your bookmark bar. In Chrome, you have to set "Always show bookmark bar" for this to make sense.

Tubelet

(In Firefox, you won't see HTML5 videos anyways as the codec YouTube uses is license-encumbered and so not available to Firefox.)

Now when you're watching an HTML5 video on YouTube (it says HTML5 on the same line as the play controls) just click on that bookmark. It's a bookmarklet that runs a simple line of javascript that opens the video file in a new tab. Then you can just right click the video to save it to disk.

Test it out with some Doraemon: http://www.youtube.com/watch?v=lrNUvehL_jE

What about the older, non-HTML5 videos?

I haven't found it as easy to do as a single line of javascript. I think the link to the .flv can be gotten from:
yt.getConfig('SWF_CONFIG').args.fmt_url_map

but can't be bothered... so I'll leave it as an exercise for the reader.

Anyways, with Google Chrome you don't need any extra software to get the link.

1. Just open up Developer Tools
2. Click the Resources tab (may need to enable this)
3. Click the Other sub-tab
4. Click the "videoplayback" resource
5. Copy and open the Request URL. It looks like:

Request URL:http://v22.lscache1.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Cratebypass%2Coc%3AU0dYRVVRTl9FSkNNOF9NS1JF&fexp=901306%2C900031%2C907311&itag=18&ipbits=0&sver=3&ratebypass=yes&expire=1290560400&key=yt1&signature=1D2BF2B3E8DEF8BBE745D1530A5D6C4C6EA82D71.31D00E9D4F7DD40390B11F9CD7B997B985FB4F3C&id=96b354bde84bfe31

Thank you Google for making a browser that can easily get around Google YouTube's attempts to disable video file downloading!

Read the rest of this article...
md mim (not verified)

Great post.This is a very helpful for every people.Thanks for give us a good post.Thanks again.

Anonymous (not verified)

Another for XVIDEOS.COM:

Load the video especially the flash url if you got it which looks like flashservice.xvideos.com/embedframe/....with ID there.

Then watch in Chrome Developer Tools under network resources. When you click play, there will be a new row and it will grow in size much bigger than the other files like images. It will grow a few megs and keep growing. This is the file you're looking for. So copy the link and put in your browser and you will be downloading the video! The link looks like

porn.im.734cd83c.3441898.x.xvideos.com/videos/flv/1/d/2/xvideos.com_1d2.......0.flv with some extra arguments after the url too.

Anonymous (not verified)

Another for XVIDEOS.COM:

Load the video especially the flash url if you got it which looks like flashservice.xvideos.com/embedframe/....with ID there.

Then watch in Chrome Developer Tools under network resources. When you click play, there will be a new row and it will grow in size much bigger than the other files like images. It will grow a few megs and keep growing. This is the file you're looking for. So copy the link and put in your browser and you will be downloading the video! The link looks like

porn.im.734cd83c.3441898.x.xvideos.com/videos/flv/1/d/2/xvideos.com_1d2.......0.flv with some extra arguments after the url too.

tomo

Here's how to download video files (flv) from pk5.net:

Inside the embed tag you will see attribute flashvars="file=...XXXX.../nUE0pQbiY3q3ql54qzyxMJ9mYzAioF92nJEyomRjBQtlBQZio3WuoS9wpzIuoKOcMI9wqJ1snJ5soJ91qTusMTIfqKuyK2AioKOcoTS0nJ9hKl1sqz9fYy8lsPA8rUMcMTIipj

That last bit looks like base64 encoded filename but it's not.

- Instead, open Chrome Developer Tools and switch to Network Tab.

- Press play on the video

- See last entry, like:porn.im.32616753.1088283.x.xvideos.com/videos/flv/4/5/e/xvideos.com_blahblahblah (so actually it's getting its videos from xvideos.com!)

Then you can just download that file in your browser.

If you have curl you can run curl -I on the flashvars url and you will see the actual redirected file url.

Khoan Cat (not verified)

I think if a PC has Java already, using http://keepvid.com will be more simpler.

Alex (not verified)

hey,

I have been a big fan of keepbid but the only problem with keepbid is server downtime. Advertisment is fine for me since they are offering the service for free.
I have been stumbling upon downloading youtube videos in and I found a softare called DAP and it allows downloading and converting youtube videos in mp3 format. Here is the tutorial video, watch http://www.youtube.com/watch?v=yqDqrE_v6pE . I tought it's gonna help.

automatic captcha decoder (not verified)

Hey there! I've been following your web site for some time now and finally got the bravery to go ahead and give you a shout out from Porter Tx! Just wanted to mention keep up the great job!

hah8.com (not verified)

Howdy would yοu mind letting mе κnow whіch hоѕting
comρany уou're using? I'νe loaded your blog in 3
dіfferent wеb browserѕ anԁ I must say this blog
lοadѕ а lot fаѕtеr then most.
Can you recοmmend a good web hοѕting ρrovider at a honest price?

Kudos, I аρpreсiate it!

tomo

I'd rather not use a Java thing.

Griff Haldeman (not verified)

What type of file do you save it as? When I right click to save, it saves as "videoplayback" but there's no way of reading the file correctly.

tomo

It's a .flv file so you can just save it as whatever then rename to .flv.

java (not verified)

Clever and simple. Will always be using this way now for downloading yotube videos.

XVideos (not verified)

Here's how to download xvideos.com videos:

Find the id. It's just a number. Look for the flash object's flashvars and there should be a long number and open the url with that number: http://www.xvideos.com/video

This should redirect to the full url. Then you can put the url into http://www.xvideosdl.com/ to get an easy download link.

akhileshkumartripathi (not verified)

You recommended using Xvideos software but It doesn't give you option to download videos in mp3. Here is the free youtube to mp3 converter which I personally use http://www.youtube.com/watch?v=nBKaGFLHcEI .

XVideos (not verified)

After the first url there should be a number.. eg. xvideos.com/video12345678

tomo

For an embedded Google Video, look in the source for flashvars with a value starting with "flv=". It'll look like this:
flvurl=http://v11.nonxt3.googlevideo.com/videoplayback?id%3D301b2e9b21177304%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1338555532%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D4B71B66F35EDACC00ED8A8E14BC71D0DB5C8AF70.51C465C081B57AD08A40D52A21BEAE5397422F9E%26key%3Dck1&iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D301b2f9b21177404%26offsetms%3D5000%26itag%3Dw160%26sigh%3DX0x74aMAV6eJXy0C1lYCPTXq9eE&autoplay=0&ps=blogger

You should run Javascript unescape() on that string. It contains two urls but you want to only get the first url, up to "&". Don't assume it will work if you have extra stuff in the URL.

The URL should then lead to a download of a videoplayback.flv file of the video you were watching.

Anonymous (not verified)

You can try download Youtube from this website:

http://www.tubekeeper.com/

copy and paste youtube video page URL and paste to the site,
it will generate download link for you (FLV, MP4-HD, 3GP).
Facebook, Metacafe, Dailymotion, Tudou...etc video download supported too.

You also can perform video search through the Tubekeeper Video Search Engine.

Anonymous (not verified)

too cool. ty very much

tomo

Here's an updated code snippet that will get you a download link (probably .flv file) on a YouTube video. This works as of September 30, 2011.

Open Chrome Developer and run this snippet, and you will get a clickable link to the video file, which you can save as whatever.flv instead of videoplayback. Then you can open the file in VLC.

unescape(yt.config_.PLAYER_CONFIG.args.url_encoded_fmt_stream_map)

Click the first url... or try others if that one doesn't work. ;) It will be a cached url so it won't last long.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <h2> <h3> <h4> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <div> <pre>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].
By submitting this form, you accept the Mollom privacy policy.
© 2010-2014 Saigonist.