Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'config.php';
- $id=$_GET['id'];
- if(!$id){
- echo '<br/><h2>Error: wrong path entered.</h2><br/>';
- die();
- }
- $host ='http://onlyvideo.net/files/download/id';
- $link =''.$host.'/'.$id.'';
- $h = get_headers($link);
- $ti = $h[9];
- $ti = str_replace('Location: ','',$ti);
- $tiku = $ti;
- $tiku = str_replace(' ','%20',$tiku);
- // file name n replace
- $sname = basename($tiku);
- $sname = str_replace('onlyvideo.net',''.$site.'',$sname);
- $sname = str_replace('%20',' ',$sname);
- // dir make
- $dir = "data";
- $dir2 = "$dir/$id";
- if(!is_dir($dir)){
- mkdir($dir);
- chmod($dir,0777);
- }
- if(!is_dir($dir2)){
- mkdir($dir2);
- chmod($dir2,0777);
- }
- // save
- $save = ''.$dir.'/'.$id.'/'.$sname.'';
- $file_extension=pathinfo($save, PATHINFO_EXTENSION);
- if(!file_exists($save)) {
- } else {
- header("Location: /$save");
- }?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement