DISQUS

Abdul Qabiz's Blog - India: Update: Getting YouTube Video (FLV) URL

  • Jarek · 7 months ago
    Here's something that actually works
    Howto Get Direct YouTube Video (FLV) URL
  • Abdul Qabiz · 2 years ago
    @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
  • Tek · 2 years ago
    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.
  • Tony · 2 years ago
    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
  • Anand · 2 years ago
    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..
  • Rohan Pinto · 2 years ago
    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 :-)
  • Laurent · 2 years ago
    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 :)
  • NeWbY · 2 years ago
    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 :)
  • sohail · 2 years ago
    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
  • newtriks · 2 years ago
    Thanks for that valuable source of information, helped me no end :)
  • Xenofon · 2 years ago
    Can you please post the YouTubeClientSideDemoFlex.fla cose the youtube_flv_url_test_as2.fla it not work.
    thanks
  • mike · 2 years ago
    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?
  • mike · 2 years ago
    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.
  • Transformer · 2 years ago
    Thank you Abdul, I've got this to work very fine now. Btw, can you work with GoogleVideo as well?
  • Abdul Qabiz · 2 years ago
    @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
  • Eric West · 2 years ago
    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?
  • Colin · 2 years ago
    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.
  • Abdul Qabiz · 2 years ago
    @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
  • Mike Troy · 2 years ago
    That's HUGE! I've been searching for a way to embed youtube hosted flvs in my swfs. Works great! Thanks!
  • pavan1919 · 2 years ago
    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.
  • method · 2 years ago
    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
  • Rohan · 2 years ago
    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
  • wessite · 2 years ago
    This is currently not working. It's not really reliable anymore. check out this: http://www.jeroenwijering.com/?thread=6483&edit...
    greets
    bmxaction.net
  • eeee · 2 years ago
    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.
  • Mike Troy · 2 years ago
    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?
  • Abdul Qabiz · 2 years ago
    @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
  • bunty · 2 years ago
    thank abdul &give; url suggestion i can not find it
  • CoolCow · 2 years ago
    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?
  • Abdul Qabiz · 2 years ago
    @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
  • anony · 2 years ago
    adding origin seems to work
    example
    http://cache.googlevideo.com/get_video?video_id...
  • RAMBO · 2 years ago
    *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? )
  • XP GUY · 2 years ago
    well mine doesnt work can anyone help
    7usTgw-7XfM
  • Myron · 2 years ago
    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?
  • Yehia Shouman · 2 years ago
    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());
    }
  • Kieran McCarthy · 2 years ago
    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...

  • liloli · 2 years ago
    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 !!!
  • Richard Prior · 2 years ago
    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
  • Rodz · 1 year ago
    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...
  • Tomek · 1 year ago
    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 :/
  • Abdul Qabiz · 1 year ago
    @Rohan: Thanks, I have updated my post above with the tip you gave. Google throws error without origin=youtube.com param in URL.
    -abdul
  • Rodz · 1 year ago
    tnx for the help...
  • Rodz · 1 year ago
    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
  • Rhino · 1 year ago
    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.
  • Aribo · 1 year ago
    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
  • Bogdan · 1 year ago
    Please check out this player! It playing YouTube videos and also H.264 video and/or HE-AAC audio.
  • rodz · 1 year ago
    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
  • b0ggy · 1 year ago
    Sorry, the above link that I gave doesn't work anymore. Check out this great player!.
  • pete · 1 year ago
    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
  • Homecut · 1 year ago
  • Thien · 1 year ago
    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??
  • Ken · 1 year ago
    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?
  • petepo · 1 year ago
    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...
  • audai · 1 year ago
    well mine doesnt work can anyone help
    7usTgw-7XfM
    the same
  • abdul · 1 year ago
    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.
  • Lucifer · 1 year ago
    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?
  • Emandem · 1 year ago
    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/
  • guyjj · 1 year ago
    how are you getting the URL from the youtube video_id?
  • paulg · 1 year ago
    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.
  • paulg · 1 year ago
    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.
  • kay · 1 year ago
    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 · 1 year ago
    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 :-)
  • Mehrad Heidar · 1 year ago
    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.

  • Mohicine · 9 months ago
    salam,
    can you please tell me how to do the same for myspace?
    i mean how can i download files in flv format?
  • Mohicine · 9 months ago
    how do i do this for my space?
    thanks
    Salam.
  • Mast City · 8 months ago
    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??
  • shuurai · 8 months ago
    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......
  • Pradeep Jain · 3 weeks ago
    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