I would like to have the youtube video downloader integerated in the milkyway style. I know it would use a custom page. but im a beginner and i failed in making one.
i would really appreciate if someone could tell me how to get it working in the milkyway style.
i think the form to input youtube link should be in the CustomYoutube.html (custom template file):
<form method='post' action=''>
<input name='video' type='text' class='textbox' size="78"/>
<input type='submit' name='submit'value="Get it!" class="button">
</form>
<input name='video' type='text' class='textbox' size="78"/>
<input type='submit' name='submit'value="Get it!" class="button">
</form>
and the link getting part should be in the CustomYoutube.php (custom php file):
<?
if(eregi('youtube.com',$_POST['video'])){
$video="$_POST[video]";
$video2 = explode("watch?v=", $video);
$video2 = explode("&", $video2[1]);
$video2 = $video2[0];
$source = file_get_contents($video);
preg_match("/var fullscreenUrl = '(.*?)';/is", $source, $link);
$link=str_replace('/','',$link[1]);
$link=str_replace("watch_fullscreen?",'',$link);
$title = explode("<title>", $source);
$title = explode("</title>", $title[1]);
$title=str_replace("YouTube - ","",$title[0]);
$pic="http://img.youtube.com/vi/$video2/default.jpg";
echo"<br><b>$title</b><br><br><img src="$pic"><br><br><a href="http://www.youtube.com/get_video?$link">Download</a>";
}
?>
if(eregi('youtube.com',$_POST['video'])){
$video="$_POST[video]";
$video2 = explode("watch?v=", $video);
$video2 = explode("&", $video2[1]);
$video2 = $video2[0];
$source = file_get_contents($video);
preg_match("/var fullscreenUrl = '(.*?)';/is", $source, $link);
$link=str_replace('/','',$link[1]);
$link=str_replace("watch_fullscreen?",'',$link);
$title = explode("<title>", $source);
$title = explode("</title>", $title[1]);
$title=str_replace("YouTube - ","",$title[0]);
$pic="http://img.youtube.com/vi/$video2/default.jpg";
echo"<br><b>$title</b><br><br><img src="$pic"><br><br><a href="http://www.youtube.com/get_video?$link">Download</a>";
}
?>
here's a link to the original script:
thanks