<form method=post>
format: http://www.youtube.com/watch?v=MzxWmw7SZ84 <br>
Link video : <input name=y size=50>
<input type=submit value=Generate>
</form>
<?
$y=$_POST['y'];
if(isset($y)){
$data=file_get_contents($y);
$belah=explode("=",$y);
$v=$belah[1];
$t=antara($data,"&t=","&");
//gambar
echo "<img src=\"http://i.ytimg.com/vi/$v/default.jpg\"><br>";
//judul
$judul=antara($data,"<title>YouTube - ","</title>");
echo "$judul <br>";
//FLV
$link="http://youtube.com/get_video.php?video_id=$v&t=$t";
$head=get_headers($link);
for($i=10;$i<20;$i++){
if(eregi("Location",$head[$i])){
$dl=str_replace("Location: ","",$head[$i]);
echo "<a href=\"$dl\">FLV</a> | ";
}}
//MP4
$link4="http://youtube.com/get_video.php?video_id=$v&t=$t&fmt=18";
$head4=get_headers($link4);
for($i=10;$i<20;$i++){
if(eregi("Location",$head4[$i])){
$dl4=str_replace("Location: ","",$head4[$i]);
echo "<a href=\"$dl4\">MP4</a> | ";
}}
//3GP
$link3="http://youtube.com/get_video.php?video_id=$v&t=$t&fmt=17";
$head3=get_headers($link3);
for($i=10;$i<20;$i++){
if(eregi("Location",$head3[$i])){
$dl3=str_replace("Location: ","",$head3[$i]);
echo "<a href=\"$dl3\">3GP</a>";
}}
}
function antara($string, $start, $end){
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);
}
?>
4 Responses to "Script Youtube downloader lageeee"
Post a Comment