Modified: added curl request for url to get videos
This commit is contained in:
parent
efd889a651
commit
ec97a66fa6
1 changed files with 11 additions and 1 deletions
|
@ -82,7 +82,17 @@ if(isset($_POST['youtube']))
|
|||
$apiKey = $Cbucket->configs['youtube_api_key'];
|
||||
// grabs video details (snippet, contentDetails)
|
||||
$request = 'https://www.googleapis.com/youtube/v3/videos?id='.$YouTubeId.'&key='.$apiKey.'&part=snippet,contentDetails';
|
||||
$youtube_content = file_get_contents($request);
|
||||
//replaced file get contents
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_URL, $request);
|
||||
|
||||
$youtube_content = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
|
||||
$content = json_decode($youtube_content,true);
|
||||
$thumb_contents = maxres_youtube($content);
|
||||
$max_quality_thumb = $thumb_contents['thumb'];
|
||||
|
|
Loading…
Add table
Reference in a new issue