wkentaro / gdown

Google Drive Public File Downloader when Curl/Wget Fails
MIT License
4.29k stars 350 forks source link

Added fake user agent #97

Closed CITIZENDOT closed 3 years ago

CITIZENDOT commented 3 years ago

I am surprised that, this is not being used here. By passing User-Agent header, Google drive assumes the request is coming from a browser, and it avoids following errors.

Access denied with the following error:

    Too many users have viewed or downloaded this file recently. Please
    try accessing the file again later. If the file you are trying to
    access is particularly large or is shared with many people, it may
    take up to 24 hours to be able to view or download the file. If you
    still can't access a file after 24 hours, contact your domain
    administrator.
You may still be able to access the file from the browser:
wkentaro commented 3 years ago

It seems there still could be the same error even with this. Did you find this actually mitigates the occurrence of the error?

CITIZENDOT commented 3 years ago

Yes. It avoided that error for me. And, Also it is very obvious that, Google drive doesn't have any captchas. So, It relies only on user agent to check if it's an actual browser.

CITIZENDOT commented 3 years ago

You could test this with this URL

gdown https://drive.google.com/uc\?id\=13iUHHP3SlNg53qSuQZDdHDSDNdBP9nwy

wkentaro commented 3 years ago

Hmm, once I reached the limit, it won't recover even with setting user agent. But probably it won't happen so frequently if we always set user-agent.