0
Google youtube API无法通过错误的请求和无效的密码登录 我几次在Google控制台更新我的凭据。Google youtube API无法通过错误的请求和无效的密码登录
更改API键几次但问题都是一样的。
使用的代码I'm:
var channelname = 'mipaltan';
$(document).ready(function() {
$.get("https://www.googleapis.com/youtube/v3/channels", {
part: 'contentDetails',
forUsername: 'mipaltan',
key: 'AIzaSyCT8kXaxJ2l29vYg4HBdYy36H-PhAH-Teg'
},
\t function (data) {
\t $.each(data.item, function (i, item) {
\t console.log(item);
\t pid = item.contentDetails.relatedPlaylists.uploads;
\t getVids(pid);
\t })
\t }
);
function getVids(pid) {
$.get("https://www.googleapis.com/youtube/v3/playlistItems", {
part: 'snippet',
maxResults: 10,
playListId: pid,
key: 'AIzaSyCT8kXaxJ2l29vYg4HBdYy36H-PhAH-Teg'
},
function (data) {
var output;
$.each(data.items, function (i, item) {
console.log(item);
vidsTitle = item.snippet.title;
output = '<li>"+ vidsTitle +"</li>';
// Append to results
$('#results').append(output);
})
}
\t);
}
});
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title> Get Video Title</title>
<style>
body {
background: #f4f4f4;
font-family: Arial,sans-serif;
font-size: 14px;
color: #666;
}
#container
{
width: 100%;
height: auto;
overflow:auto;
margin: auto;
\t padding:15px;
}
</style>
<script src="http://code.jquery.com/jquery-1.11.1.js"></script>
<script src="js/script.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div id="container">
<h1> YouTube Video Title</h1>
<ul id="results"></ul>
</div>
</form>
</body>
</html>
非常感谢你,我亲爱的朋友们,我不是忘了你, –
不要忘记点击接近我的回答绿色的复接受它 – madalinivascu