Skip to content

Commit

Permalink
get Categories by "GJ_CODE"
Browse files Browse the repository at this point in the history
  • Loading branch information
asiacny authored May 18, 2018
1 parent 13f4556 commit 0edf2c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function get_related_video($vid,$apikey){


//获取用户频道视频
function get_channel_video($cid,$pageToken='',$apikey,$regionCode='VN'){
function get_channel_video($cid,$pageToken='',$apikey,$regionCode=GJ_CODE){
$apilink='https://www.googleapis.com/youtube/v3/search?order=date&part=snippet&maxResults=50&type=video&regionCode='.$regionCode.'&hl=zh-CN&channelId='.$cid.'&key='.$apikey.'&pageToken='.$pageToken;
return json_decode(get_data($apilink),true);
}
Expand Down Expand Up @@ -93,14 +93,14 @@ function categorieslist($id){
}

//获取视频类别内容
function Categories($id,$apikey,$pageToken='',$order='relevance',$regionCode='VN'){
function Categories($id,$apikey,$pageToken='',$order='relevance',$regionCode=GJ_CODE){
$apilink='https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&&regionCode='.$regionCode.'&hl=zh-ZH&maxResults=48&videoCategoryId='.$id.'&key='.$apikey.'&order='.$order.'&pageToken='.$pageToken;
return json_decode(get_data($apilink),true);
}


//获取搜索数据
function get_search_video($query,$apikey,$pageToken='',$type='video',$order='relevance',$regionCode='VN'){
function get_search_video($query,$apikey,$pageToken='',$type='video',$order='relevance',$regionCode=GJ_CODE){
$apilink='https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=48&order='.$order.'&type='.$type.'&q='.$query.'&key='.$apikey.'&pageToken='.$pageToken;
return json_decode(get_data($apilink),true);
}
Expand Down

0 comments on commit 0edf2c5

Please sign in to comment.