Saturday, April 29, 2006

HOWTO: Save Videos from YouTube Updated



I first wrote about how to save Flash format videos from YouTube was in November of 2005. Since then, many things have changed. One thing was the way YouTube identify their videos.

The original eleven digits of both upper and lower cased alpha-numeric video identification code is still used to watch videos via YouTube’s website or embed them to other websites.

To download the videos via KeepVid or similar sites, the eleven digit video identification code is still useful, but in case of KeepVid crashes, user has to “kick it old school style” by reading YouTube video’s page source.

Using the F-16 Crash video (http://www.youtube.com/watch?v=b4Knsa7kBPE) as an example, here is how to save videos from YouTube “old school style”.

In Firefox browser, open “View Page Source” and do a text search for

player2.swf?video_id=

YouTube Flash Video Page Source Example
(screen capture)

For this example video, its public video identification code is b4Knsa7kBPE, but the internal prolonged video identification code is

b4Knsa7kBPE&l=48&t=OEgsToPDskI3D6CVWsTxEa4BzcTHKXc7
&s=E04B5F8107785BA4:8A51374783A7BCE6


Keep in mind that the code between “&t=” and “&s=” may be session-sensitive and changed every time the video is accessed.

To save the video, the URL path format is

http://www.youtube.com/get_video?video_id=prolonged_video_identification_code

By paste the above URL into browser would not download the video. The best way is to paste it into an email and send it to oneself.

The default file extension assigned by email clients (Gmail, Thunderbird, Outlook) when saving the video is html (hypertext markup language), change it to flv (flash video).

Media players like VLC can play flv files stand alone. To convert flv video to other formats like Quicktime or Windows Media, use CinemaForge.

Update: April 30, 2006 - Javi Moya has created an extension called VideoDownloader 1.0 for Firefox which would download embedded videos and media files directly from Youtube, Google, Metacafe, iFilm, and other 60+ video sites. (more)

Update: May 10, 2006 – Browser Opera caches Flash video (.flv) files from YouTube in its cache directory. Typically in Windows, Opera’s cache directory is located:

C:\Program Files\Opera\profile\cache4

35 comments:

  1. youtube changed its coding for videos a few days back and i don't think the greasemonkey extension for firefox which allowed you to download videos before works anymore.

    does anyone else have the same issue? or can clarify?

    ReplyDelete
  2. muldersgun,

    You are correct about that. YouTube has started to use the prolonged version of video identification code, and from my experience, it is session-sensitive.

    ReplyDelete
  3. good look tian. i have been wondering what was going on. i noticed the watch video id wasn't working in the get_video method anymore. sigh.. more work...

    ReplyDelete
  4. Hi There

    Please could someone help me. I am still having no luck with this new download method. I cannot seem to find the page sorce (like the example shown) in my browser. I am using standard internet explorer with windows XP and I cannot find the sorce for the webpage. I have also tried using stream download but it will not let me download the files after I add the UPC. I don't know what else to do.

    Thank you and I hope someone can help me.

    ReplyDelete
  5. Start using Firefox would be a good start.

    There is a big button on the right that says "Browse the web faster. Get Firefox with Google Toolbar."

    Click on it.

    ReplyDelete
  6. Hi Tian
    It's working completely!!!
    Thanks a lot.

    ReplyDelete
  7. Thank you. This entry is useful to me.
    I wrote a small program with this information.

    youtube downloader
    http://video.qooqle.jp/dl/

    ReplyDelete
  8. i can't really find this line
    FlashObject("/player.swf?video_id=

    instead it is like this :
    FlashObject("/player2.swf?video_id=

    is it because i'm playing it with the new player on youtube?

    ReplyDelete
  9. Vincent,

    You are correct. Thanks for the tip.

    ReplyDelete
  10. great post. i hate how youtube doesn't allow downloading of videos. especially public videos

    ReplyDelete
  11. Get Opera from opera.com. Open any youtube page, watch the vid, go to Opera's cache folder, look for any .flv file and copy it to wherever you want. There you have it.

    ReplyDelete
  12. Thanks for your tips! I was able to play the .FLV file with FLV Player 1.3.3, found on Download.com. Thanks again!

    ReplyDelete
  13. I've recently discovered SUPER (http://www.erightsoft.com/SUPER.html). It's a shell for several other packages (included), it's free, and performs a multitude of conversions with an easy to use GUI.

    ReplyDelete
  14. tian,
    again i can't find this line :
    FlashObject("/player2.swf?video_id=

    it seems that it had been switched to : new SWFObject("/player2.swf?video_id=

    i've tried using the way u said by copying the vid id into the line. but now i can't get anything.

    ReplyDelete
  15. Run url snooper and it will show the url
    regardless of how often they change any lines

    http://www.snapfiles.com/get/urlsnooper.html

    added bonus of working on any site for any type of file

    for flash sites select "all files" from dropdown selector

    ReplyDelete
  16. james from jakartaJune 17, 2006 at 4:58 AM

    hi Tian,
    what a cool blog you have here ;)
    thanks for the info's
    I tried almost all the tricks everyone suggested, but evidently Opera is the best remedy for youtube LOL it can't fail
    cheers

    ReplyDelete
  17. I am extreamly satisfied. Thanks so much.
    Thanks to Ohida for the code generator, takes some work out.

    ReplyDelete
  18. Thank you for this info; you saved my day.

    ReplyDelete
  19. Cheers! It's the only method that works now, greasemonkey doesn't work any longer and neither does Opera. Thanks!

    ReplyDelete
  20. Everything that you wrote is working , and what so ever there's no need do send such via email, when you use firefox You just can copy paste it into new window , it'd ask to save a file and agreed , of course it's name is get_video.html , but doesn't it seems strange if get_video.html is 18MB large , just change extension and play , of course youtube won't let you to open 2 same sessions so you have to close youtube site with downloading video.

    Greetings thenoodle81 at gmail at com

    ReplyDelete
  21. For IE
    go to Document & Settings\your user name\Local Setting\Temporary Internet Files\
    find the "get video?..."
    copy it elsewhere and rename it to flv
    done

    ReplyDelete
  22. http://bodytag.org/link is helpful in creating right-clickable links of files that would otherwise have been automatically played by browsers. Is this my buddy Tian? Hi TW, this is Arafat. :)

    ReplyDelete
  23. Arafat? Yasser Arafat? Is that you?

    ReplyDelete
  24. youve probably all figured everything out now but i still dont know how to change a .flv file into a .mpeg or .avi or something "burnable". (without having to download anyprograms)i dont mind if the only solution is complicated.

    ReplyDelete
  25. There is a program called CinemaForge which can convert .flv type file into .mov (quicktime), .wmv (windows media video), and .avi (audio video interlaced) file types.

    ReplyDelete
  26. Didn't you still tried "GET RIGHT"? (http://www.getright.com/). You have to do the same way for the prolonged version at the beginning of this article and the insert the mounted link into getright (download file) and there it is, the file downloaded to your PC.

    ReplyDelete
  27. check this out. you can save youtube videos and download youtube videos at

    http://www.youtubex.com

    allows you to download youtube videos to your pc by simply submiting the URL of the youtube video you are saving.

    ReplyDelete
  28. I use Savetube to save youtube videos.

    ReplyDelete
  29. Look in Temporary Internet files, Firefox's cache, the equivalent thing in Opera or whatever browser you use - for it to play it had to download to your computer, all that remains is to pick it out from amongst all the other temp files

    The easiest way is to go to the Youtube page, clear the cache/temp files, then reload the page and watch the video through, then look in the folder again and look for something about the right size to be the video. Append the flv file extension and open it up in vlc, or re-encode it to another format.

    ReplyDelete
  30. Heres the latest code as of 8/6/07

    player2.swf?hl=en&video_id=

    If you're using Opera look in the cache4 folder and look for something like opr003H5.tmp or similar - the .tmp extension is the important thing. Rename the extention as .flv and there you are.

    ReplyDelete
  31. I use veoh
    veoh.com
    program to download vids from youtube

    ReplyDelete
  32. As of Sept. 8, 2007, YouTube changed their code. Two major things have changed:

    1. The player2.swf?video_id= no longer obtains. The only line with "player2" in it now looks like this: var swfUrl = '/player2.swf?v=1';

    Obviously that won't help. However, the "video_id" tag (which is right below it in the page source) IS still good, but...

    2. The tagline has changed.

    The good news is, ALL the elements are still there. The other good news is, due to a huge library of pages formatted the old way, it may be a while before YouTube gets around to reformatting all the old pages, if they ever do. Meanwhile, they have to have backwards compatibility, which means that if you reformat a New Code line to look like an Old Code line, it will still work!

    Let's look at a specific video on YouTube:
    http://www.youtube.com/watch?v=6Y39gHihP74

    Where elements used to look like this: video_id=6Y39gHihP74&l=593&t=OEgsToP...

    The New Code looks like this: video_id:'6Y39gHihP74',l:'593',t:'OEgsTo...

    It doesn't take a rocket scientist to note the correlations, and reformat the new line to look like the old line. Just take every (:') and change it into (=), and take every (',) and change it into (&). You can even do this "automagically" using Find & Replace if your build your temporary address line in Notepad.

    To minimize confusion (if that's possible), I enclosed the above elements in parentheses. Do not put any parentheses in your code modifications!

    Once you've modified the line, build it up the same as before. The final result should look the same (but with different numbers) as in Tian's example. Here's a New Code video (Steam Trek, hilarious BTW) that can be downloaded by building and pasting the following line into your Firefox address bar:


    http://www.youtube.com/get_video?
    video_id=6Y39gHihP74&l=593&t=OEgs
    ToPDskLi-5N8DrA6IGajo3ehe4_m&sk=5
    FrdiLrAkSjki0dnZEFZHwU

    The original looked like this:
    video_id:'6Y39gHihP74',l:'593',t:'OEgsToPD
    skLi-5N8DrA6IGajo3ehe4_m',sk:'5FrdiLrAkSjk
    i0dnZEFZHwU'

    (You can test the above New Code line by copying and pasting into your Firefox, but you will have to do each line separately, as word wrap did not force breaks, so I had to break the one line into four to display it all.

    BTW in case it's not yet obvious to you, you can just paste the rebuilt code line into Firefox's address bar without going through the extra step of emailing it to yourself.

    ReplyDelete
  33. In Opera Version 9.24, YouTube video file is stored to temporary folder. The file is named something.tmp and it is locked so that it can not be copied.
    Install Unlocker from
    http://ccollomb.free.fr/unlocker/
    and use that to copy the videofile.
    Rename it to .flv and use VLC or MediaPlayerClassic to play it.

    ReplyDelete
  34. Take YouTube Videos with you

    YouTubeRobot.com today announces YouTube Robot 2.0, a tool that enables you to download video from YouTube.com onto your PC, convert it to various formats to watch it when you are on the road on mobile devices like mobile phone, iPod, iPhone, Pocket PC, PSP, or Zune.

    YouTube Robot allows you to search for videos using keywords or browse video by category, author, channel, language, tags, etc. When you find something noteworthy, you can preview the video right in YouTube Robot and then download it onto the hard disk drive. The speed, at which you will be downloading, is very high: up to 5 times faster than other software when you download a single file and up to 4 times faster when you download multiple files at a time.

    Manual download is not the only option with YouTube Robot. You may as well schedule the download and conversion tasks to be executed automatically, even when you are not around. Downloading is followed by conversion to the format of your choice and uploading videos to a mobile device (if needed). For example, you can plug in iPod, select the video, go to bed, and when you wake up next morning, your iPod will be ready to play new YouTube videos.

    Product page: www.youtuberobot.com
    Direct download link: www.youtuberobot.com/download/utuberobot.exe
    Company web-site: www.youtuberobot.com
    E-mail: support@youtuberobot.com

    ReplyDelete
  35. Any tool I use to download YouTube video only gets the video. The audio is missing. I think YouTube has gotten smart and separated the two. Is their a tool out there that can record the audio and reintegrate it into the video?

    ReplyDelete