1
Javascript/HTML5를 사용하여 Youtube 비디오 메타 데이터를 검색하는 방법은 무엇입니까? 친절하게 링크를 공유하십시오.Javascript/HTML5를 사용하여 Youtube 비디오 메타 데이터 가져 오기
Javascript/HTML5를 사용하여 Youtube 비디오 메타 데이터를 검색하는 방법은 무엇입니까? 친절하게 링크를 공유하십시오.Javascript/HTML5를 사용하여 Youtube 비디오 메타 데이터 가져 오기
var xhr = new XMLHttpRequest();
xhr.open('GET', "https://www.googleapis.com/youtube/v3/videos?part=snippet&id=<video ID>&fields=items/snippet/title,items/snippet/description&key=<API key>");
xhr.send();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
var response = JSON.parse(xhr.responseText);
// console.log("Description:", response.items[0].snippet.description);
// var text = response.items[0].snippet.description;
var text = "Find me at sand also at fgdyh thrj hrtyrt fhrtgh";
var html = findUrls(text);
function findUrls(text) {
var source = (text || '').toString();
var urlArray = [];
var url;
var matchArray;
// Regular expression to find FTP, HTTP(S) and email URLs.
var regexToken = /(((ftp|https?):\/\/)[\-\[email protected]:%_\+.~#?,&\/\/=]+)|((mailto:)?[_.\w-][email protected]([\w][\w\-]+\.)+[a-zA-Z]{2,3})/g;
// Iterate through any URLs in the text.
while ((matchArray = regexToken.exec(source)) !== null) {
var token = matchArray[0];
urlArray.push(token);
}
YouTube API를 보셨습니까? https://developers.google.com/youtube/js_api_reference#Queueing_Functions
예 youtube API를 확인했습니다. 비디오 메타 데이터 검색에 사용할 수있는 플러그인이 있습니까? – CBU