goindex-theme-acrou icon indicating copy to clipboard operation
goindex-theme-acrou copied to clipboard

Allow setting acknowledgeAbuse to true

Open DKB0512 opened this issue 5 years ago • 1 comments

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!

DKB0512 avatar Jul 20 '20 02:07 DKB0512

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;
  }

christan-duplicate avatar Jun 02 '21 03:06 christan-duplicate