I am writing the system to check available google drive links from users. A user will share the public link from their google drive (Anyone with the link). To make sure that I would link to check every link from users. It can be accessed.
Therefore, I try to use javascript to check their link. This is my example code.
$('#videoCkeck').on('click', function () {
console.log("check");
fetch('https://drive.google.com/file/d/1AunwLGuDlprNnM8KBIl7zZLLrYISCGFz/view?usp=sharing')
.then(response => {
console.log('response.status: ', response.status); // ️ 200
console.log(response);
})
.catch(err => {
console.log("error",err);
});
});
The google link in the above code can be accessed but I got some error when I tried to check it.
This is an error that I got it.
Please anyone suggest me? Thank you.