Following redirect to a second URL
Posted: Sun Apr 22, 2007 8:25 pm
Hi all,
I'm developing a site relating to YouTube videos. I currently have a function that retrieves the YouTube FLV URL. For example:
http://www.youtube.com/get_video?video_ ... 9Ia-RxuCoh
However, this URL redirects to another URL that is the true location of the video file. For example, the above URL redirects to:
http://lax-v158.lax.youtube.com/get_vid ... C71t8GzqPs
My Flash applet does not work if the function returns the non-redirected URL. Is there any way to make a function that follows the first URL and returns the true location of the video file (the second URL)?
Thanks in advance for any help.
I'm developing a site relating to YouTube videos. I currently have a function that retrieves the YouTube FLV URL. For example:
http://www.youtube.com/get_video?video_ ... 9Ia-RxuCoh
However, this URL redirects to another URL that is the true location of the video file. For example, the above URL redirects to:
http://lax-v158.lax.youtube.com/get_vid ... C71t8GzqPs
My Flash applet does not work if the function returns the non-redirected URL. Is there any way to make a function that follows the first URL and returns the true location of the video file (the second URL)?
Thanks in advance for any help.