Well my site is a music lyrics site, and included an option to embed youtube videos with each lyric added. It came with one lyrics, which you can see here.
On the left of this page, the youtube video fits in a box.
http://music-and-lyrics.info/index.php?lyric_id=1
Now I added a new lyric and the video doesnt fit in the box
http://music-and-lyrics.info/index.php?lyric_id=494374
The strange thing is, that the embed code shows the same height and width attributes, so it has nothing to do with that.
This is the youtube.php file
<?php
/************************************************************************************
Script Name : Youtube Downloader 0.1
Function : To show path into FLV files located at Youtube.com
Creator : Yeni Setiawan (yeni.setiawan@yahoo.com, http://sandalian.com)
Created date : April 5, 2007
Requirement : PHP with CURL
Note:
This is a basic functions used to show real URI of FLV files at youtube.com so we can
download the file and play it offline.
Disclaimer:
You use it at your own risk. You can ask me question about this script but you shouldn't
ask me about any damaged computer caused by this script.
To do:
- Build AJAX interface.
- Put it in my homepage as public service
************************************************************************************/
// ------------------------------------ START SCRIPT --------------------------//
function get_content_of_url($url){
$ohyeah = curl_init();
curl_setopt($ohyeah, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ohyeah, CURLOPT_URL, $url);
$data = curl_exec($ohyeah);
curl_close($ohyeah);
return $data;
}
/*
OLD FUNCTION, NO LONGER WORKING
function get_flv_link($string) {
if (preg_match('/\/player2\.swf\?(.*)", "movie_player"/', $string, $match)) {
$url = $match[1];
return 'http://youtube.com/get_video.php?'.$url;
}
}
*/
function get_flv_link($string) {
if (eregi("watch_fullscreen\?(.*)title=\" +", $string, $out)) {
$outdata = $out[1];
}
return 'http://youtube.com/get_video.php?'.$outdata;
}
function get_http_header($url){
$uh = curl_init();
curl_setopt($uh, CURLOPT_URL, $url);
curl_setopt($uh, CURLOPT_HEADER, 1);
curl_setopt($uh, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($uh);
curl_close($uh);
return $res;
}
function show_url($http_header){
$arai = explode("\n",$http_header);
foreach($arai as $ini){
if(eregi("location",$ini)) $url = $ini;
}
list($sampah,$hasil) = explode("Location:",$url);
return str_replace("\n","",trim($hasil));
}
function download_youtube($url){
$data = get_content_of_url($url);
$next_url = get_flv_link($data);
$data = get_http_header($next_url);
return show_url($data);
}
// ------------------------------------ END SCRIPT --------------------------//
?>
I am not sure if there is something in the script that can fix it.