Mpi
Mpi

Reputation: 31

How to Automatically Download a Google Drive File that Requires Virus Scan Confirmation

I'm trying to automate the download of a file from Google Drive using VBA, but I'm running into an issue where Google Drive requires confirmation due to a virus scan warning. Specifically, when I request the file URL, Google Drive returns a page with the following message:

"Google Drive can't scan this file for viruses. Would you still like to download this file?"

This requires clicking the "Download Anyway" button, which I can't automate effectively with my current VBA setup. I'm using the WinHTTP request in VBA to interact with the Google Drive URL.

I've tried extracting the confirm token from the HTML response and appending it to the URL, like:

https://drive.google.com/uc?export=download&id=FILE_ID&confirm=TOKEN

However, even after doing this, I still get a page that prompts for confirmation rather than the file being directly downloaded.

What I've Tried So Far: Extracted the confirm token from the HTML response. Added custom headers like User-Agent and Referer to mimic a real browser request. Modified the URL with the confirmation token, but it still results in another confirmation page. Question: Has anyone successfully managed to automate the downloading of a Google Drive file that requires confirmation due to the virus scan warning? Are there any additional steps I need to take, such as special headers, simulating button clicks, or using a different approach to handle the Google Drive security check?

Any guidance would be greatly appreciated!

Upvotes: 0

Views: 96

Answers (0)

Related Questions