video_list_Singer_IU.js 5.19 KB
var {google} =require('googleapis');

//1
var service = google.youtube('v3');
service.videos.list({
    key: 'AIzaSyBInggOtXxPFYIRee0Xs3vb5iZ9YE9_518',
    part: 'snippet',
    id: '8ykMyNHAdKk', // 동영상 Id 팔레트
    fields: 'items(snippet(title))'
}, function(err, response) {
    if (err) {
        console.log('The API returned an error: ',err);
        return;
    }

    var video =response.data.items;
    if(video.length ==0){
        console.log('검색된 동영상이 없습니다.');
    } else {
        console.log(JSON.stringify(response.data.items[0],null,4));
    }
})
//2
service.videos.list({
    key: 'AIzaSyBInggOtXxPFYIRee0Xs3vb5iZ9YE9_518',
    part: 'snippet',
    id: '6744glqD6lk', // 동영상 Id 밤편지
    fields: 'items(snippet(title))'
}, function(err, response) {
    if (err) {
        console.log('The API returned an error: ',err);
        return;
    }

    var video =response.data.items;
    if(video.length ==0){
        console.log('검색된 동영상이 없습니다.');
    } else {
        console.log(JSON.stringify(response.data.items[0],null,4));
    }
})
//3
service.videos.list({
    key: 'AIzaSyBInggOtXxPFYIRee0Xs3vb5iZ9YE9_518',
    part: 'snippet',
    id: 'he2C4lx63M0', // 동영상 Id 마음
    fields: 'items(snippet(title))'
}, function(err, response) {
    if (err) {
        console.log('The API returned an error: ',err);
        return;
    }

    var video =response.data.items;
    if(video.length ==0){
        console.log('검색된 동영상이 없습니다.');
    } else {
        console.log(JSON.stringify(response.data.items[0],null,4));
    }
})
//4
service.videos.list({
    key: 'AIzaSyBInggOtXxPFYIRee0Xs3vb5iZ9YE9_518',
    part: 'snippet',
    id: 'xKZ3U8viuIU', // 동영상 Id 금요일에 만나요
    fields: 'items(snippet(title))'
}, function(err, response) {
    if (err) {
        console.log('The API returned an error: ',err);
        return;
    }

    var video =response.data.items;
    if(video.length ==0){
        console.log('검색된 동영상이 없습니다.');
    } else {
        console.log(JSON.stringify(response.data.items[0],null,4));
    }
})
//5
service.videos.list({
    key: 'AIzaSyBInggOtXxPFYIRee0Xs3vb5iZ9YE9_518',
    part: 'snippet',
    id: 'seFr4qWykgY', // 동영상 Id 너랑나
    fields: 'items(snippet(title))'
}, function(err, response) {
    if (err) {
        console.log('The API returned an error: ',err);
        return;
    }

    var video =response.data.items;
    if(video.length ==0){
        console.log('검색된 동영상이 없습니다.');
    } else {
        console.log(JSON.stringify(response.data.items[0],null,4));
    }
})
//6
service.videos.list({
    key: 'AIzaSyBInggOtXxPFYIRee0Xs3vb5iZ9YE9_518',
    part: 'snippet',
    id: 'r_-GQjN9Tpc', // 동영상 Id 내 손을 잡아
    fields: 'items(snippet(title))'
}, function(err, response) {
    if (err) {
        console.log('The API returned an error: ',err);
        return;
    }

    var video =response.data.items;
    if(video.length ==0){
        console.log('검색된 동영상이 없습니다.');
    } else {
        console.log(JSON.stringify(response.data.items[0],null,4));
    }
})
//7
service.videos.list({
    key: 'AIzaSyBInggOtXxPFYIRee0Xs3vb5iZ9YE9_518',
    part: 'snippet',
    id: 'OIHlzvEKncQ', // 동영상 Id 좋은날
    fields: 'items(snippet(title))'
}, function(err, response) {
    if (err) {
        console.log('The API returned an error: ',err);
        return;
    }

    var video =response.data.items;
    if(video.length ==0){
        console.log('검색된 동영상이 없습니다.');
    } else {
        console.log(JSON.stringify(response.data.items[0],null,4));
    }
})
//8
service.videos.list({
    key: 'AIzaSyBInggOtXxPFYIRee0Xs3vb5iZ9YE9_518',
    part: 'snippet',
    id: '04tYkKUPPv4', // 동영상 Id 라일락
    fields: 'items(snippet(title))'
}, function(err, response) {
    if (err) {
        console.log('The API returned an error: ',err);
        return;
    }

    var video =response.data.items;
    if(video.length ==0){
        console.log('검색된 동영상이 없습니다.');
    } else {
        console.log(JSON.stringify(response.data.items[0],null,4));
    }
})
//9
service.videos.list({
    key: 'AIzaSyBInggOtXxPFYIRee0Xs3vb5iZ9YE9_518',
    part: 'snippet',
    id: '0ldJaGupC1o', // 동영상 Id 사랑이 잘
    fields: 'items(snippet(title))'
}, function(err, response) {
    if (err) {
        console.log('The API returned an error: ',err);
        return;
    }

    var video =response.data.items;
    if(video.length ==0){
        console.log('검색된 동영상이 없습니다.');
    } else {
        console.log(JSON.stringify(response.data.items[0],null,4));
    }
})
//10
service.videos.list({
    key: 'AIzaSyBInggOtXxPFYIRee0Xs3vb5iZ9YE9_518',
    part: 'snippet',
    id: 'l0rcWimJmQ8', // 동영상 Id 봄 사랑, 벛꽃 말고
    fields: 'items(snippet(title))'
}, function(err, response) {
    if (err) {
        console.log('The API returned an error: ',err);
        return;
    }

    var video =response.data.items;
    if(video.length ==0){
        console.log('검색된 동영상이 없습니다.');
    } else {
        console.log(JSON.stringify(response.data.items[0],null,4));
    }
})