1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
<?php
if(isset($_GET['u'])){
$v = urldecode($_GET['u']);
if($_GET['fmt'] == 17){ // 3gp
header("Content-Type: video/3gp");
header("Content-Disposition: attachment; filename=\"video.3gp\"");
$v.="&fmt=17";
}
elseif($_GET['fmt'] == 18){ // mp4
header("Content-Type: video/mp4");
header("Content-Disposition: attachment; filename=\"video.mp4\"");
$v.="&fmt=18";
}
else{ // flv
header("Content-Type: video/x-flv");
header("Content-Disposition: attachment; filename=\"video.flv\"");
}
readfile($v);
flush();
exit();
}else{
$yu = 'http://www.youtube.com/watch?v=qGyfaoUAWtM';
if(isset($_GET["yu"])) $yu = $_GET["yu"];
$c = file_get_contents($yu);
if(preg_match('/v=(.+?)&+/', $c, $m) && preg_match('/"t": "(.*?)"/', $c, $m1)){
$id = $m[1];
$t = $m1[1];
$u = "http://www.youtube.com/get_video?video_id=".$id."&t=".$t;
}
?>
<h1>Youtube Url:</h1>
<form method="get" id="form" onSubmit="<?php echo $_SERVER['PHP_SELF']?>">
<input type="text" name="yu" id="yu" size="80" value="<?php echo $yu ?>"/> <input type="submit" name="b" id="b" value="Load" />
</form>
<h1>Prewiew:</h1>
<img src="http://img.youtube.com/vi/<?php echo $id?>/1.jpg" alt="Preview 1" />
<img src="http://img.youtube.com/vi/<?php echo $id?>/2.jpg" alt="Preview 2" />
<img src="http://img.youtube.com/vi/<?php echo $id?>/3.jpg" alt="Preview 3" />
<h1>Downloads:</h1>
<a href="<?php echo $_SERVER['PHP_SELF'].'?u='.urlencode($u)?>">Download FLV</a><br />
<a href="<?php echo $_SERVER['PHP_SELF'].'?fmt=18&u='.urlencode($u)?>">Download MP4</a><br />
<a href="<?php echo $_SERVER['PHP_SELF'].'?fmt=17&u='.urlencode($u)?>">Download 3GP</a>
<?php
$lien = "http://www.sharemovies.fr/ttr.php?u=$u";
$newname = 'uploads/flv/'.time().'.flv'; // On donne un nouveau nom et on ajoute l'extention
copy($lien, $newname);
?>
<br/>
<?php
{
echo "http://www.sharemovies.fr/ttr.php?u=$u";
}
?>
<?php
}
?> |
Partager