ÿØÿà 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/vidoe.top/proxy/ |
<?php header( 'Access-Control-Allow-Origin: https://123vid.top', true ); header('X-Frame-Options: ALLOW-FROM https://123vid.top/'); if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')){ ob_start('ob_gzhandler'); }else{ ob_start(); } //$arr_api_key_yt = array('AIzaSyDfzk-yDvE8Z-HJOhVzg3ItFP4jVRFecfA','AIzaSyBG8LoVIQa1uHsy8EvyXt0gfBvPOW9UxXI','AIzaSyAa93qmj0ExryyLLG2QJVqPgWCSXRD5ILE','AIzaSyAJdioddl384cHEFQ5jKF5Mhi13sqkD2aM'); //movieandtube@gmail.com, xxxgiacxxx@gmail.com, minhlnh@ischool.vn,admin@duhoc-o-canada.com/duhoc1canada,bngocgiac@gmail.com,chobinhdan@gmail.com, minhnb@ischool.vn, contact@ischool.vn, ischooladmin@ischool.vn //$arr_api_key_yt = array('AIzaSyDE_xaLlmPOGKK0_KKQRky2S3FLtaPrGgs','AIzaSyCKxIlbzhHCMTbLTnLKLM4Cpu3XOPiJbUA','AIzaSyBbCq0F7JXLl2dB5Xle4W953-AgpNTcPE8'); $arr_api_key_yt = array('AIzaSyDE_xaLlmPOGKK0_KKQRky2S3FLtaPrGgs','AIzaSyCKxIlbzhHCMTbLTnLKLM4Cpu3XOPiJbUA','AIzaSyBbCq0F7JXLl2dB5Xle4W953-AgpNTcPE8','AIzaSyBcFPUCRSuQ6Waiv4O0iHP-ZtW9QhcTzx8','AIzaSyCezLfujaUw6fGTroSuJbcy-EJdmQU8NT0'); $key_off = array_rand($arr_api_key_yt); $val_off = $arr_api_key_yt[$key_off]; if (isset($_GET['q']) && isset($_GET['maxResults']) && isset($_GET['mode'])) { // Call set_include_path() as needed to point to your client library. /* * Set $DEVELOPER_KEY to the "API key" value from the "Access" tab of the * {{ Google Cloud Console }} <{{ https://cloud.google.com/console }}> * Please ensure that you have enabled the YouTube Data API for your project. */ /* * * require_once 'Google/Client.php'; require_once 'Google/Service/YouTube.php'; $DEVELOPER_KEY = $val_off; $client = new Google_Client(); $client->setDeveloperKey($DEVELOPER_KEY); $youtube = new Google_Service_YouTube($client);*/ require 'vendor/autoload.php'; $client = new Google_Client(); $client->setDeveloperKey($val_off); $youtube = new Google_Service_YouTube($client); $mode = trim($_GET['mode']); switch($mode){ default: $searchResponse = $youtube->search->listSearch('id,snippet', array( 'q' => $_GET['q'], 'type' => 'video', 'maxResults' => $_GET['maxResults'], 'videoEmbeddable' => 'true', 'pageToken' => $_GET['pageToken'] )); foreach ($searchResponse['items'] as $searchResult) { $list['title'] = $searchResult['snippet']['title']; $list['id_you'] = $searchResult['id']['videoId']; $list2['video_info'][] = $list; } $list2['nextPageToken'] = $searchResponse['nextPageToken']; $list2['prevPageToken'] = $searchResponse['prevPageToken']; echo json_encode($list2); exit(); break; case 'detail': $searchResponse = $youtube->videos->listVideos('contentDetails,snippet', array( 'id' => $_GET['q'] )); foreach ($searchResponse['items'] as $val) { $detail['id_you'] = $val['id']; $detail['title'] = $val['snippet']['title']; $detail['des'] = $val['snippet']['description']; $detail['cat_youtube'] = $val['snippet']['categoryId']; $detail['duration'] = covtime($val['contentDetails']['duration']); } echo json_encode($detail); exit(); break; case 'list_category': $url = 'https://www.googleapis.com/youtube/v3/videoCategories?part=snippet®ionCode='.$_GET['legion'].'&key='.$DEVELOPER_KEY; $content = file_get_contents($url); $searchResponse = json_decode($content,true); foreach($searchResponse['items'] as $val){ $list['cat_id_you'] = $val['id']; $list['cat_title'] = $val['snippet']['title']; $list2[] = $list; } echo json_encode($list2); exit(); break; case 'video_in_category': $searchResponse = $youtube->search->listSearch('snippet', array( 'type' => 'video', 'videoCategoryId' => $_GET['q'], 'regionCode' => $_GET['legion'], 'maxResults' => $_GET['maxResults'], 'videoEmbeddable' => 'true', 'pageToken' => $_GET['pageToken'] )); foreach ($searchResponse['items'] as $searchResult) { $list['title'] = $searchResult['snippet']['title']; $list['id_you'] = $searchResult['id']['videoId']; $list2['video_info'][] = $list; } $list2['nextPageToken'] = $searchResponse['nextPageToken']; $list2['prevPageToken'] = $searchResponse['prevPageToken']; echo json_encode($list2); exit(); break; case 'video_related': $searchResponse = $youtube->search->listSearch('id,snippet', array( 'relatedToVideoId' => $_GET['q'], 'type' => 'video', 'maxResults' => $_GET['maxResults'], )); foreach ($searchResponse['items'] as $searchResult) { $list['title'] = $searchResult['snippet']['title']; $list['id_you'] = $searchResult['id']['videoId']; $list2[] = $list; } echo json_encode($list2); exit(); break; case 'get_duration': $duration = ''; $searchResponse = $youtube->videos->listVideos('contentDetails', array( 'id' => $_GET['q'] )); foreach ($searchResponse['items'] as $val) { $duration = covtime($val['contentDetails']['duration']); } if($duration=='0:0'){ $duration = 'Live'; } echo $duration; exit(); break; } } function get_duration($vid){ global $youtube; $searchResponse = $youtube->videos->listVideos('contentDetails', array( 'id' => $vid )); foreach ($searchResponse['items'] as $val) { $duration = covtime($val['contentDetails']['duration']); } if($duration=='0:0'){ $duration = 'Live'; } return $duration; } function covtime($youtube_time) { preg_match_all('/(\d+)/',$youtube_time,$parts); // Put in zeros if we have less than 3 numbers. if (count($parts[0]) == 1) { array_unshift($parts[0], "0", "0"); } elseif (count($parts[0]) == 2) { array_unshift($parts[0], "0"); } $sec_init = $parts[0][2]; $seconds = $sec_init%60; $seconds_overflow = floor($sec_init/60); $min_init = $parts[0][1] + $seconds_overflow; $minutes = ($min_init)%60; $minutes_overflow = floor(($min_init)/60); $hours = $parts[0][0] + $minutes_overflow; if($hours != 0) return $hours.':'.$minutes.':'.$seconds; else return $minutes.':'.$seconds; } ob_end_flush(); exit(); ?>