goindex-theme-acrou
goindex-theme-acrou copied to clipboard
Allow setting acknowledgeAbuse to true
I have some executable files in my drive which google thinks contain a virus. I want to download these files like any others.
Right now, I cannot copy these files through my mounted Google Drive - I have to go to their website and download it from there, ignoring the virus warning.
It seems the google drive api allows doing this without manual confirmation using the extra parameter acknowledgeAbuse=true ( https://developers.google.com/drive/api/v3/manage-downloads#using_altmedia )
It would be very helpful if you could extend your tool to allow setting this option so that I can work with all of my files through it.
Thank you!
async down(id, range = "", inline = false) {
let url = `https://www.googleapis.com/drive/v3/files/${id}?alt=media`;
//add
if(!inline) url += "&acknowledgeAbuse=true";
let requestOption = await this.requestOption();
requestOption.headers["Range"] = range;
let res = await fetch(url, requestOption);
const { headers } = (res = new Response(res.body, res));
this.authConfig.enable_cors_file_down &&
headers.append("Access-Control-Allow-Origin", "*");
inline === true && headers.set("Content-Disposition", "inline");
return res;
}