PDA

View Full Version : Youtube mashup



Catalist
April 15th, 2007, 07:21 PM
This is my latest venture. All the code is written from scratch and built off of the youtube api. I access their flv's with a little hacking of keepvid's php and then pull it back into Flash.
The zip includes a read me which shows how to make the application run.
I can put this on my website because youtube has blocked cross domain requests to their api.
localhost --> youtube = ok
breefield.com --> youtube = security concern

meh.

Here's the .zip enjoy. (http://www.breefield.com/tube/youtube.zip)

-Dustin

novatake
April 16th, 2007, 04:14 AM
looks good dude really good actually

wouldnt mind playing with the source of that

puppy
April 16th, 2007, 06:04 AM
Here's the .zip enjoy. (http://www.breefield.com/tube/youtube.zip)youtube.zip: Unexpected end of archive

is that just me or...

puppy
April 16th, 2007, 06:24 AM
...any way, about FLV thingie. is there a way to figure out URL http://sjl-v27.sjl.youtube.com/get_video?video_id=KmbaYJVrw-0 from http://youtube.com/watch?v=KmbaYJVrw-0 ? coz if there is, one can bypass their whatever APIs completely :)

puppy
April 16th, 2007, 06:35 AM
...hmm. It appears (http://www.abdulqabiz.com/blog/archives/flash_and_actionscript/constructing_youtube_1.php) people have solved it already.

Catalist
April 16th, 2007, 01:35 PM
...hmm. It appears (http://www.abdulqabiz.com/blog/archives/flash_and_actionscript/constructing_youtube_1.php) people have solved it already.


That way no longer works. Youtube has changed it so that the t parameter and such don't work. You have to get the beginning of the link which is usually ash.something
Anyhow, I've updated it, here's the new version.
.zip (http://breefield.com/tube/breetube.zip)

puppy
April 19th, 2007, 08:08 AM
dunno, it still works here (127.0.0.1, tried to put it on my godaddy host, but it seems to be banned from youtube)
$uid = 'ZcI21jRjVtw';

if ($uid != '') {
$fp = fsockopen ('www.youtube.com', 80, $errno, $errstr, 15);
if (!$fp) {
echo '$errno $errstr';
} else {
fwrite ($fp, "GET /v/$uid HTTP/1.1\r\nHost: www.youtube.com\r\nConnection: Close\r\n\r\n");

$response = fread ($fp, 2048); fclose($fp);

if (preg_match ('/&t=.{32}/', $response, $matches)) {

// redirecting to FLV
header ('Location: http://youtube.com/get_video?video_id=' . $uid . $matches [0]);
exit;

} else
echo 'could not parse youtube response :\'( ' . $response;
}
}