Php youtube grabber

Create a file index.php and upload it on your server. Run it for testing :)).

<html>
<head>
<title>YouTube Ripper</title>
<style>
body, a, a:link, a:visited, a:hover, td {
font-family: verdana, sans-serif;
font-size: 8pt;
color: black;
}
a { font-weight: bold; }
input {
font-family: verdana, sans-serif;
font-size: 8pt;
border: black 2px solid;
padding: 2px;
}
#vid {
width: 500px;
}
</style>
</head>
<body>
<center>
<h1>Youtube ripper</h1>
<a href=’index.php’>Home</a>
<form action=”get.php” method=”get” target=”ifr”>
Video URL : <input id=”vid” type=”text” name=”vid” />
<select name=”mode”>
<option value=”1″>Just Give link</option>
<option value=”2″>Mirror and give link</option>
</select>
<input type=”submit” value=”Go!” />
</form>
<table width=”500″><tr><td>TOS: <br />Please do not use this to obtain illegal files hosted on youtube. <br />Mirrors are automatically cleared by the webmaster
frequently, so be sure to download before this happens. <br />The webmaster has the right to ban you from this server via I.P. address,
ISP, or anything else. <br />This is provided As-is, so if there are any bugs, or it doesn’t work for you, live with it, we will
try to fix any bugs so email us. <br />We are in no way affiliated with YouTube or any of their affiliates.<br />By using our
service you must agree to these terms.</td></tr></table>
<iframe width=”500″ frameborder=0 name=”ifr” id=”ifr”></iframe>
</center>
</body>
</html>

create a file get.php

<html>
<head>
<title>YouTube Ripper</title>
<style>
body, a, a:link, a:visited, a:hover {
font-family: verdana, sans-serif;
font-size: 8pt;
}
input {
font-family: verdana, sans-serif;
font-size: 8pt;
border: black 2px solid;
padding: 2px;
}
#vid {
width: 500px;
}
</style>
</head>
<body>
<?php

set_time_limit(’31337′);

// gettube youtube leecher

$regExpPattern = ‘/\”t\”\: \”([^\"\s]+)\”/i’;

$fData = file_get_contents($_GET['vid']);

preg_match($regExpPattern, $fData, $Params);

//print_r($Params);

$tID = $Params[1];

$vIDS = explode(’?v=’,$_GET['vid']);

$vID = $vIDS[1];

echo “<a href=’http://www.youtube.com/get_video?video_id=$vID&t=$tID’>Download Video</a> <br />This is a FLV file, so rename it to whatever.flv, and open with an FLV player.”;

if($_GET['mode']==2) {

$regExpPattern = ‘/content\=\”([^\"\']+)\”/i’;

preg_match($regExpPattern, $fData, $Params);

$flName = $Params[1];

$flName = preg_replace(”/[^a-zA-Z0-9s]/”, “_”, $flName);

srand((double)microtime()*1000000);
$flName = rand(0,100).$flName;

//die($flName);

$flData = file_get_contents(”http://www.youtube.com/get_video?video_id=$vID&t=$tID”);

$fp = fopen(”$flName.flv”,”w”);
fwrite($fp,$flData);
fclose($fp);

echo “<br /><a href=’$flName.flv’>Download (mirror)</a>”;

}

?>
</body>
</html>

Sponsor links

Tags: , , , , ,


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

Random Articles