Я пытался получить YouTube видео из списка воспроизведения, используя Google API. Это удалось. Но я могу получить максимум 50 видео. Что мне нужно сделать, это получить более 50 или получить самые старые видео из диапазона.
Как мы можем ограничить результат в mysql.
Языки (PHP & Java Скрипты )
Мой рабочий код
<script src="https://apis.google.com/js/api.js"></script>
<script>
/**
* Sample JavaScript code for youtube.playlistItems.list
* See instructions for running APIs Explorer code samples locally:
* https://developers.google.com/explorer-help/guides/code_samples#javascript
*/
function loadClient() {
gapi.client.setApiKey("MY_API_KEY");
return gapi.client.load("https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest")
.then(function() { console.log("GAPI client loaded for API"); },
function(err) { console.error("Error loading GAPI client for API", err); });
}
// Make sure the client is loaded before calling this method.
function execute() {
return gapi.client.youtube.playlistItems.list({
"part": "snippet,contentDetails",
"maxResults": 50,
"playlistId": "PLAY_LIST_ID"
})
.then(function(response) {
// Handle the results here (response.result has the parsed body).
console.log("Response", response);
},
function(err) { console.error("Execute error", err); });
}
gapi.load("client");
</script>
Я прочитал документацию по Google API и не получил четкого ответа. Пожалуйста, не закрывайте вопрос. мне нужен четкий ответ.