php-es.org


Welcome! Here you can paste sources and general debugging text, You can even set yourself a password if you want to keep it just for yourself.

Posted by download-youtube on March Mon 21st 10:23 PM - Never Expires
Download | New paste

  1. <?php
  2. $exttmp = "windmakeresmichilakil";
  3. if($_POST['video'] != ""){
  4. $url = $_POST['video'];
  5. $context = stream_context_create($opts);
  6. $html = file_get_contents($url);
  7. $title = explode('<meta name="title" content="',$html);
  8. $title = explode('">'$title[1]);
  9. $title = $title[0];
  10. echo "Haciendo peticion al video de titulo : ".$title."\n<br/>";
  11. $eh = explode("fmt_url_map=",$html);
  12. $neh = explode("=",$eh[1]);
  13. $vh = explode("|",urldecode($neh[0]));
  14. $ct = count($vh)1;
  15. $videosource = $vh[$ct];
  16. echo "Descargando video..<br/>";
  17. //$video = file_get_contents($videosource);
  18. $filemd5name = md5(date("Y-m-d h:i:s"));
  19. exec("wget -b -O $filemd5name.$exttmp \"$videosource\"");
  20. echo "Video Descargado <br/>";
  21. echo "<a href='?md5fname=$filemd5name&tvideo=$title'>Descargar Video</a>";
  22. }elseif($_GET['md5fname']!=""){
  23.      if(file_exists($_GET['md5fname'].".$exttmp") == false){
  24.         die("Archivo invalido :( ");
  25.      }
  26.      if($_GET['tvideo'] == ""){
  27.         $_GET['tvideo'] = "Video";
  28.      }
  29.      header("Content-type: application/force-download");
  30.      header("Content-Transfer-Encoding: Binary");
  31.      header("Content-length: ".filesize($file));
  32.      header("Content-disposition: attachment; filename='{$_GET['tvideo']}.flv'");
  33.      readfile($_GET['md5fname'].".$exttmp");
  34. }else{
  35.      echo "
  36.        <form method='POST'>
  37.          url de video : <input type='text' name='video' />
  38.          <br/><input type='submit' value='Enviar!'>
  39.        </form>
  40.      ";
  41. }
  42.  
  43.  
  44.  
  45. ?>
Language:
To highlight particular lines, prefix each line with @@





© 2012 - Powered by PASTE 1.0