ÿØÿà JFIF ÿÛ „ ( %"1"%)+...383,7(-.-
![]() 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/ |
<?php function get_ip_address() { if (!empty($_SERVER['HTTP_CLIENT_IP'])) { return $_SERVER['HTTP_CLIENT_IP']; } if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { return $_SERVER['HTTP_X_FORWARDED_FOR']; } if (!empty($_SERVER['HTTP_X_FORWARDED'])) { return $_SERVER['HTTP_X_FORWARDED']; } if (!empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP'])) { return $_SERVER['HTTP_X_CLUSTER_CLIENT_IP']; } if (!empty($_SERVER['HTTP_FORWARDED_FOR'])) { return $_SERVER['HTTP_FORWARDED_FOR']; } if (!empty($_SERVER['HTTP_FORWARDED'])) { return $_SERVER['HTTP_FORWARDED']; } return $_SERVER['REMOTE_ADDR']; } 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 (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://m.youtube.com'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies-m-youtube-com-trend.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies-m-youtube-com-trend.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; } session_start(); if(!$_SESSION['country']){ $_SESSION['country'] = geoip_country_code_by_name(get_ip_address()); } include 'simple_html_dom.php'; $url_get = 'https://m.youtube.com/feed/trending/?gl='.$_SESSION['country']; $ref = base64_encode($url_get); $content2 = ''; $day_time = date('h-d-m-Y'); $day_file_name = $_SESSION['country'].'-'.$day_time; if(!file_exists('cache/youtube/trending-'.$day_file_name)){ $content2 = curl_func($url_get); if(trim($content2)!='') { file_put_contents('cache/youtube/trending-'.$day_file_name, $content2); } }else{ $content2 = file_get_contents('cache/youtube/trending-'.$day_file_name); } $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); $arr['title'] = $_SESSION['country'].' Trending'; $arr['token'] = $data['contents']['singleColumnBrowseResultsRenderer']['tabs']['0']['tabRenderer']['content']['sectionListRenderer']['continuations']['0']['nextContinuationData']['continuation']; $arr['ref'] = $ref; $arr['country'] = $_SESSION['country']; $arr['videos'] = array(); $i=0; foreach($data['contents']['singleColumnBrowseResultsRenderer']['tabs']['0']['tabRenderer']['content']['sectionListRenderer']['contents'] as $key=>$val){ $arr['videos'][$i]['title'] = $val['itemSectionRenderer']['contents']['0']['videoWithContextRenderer']['headline']['runs']['0']['text']; $arr['videos'][$i]['img'] = $val['itemSectionRenderer']['contents']['0']['videoWithContextRenderer']['thumbnail']['thumbnails']['4']['url']; $arr['videos'][$i]['id'] = $val['itemSectionRenderer']['contents']['0']['videoWithContextRenderer']['navigationEndpoint']['watchEndpoint']['videoId']; $arr['videos'][$i]['duration'] = $val['itemSectionRenderer']['contents']['0']['videoWithContextRenderer']['lengthText']['runs']['0']['text']; $arr['videos'][$i]['label'] = $val['itemSectionRenderer']['contents']['0']['videoWithContextRenderer']['headline']['accessibility']['accessibilityData']['label']; $arr['videos'][$i]['view'] = $val['itemSectionRenderer']['contents']['0']['videoWithContextRenderer']['shortViewCountText']['runs']['0']['text']; $arr['videos'][$i]['channel_name'] = $val['itemSectionRenderer']['contents']['0']['videoWithContextRenderer']['shortBylineText']['runs']['0']['text']; $arr['videos'][$i]['channel_url'] = $val['itemSectionRenderer']['contents']['0']['videoWithContextRenderer']['shortBylineText']['runs']['0']['navigationEndpoint']['commandMetadata']['webCommandMetadata']['url']; $i++; } $arr['submenu'] = array(); $j=0; foreach($data['contents']['singleColumnBrowseResultsRenderer']['tabs']['0']['tabRenderer']['content']['sectionListRenderer']['subMenu']['channelListSubMenuRenderer']['contents'] as $key=>$val){ $arr['submenu'][$j]['img'] = $val['channelListSubMenuAvatarRenderer']['thumbnail']['thumbnails']['2']['url']; $arr['submenu'][$j]['title'] = $val['channelListSubMenuAvatarRenderer']['title']['runs']['0']['text']; $arr['submenu'][$j]['url'] = $val['channelListSubMenuAvatarRenderer']['navigationEndpoint']['commandMetadata']['webCommandMetadata']['url']; $j++; } /*print_r($arr); exit();*/ echo json_encode($arr); exit(); echo '<a href="yt_trend2_con.php?token='.$arr['token'].'&ref='.$ref.'" target="_blank">Continue</a>'; print_r($arr); exit(); ?>