Advertisement
Khalequzzaman

OnlyVideo.Net Updated [ download.php ] coding

Nov 5th, 2015
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2. include 'config.php';
  3. $id=$_GET['id'];
  4. if(!$id){
  5. echo '<br/><h2>Error: wrong path entered.</h2><br/>';
  6. die();
  7. }
  8. $host ='http://onlyvideo.net/files/download/id';
  9. $link =''.$host.'/'.$id.'';
  10. $h = get_headers($link);
  11. $ti = $h[9];
  12. $ti = str_replace('Location: ','',$ti);
  13. $tiku = $ti;
  14. $tiku = str_replace(' ','%20',$tiku);
  15. // file name n replace
  16. $sname = basename($tiku);
  17. $sname = str_replace('onlyvideo.net',''.$site.'',$sname);
  18. $sname = str_replace('%20',' ',$sname);
  19. // dir make
  20. $dir = "data";
  21. $dir2 = "$dir/$id";
  22. if(!is_dir($dir)){
  23. mkdir($dir);
  24. chmod($dir,0777);
  25. }
  26. if(!is_dir($dir2)){
  27. mkdir($dir2);
  28. chmod($dir2,0777);
  29. }
  30. // save
  31. $save = ''.$dir.'/'.$id.'/'.$sname.'';
  32. $file_extension=pathinfo($save, PATHINFO_EXTENSION);
  33. if(!file_exists($save)) {
  34.  
  35. } else {
  36. header("Location: /$save");
  37. }?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement