Home > General, Web Development > Update: Getting YouTube Video (FLV) URL

Update: Getting YouTube Video (FLV) URL

It seems, YouTube has started using Google cache-servers to serve Flash-Videos (FLV). There is now very easy way to get YouTube FLV files.

http://cache.googlevideo.com/get_video?video_id=<video_id>

That’s it, video_id can be found at various places:-

If you click on following link, you would be prompted to download flv :)

http://cache.googlevideo.com/get_video?video_id=M0ODskdEPnQ&origin=youtube.com

Update (Jan 11, 2008): Updated the URL for getting FLV from Google Cache server. Thanks to Rohan for sharing updated URL format.

Update: It seems cache.googlevideo.com doesn’t work, atleast not for me?

Technorati tags: , , ,

Categories: General, Web Development


  • lilly
    does not work any more as of juy 21st 2010
    I also tried http://www.freeware-store.com/mp3youtuber-youtu... and a bunhc of other download managers, some just published the software for the change that happened end of june and they are releasing it now but it does not work anymore already
  • aa
  • Google/YouTube has changed things, I need to spend sometime to figure out new ways.
  • any updates? it not working for me web development
  • Pradeep Jain
    hi abdul can u help me
    i m creating a flex application with you tube videos
    i m facing a problem for getting flv path from youtube path.
    in xml youtube path is
    http://www.youtube.com/v/AWa0w8gChmE?f=videos&a...
    how can i get flv path from this path
    can u help me
  • Jarek
    Here's something that actually works
    Howto Get Direct YouTube Video (FLV) URL
  • shuurai
    It doesn't work anymore. it looks like google now adds some kind of session key (ip and timestamp) in the forwarding mechanism and that key needs to be appended into the url.
    however the only way to access that key is if you access a video from the normal link.
    Maybe someone can write a PHP that grabs that......
  • This Video format is no more working now what to do now?? what can we do for Downloading the video now?? is there any other way to get the address??
  • how do i do this for my space?
    thanks
    Salam.
  • salam,
    can you please tell me how to do the same for myspace?
    i mean how can i download files in flv format?
  • Hello,

    Thank you Abdul this is a very nice code! too bad I just found it, while it was posted a LONG time ago!


    I guess the "http://youtube.com/get_video.php" script is gone because I get no results whatsoever, only 404 error.


    While if you run a query for: "http://youtube.com/v/AJRcOF7rEfQ" it works, but you won´t get te 't=' param anymore.




    @Abdul


    It seems your server does not accept any requests, I keep getting 403 error on all your examples.

  • Kay
    Hi It was so useful for me. But since last week the program doesn`t work. I think the U-tube change url method or thet don`t want to acess like this way. I really want to use this program again. so do U have another way to use it?? thank you for you`re kindness Bye :-)
  • kay
    Hi It was so useful for me. But since last week the program doesn`t work. I think the U-tube change url method or thet don`t want to acess like this way. I really want to use this program again. so do U have another way to use it?? thank you for you`re kindness Bye :-)
  • I thought the AIR example might be too complicated for some, so I changed the example (http://eduviews.com/portal/getting-youtube-vide...) to demonstrate how this is done with Flash/Flex and a php proxy.
  • This posting (http://eduviews.com/portal/getting-youtube-vide...) is an explanation of how to resolve the video_id into a genuine flv. This can be done directly in an .AIR application (see the example), OR if you are using a straight Flash player then you can implement this code as a proxy on your server.
    Hope this helps some of you.
  • guyjj
    how are you getting the URL from the youtube video_id?
  • Emandem
    Problem Solved!
    Just check out the following website
    Enter the url and get your favorite clip
    You can also check Auto-Download to D.L your stuff from the page.
    Otherwise you'll be given a code.
    http://kej.tw/flvretriever/
  • Lucifer
    In some countries You Tube has been filtered due to strict Internet policies like Iran, Turkey, Tailand ,...
    Is there anyway to bypass the filter and download the clip from youtube since all the youtube IP ranges have been snuffed out?
  • abdul
    tried all the youtube URL's given here, none of them works anymore (if they ever worked), so guys quit the search, it's not worth it. The URL's generated are pure dynamic, just include youtube player and enjoy the video.
  • well mine doesnt work can anyone help
    7usTgw-7XfM
    the same
  • petepo
    Hello,
    I have a cache-server that is caching youtube flv video. Somewhere in Feb 2008, I notice that youtube return new parameters on the URL for download...client ip address..signature...
    This makes every individual download unique if the clients are of different ip. From my cache-server, all flv files are missed. Any ideas on this?
    Thanks.
    Example
    Previously
    http://cache.googlevideo.com/get_video?video_id...
    Now
    http://cache.googlevideo.com/get_video?video_id...
  • Ken
    I have several youtube players on my website that I set up to play my own playlists of videos I found on youtube. 2 of the players aren't always on my playlist when I log onto the site. When this happens I have to go back to my custom player, make a minor edit on the description or something, then hit save and finish and the player is fixed. But 3 or 4 visits later it's back on the wrong video. usually the same wrong video. Any suggestions?
  • Thien
    the answer to FLVPlayback problem is adding this in NCManager.as, line 276 after the if condition.
    it should now accept parameters passed to contentPath.
    else{
    _isRTMP = false;
    _streamName = parseResults.streamName;
    return (canReuse || connectHTTP());
    }
    I am using Flash CS3 on OS X and within NCmanager.as at line 276 it does not have an if statement. I found the NCmanager.as file in the directory Flash CS3>Configuration>Component Source>ActionScript 3.0>FLVPlayback>fl>video
    I was able to get the urlhttp://cache.googlevideo.com/get_video?video... to playback using the Media Component in Actionscript 2.0 but can't get it to play with the Flvplayback component in either Actionscript 2 or 3. Can anyone figure how to play using FLVplayback component??
  • Homecut
  • pete
    i have dozens of players and downloaders, but a lot of youtube vids will not play, it says not flv file,
    how do i find out what the formatt is as i want to convert some of them for dvd or vcd, or are they not ment to b converted.
    thanks pete
  • b0ggy
    Sorry, the above link that I gave doesn't work anymore. Check out this great player!.
  • rodz
    hi abdul... it is posible that i can download a movie whos not playing..like in www.person.com the video i was trying to download is the video has unsafe content..f i try to play the video there is a message say;'only the premium member can view'i want to download a video from that site using the url they given...pls help me..kindly send your answer to my email address.panther_walks22@yahoo.com
  • Please check out this player! It playing YouTube videos and also H.264 video and/or HE-AAC audio.
  • This is really nice, but it only works for video who got posted for some time, If you use YouTubeLoader to download your youtube videos you can even download the most recent onces
  • This method used to work really well. However it would seem that as of this morning, Jan. 24, Youtube have changed something such that get_video? no longer works. It returns a blank screen.
  • Rodz
    hi tomek... it is posible that i can download a movie whos not playing..like in www.person.com the video i was trying to download is the video has unsafe content..f i try to play the video there is a message say;'only the premium member can view'i want to download a video from that site using the url they given...pls help me..kindly send your answer to my email add.panther_walsk22@yahoo.com
  • Rodz
    tnx for the help...
  • @Rohan: Thanks, I have updated my post above with the tip you gave. Google throws error without origin=youtube.com param in URL.
    -abdul
  • All you have to do is find the video location because they moved it from google video servers. To do that use web http://keepvid.com/ where you copy/paste the youtube video url and click on Donwload button. Then link "Download link" appears and you have to substitute the old "cache.google.com" by eg. "ash-v286.ash.youtube.com" that's all. The bad news is that you have to do that manually for each video :/
  • Rodz
    hi..i try to download a video in www.person.com,,the url are given but if i try to download it i can download,what should i do so i can download that video...
  • Richard Prior
    Does Anyone know how to do the same for
    BrightCove Videos
    http://studio.brightcove.com/
    the youtube way doesn't work for a video using the brightcove player
  • Yeah! It works very fine!! Thank you Abdul Qabiz !!!!! You're so kind !!
    Others are more likely to earn more money from that php codes, you are a cool man !!!
  • I've just posted up a solution on my blog that may help others on how to get the direct url path to .flv video files on YouTube for Free.
    It's not dynamic but a quick trick to get the path.

    View it here >> "How to get the direct url path to .flv video files on YouTube for Free"


    Hope this helps...

  • Yehia Shouman
    the answer to FLVPlayback problem is adding this in NCManager.as, line 276 after the if condition.
    it should now accept parameters passed to contentPath.
    else{
    _isRTMP = false;
    _streamName = parseResults.streamName;
    return (canReuse || connectHTTP());
    }
  • Well I read all these comments. I know how to embed a youtube video into HTML (the program creates the bloody code for you!), but I'm curious to know how I could embed the youtube video player IN the flash movie itself? Any ideas? I assume I have to make a graphic symbol the size of the player (455x385) then add some code to it, but what?
  • XP GUY
    well mine doesnt work can anyone help
    7usTgw-7XfM
  • RAMBO
    *UPDATE*
    It doesn't work on all youtube videos, but adding ( &origin;=1 ) after the cache url seems to do the trick. You can add any symbol, letter or number after the equals sign and it works.
    The old way works on all videos. Enter the embedding code for the video in your browsers address bar. When it loads replace ( /swf/l.swf? ) with ( get_video? )
  • anony
    adding origin seems to work
    example
    http://cache.googlevideo.com/get_video?video_id...
  • @CoolCow: That url doesn't work. Remember, not all videos can be accessed via cache.googlevideo.com, only videos uploaded after YouTube's acquisation...
    You might want to try it using other technique (using php proxy or actionscript code), both of them are mentioned on my blog...
    Thanks
    -abdul
  • CoolCow
    Hi,
    I'm having a wierd issue here. The video's play perfect in the MediaPlayback component. But they don't in the FLVPlayBack component and i cant find why...?
    Also i tried to use "http://cache.googlevideo.com/get_video?video_id=M0ODskdEPnQ&.flv"
    but that dousn't work either.
    Anyone an idea?
  • bunty
    thank abdul &give; url suggestion i can not find it
  • @Rohan: The other URL works for me, even without adding origin param.
    @eee, Mike Troy: As per my understanding, videos uploaded after YouTube's acquisition by Google can be downloaded from Google-Cache (cache.google.com)...Other old videos are still on YouTube's CDN.
    -abdul
  • http://cache.googlevideo.com/get_video?video_id...
    Google cache links for youtube videos no longer work. Do you know if Google has issued any sort of statement on the matter?
  • eeee
    Seems this no longer works.
    http://cache.googlevideo.com/get_video?video_id...
    Returns:
    Bad Request
    Your client has issued a malformed or illegal request.
  • This is currently not working. It's not really reliable anymore. check out this: http://www.jeroenwijering.com/?thread=6483&edit...
    greets
    bmxaction.net
  • abdul,
    yes, I noticed that cache.googlevideo.com started throwing BAD request from yesterday... and youve updated this post to point the fact out...
    but here's a way around what google's done to prevent it.
    http://cache.googlevideo.com/get_video?video_id... [WORKS]
    http://cache.googlevideo.com/get_video?video_id... [DOES NOT WORK]
    cheers :-)
    add &origin;=youtube.com to the string ;-)
    example
  • method
    Hi all. But how to get exact url of youtube flv file. I want to get that using php since i want to use jw flash player with youtube playlist.Hope you guys help me with it.Thanks
  • pavan1919
    hai dude,
    i created custom video player and i embeded the video player in my page.I want to play youtube video (i did'nt get the youtube filepath)
    how should i play the video in my page.
  • That's HUGE! I've been searching for a way to embed youtube hosted flvs in my swfs. Works great! Thanks!
  • @Eric: You can easily design custom player, you need to understand the logic of getting FLV url from video_id. I would post a clean example, if I get sometime. But you can check out my other posts, I had another example posted, check it out if you can make any use of it.
    @Colin: Right, there is no extension for file because YouTube/Google servers throw video/x-flv (video/flv) content-type...You can save it as .flv without any problem.
    I just checked, URL with different video_id works. Not sure, why it's not working for you.
    Thanks
    -abdul
  • Colin
    A couple of questions: If I click on your get_video link, the file has no extension after downloading. Should I rename it to .flv? And also, if I put the get_video URL into an address bar with a different (or your) video_id, the download doesn't start. What am I doing wrong? Thanks.
  • Eric West
    Love all your posts on this subject abdul... but I'm still a bit confused on how I implement any of this... especially with your code you posted back in April.
    I'm a designer and I'm just looking for a simple way to play videos in a custom player... any chance you could dumb it down a bit for the coder-challenged?
  • @Transformer: Google gives you path of FLV for all of it's videos. But remember, Google-Video now aggregates videos from other destination sites (Veoh, Metacafe etc) so you might not get the flv-path for those sites.
    Look at Google-Video RSS feeds and filter for all videos uploaded to Google-Video, you get videos in different formats including flv.
    -abdul
  • Transformer
    Thank you Abdul, I've got this to work very fine now. Btw, can you work with GoogleVideo as well?
  • The problem with programming the video player is that I actually know very little about AS and am using a pre-built player. Whatever reference I use has to be on the PHP level, sadly enough.
    As for the filepath, that's the weird part. stream_get_meta_data SOMETIMES returns a hard path to the FLV.
    Take, for example, http://youtube.com/watch?v=xCAeq5kE0Ko
    Using the s_g_m_d() function, the following locations return:
    http://lax-v284.lax.youtube.com/get_video?video...
    http://cache.googlevideo.com/get_video?video_id...
    http://sjc-v166.sjc.youtube.com/get_video?video...
    and then, finally:
    http://youtube-769.vo.llnwd.net/d1/01/F8/xCAeq5...
    There is no rhyme or reason to which one returns, and if I put the function on a loop, I could wind up with a dozen pointers before the hard path comes back. Meanwhile other YouTube urls might return only the pointer and never the hard path.
    It's looking more and more like I'll have to figure out how to make the AS just use the cache location. I just wish I could understand why the path returns sometimes but not all the time.
  • @Xenofon: There is no fla for that, the code you saw in that post, save it in a .mxml file and compile using Flex2SDK or FlexBuilder 2.
    @mike: YouTube/Google both do HTTP 302/303 redirection. YouTube required "t" param along with video_id and it forwarded to one of their CDN server..
    Things are dynamic in nature and I don't think, there is a hardlink (afaik), but you can save the video_ids and program your player in a way that it loads videos through either cache.googlevideo.com or old way (you would need t param).
    -abdul
  • I've been trying for days to figure out how to glean the actual file path to the .flv from pointers like http://cache.googlevideo.com/get_video?video_id= via php but have been largely unsuccessful.
    The closest I came was through the stream_get_meta_data() function, but even that only returned other get_video.php paths.
    Is there any way to find the actual hard link to the flv file for youtube videos?
  • Can you please post the YouTubeClientSideDemoFlex.fla cose the youtube_flv_url_test_as2.fla it not work.
    thanks
  • Thanks for that valuable source of information, helped me no end :)
  • Hi, salam
    i need some Help. i want to play youtube video from mediaPlayback player in flash. so what should i do for it . i also use your ActionScript2.0 in which splitting technique is uesd for flv url but it is not workng plz help out to et this prob
    thanks
  • NeWbY
    Great find (again :))!
    Although the URL you provided doesn't lets you download 'old' youtube ID's/video's.
    Use this one instead:
    http://rd.cache.l.google.com/get_video?video_id=
    PS: Could be just IE again though, but the above link works for IE as well :)
  • THANK YOU. There was a video on YouTube that I really liked, but the author set the video to "private" because she was using copyrighted music in it. I have been looking everywhere to try to get the video and download it, and finally found it now!! Thanks for your trick!! I owe you a lot :)
  • thanks abdul, for a second i thought that my Ip was banned... as my old method of proviring the flv url stopped working.. this was a lifesaver !!!
    btw: i'm not downloading videos from youtube, i'm indexing them and streaming it directly over the web :-)
  • This is cool. Now that there are several thousand ways to download YouTube videos, why doesn't YouTube actually start offering them on their website. It saves an extra click..
  • Tony
    My understanding is that YouTube have been pretty reluctant to let people access their videos directly, and some people have recieved cease and desist letters regarding players they had made.
    This is really cool though. I just hope they don't close it
  • Tek
    Many thanks for the trick.
    It is one step less to access the video from a Flash animation when you only have the video URI. The old way asks to first download the page was so boring.
blog comments powered by Disqus