I have completed alternative way to view YouTube videos with FLV player of your choice (JW FLV player in this case). The flv files will not be download to the server, it streams directly from YouTube .

Update:
I have updated the script for 2 reasons
- Youtube deny if you call the url with file_get_contents() which is replaced with a curl function. So it needs curl now.
- Youtube added more http headers and now the index for direct download link is 8 earlier it was 4.
I will update the script soon with the following features
- No need of allow_url_fopen = on in php.ini
- Curl dependency to be removed.
It doesn’t work?
Comment by Stoud — January 16, 2008 @ 11:34 am
Friend,
Thank you for your update.
I just updated my script and it works now. Please download the updated version here.
http://prjx.googlecode.com/files/alt-utube.v2.zip
Comment by Palani raja — January 18, 2008 @ 4:49 am
I got this when I tried your example
Fatal error: Call to undefined function curl_init() in C:\xampp\htdocs\TheTunnels\Preview\demo.php on line 8
Comment by anax — January 19, 2008 @ 2:59 am
@ anax
Which means you curl extenstion is not enabled in your xampp setup. Note Xampp will not enable the curl extension by default. Just remove the semicolon(
before extension=php_curl.dll in php.ini and restart apache services to enable the curl extension.
HIH
Comment by Palani raja — January 19, 2008 @ 4:31 am
thanks for responding so promptly. I came up with 4 php configuration files in my xampp and did your suggested in each of them. Turned apache on and off a couple of times… but still same error. I’ll try again after sleep… I look forward to cracking this.
And will I be able to use the url in a Playlist for JW flv?
Comment by anax — January 19, 2008 @ 5:22 am
@anax
The following are the important conf for php to run this code
allow_url_fopen = on
extension=php_curl.dll ;note there is no semicolon before
and pls check the same with your phpinfo() output.
Comment by Palani raja — January 19, 2008 @ 5:44 am
I missed the php.ini in the apache directory (and had changed 3 elsewhere in XAMPP) - - now your demo is working well
I’m not sure what code to add to my playlist…. I grabbed this from the source code of your demo for a Long Blondes youtube vid I’d like
http://lax-v216.lax.youtube.com/get_video?video_id=56tjK3HRFjU
My player under development is here:
http://www.thetunnels.co.uk/Preview/media.html
cheers for your help
Comment by anax — January 19, 2008 @ 10:11 pm
Hi
Thanks for this nice script,,but many times i get the url look like this,
http://cache.googlevideo.com/get_video?video_id=-Mp115afFIA&origin=lax-v116.lax.youtube.com ,then the flvplayer is not play video,,maybe you have a solution??
Second question,,is it possible to get the name from artist and songtitel into this script?
Hope you understand my english,thanks you
Comment by wil — January 22, 2008 @ 4:14 pm
your code does not work … not anymore…
Comment by sam — January 24, 2008 @ 4:34 pm
thanks for share
Comment by taytus — January 30, 2008 @ 7:37 pm
Error while fetching the video for the url [ http://youtube.com/watch?v=Et9ycrfY3jQ ]. Try another eg. http://youtube.com/watch?v=Eu-SCI9Ks_Y
and the same info for all the urls
i hoe you can help me
bye
Comment by taytus — January 30, 2008 @ 7:50 pm
seems to have stopped working again..
Comment by jk — February 11, 2008 @ 11:48 am
may error po ata yung script? na download ko yung *v2.zip kaso nung i try ko may error cya
Please provide valid YouTube URL. eg. http://youtube.com/watch?v=Et9ycrfY3jQ
Comment by sdms — February 12, 2008 @ 5:54 am