데모
<?php
//ver1.0 150423 @_untitle_d
$yt_api = ''; //유튜브 API KEY, https://console.developers.google.com/project
function get_video_id($url){}
function youtube_info($id, $part='snippet')
{
global $yt_api;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://www.googleapis.com/youtube/v3/videos?id={$id}&key={$yt_api}&part={$part}");
curl_setopt($curl, CURLOPT_POST, 0);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($curl);
curl_close($curl);
return json_decode($return, true);
}
$tmp_yt = 'http://www.youtube.com/watch?v=yEJ2-VofNCw'; //유튜브 동영상
$return = youtube_info(get_video_id($tmp_yt)); //유튜브 정보
echo "동영상 : ".$tmp_yt."<br>";
echo "제목 : ".$return['items'][0]['snippet']['title']."<br>"; //title
echo "채널명 : ".$return['items'][0]['snippet']['channelTitle']."<br>"; //channelTitle
echo "썸네일 : <img src='".$return['items'][0]['snippet']['thumbnails']['default']['url']."'><br>"; //thumb default
print_r($return);
?>
관련링크
http://untitled.untitle311apyxry1w48.com/lkbmgfh
참고
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 30 |
아우겐나이스
|
21년 전 | 4049 | |
| 29 |
아우겐나이스
|
21년 전 | 4436 | |
| 28 |
아우겐나이스
|
21년 전 | 3462 | |
| 27 | 21년 전 | 5833 | ||
| 26 | 21년 전 | 3107 | ||
| 25 | 21년 전 | 6080 | ||
| 24 | 18년 전 | 3648 | ||
| 23 | 21년 전 | 3639 | ||
| 22 | 21년 전 | 4247 | ||
| 21 | 21년 전 | 3817 | ||
| 20 | 21년 전 | 4224 | ||
| 19 | 21년 전 | 6678 | ||
| 18 | 21년 전 | 4733 | ||
| 17 | 21년 전 | 6989 | ||
| 16 | 21년 전 | 4169 | ||
| 15 | 21년 전 | 2631 | ||
| 14 | 21년 전 | 4977 | ||
| 13 | 21년 전 | 3399 | ||
| 12 |
Recluse
|
21년 전 | 3878 | |
| 11 |
아우겐나이스
|
21년 전 | 3568 | |
| 10 |
Recluse
|
21년 전 | 3392 | |
| 9 | 21년 전 | 3986 | ||
| 8 | 21년 전 | 5169 | ||
| 7 | 21년 전 | 4760 | ||
| 6 | 21년 전 | 5682 | ||
| 5 | 21년 전 | 4114 | ||
| 4 | 21년 전 | 4837 | ||
| 3 | 21년 전 | 4740 | ||
| 2 | 21년 전 | 3240 | ||
| 1 | 22년 전 | 4339 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기