嗨,我正尝试从js的Oauth API获取Google照片中图像的直接链接。我正在获取未在image src属性中打开但在浏览器中打开的产品url和基本url。请帮忙。
我尝试了这些示波器 https://www.googleapis.com/auth/photoslibrary https://www.googleapis.com/auth/photoslibrary.sharing https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata
function photo_execute() {
return gapi.client.photoslibrary.mediaItems.search({
"resource": {}
})
.then(function(response) {
console.log('response', response);
var imgArr = response.result.mediaItems;
console.log(response.result);
var str = '';
for (i = 0; i < imgArr.length; i++) {
str = str + '<div style="width:100px;height:100px;display:inline-block;margin:10px;"><img style="width:100px; height:auto;" src="' + imgArr[i].productUrl + '"/></div>';
}
$('#status').html(str);
photo_signOut();
},
function(err) {
console.error("Execute error", err);
});
}