wkentaro / gdown

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

Failed with "too many users have viewed.." even it is a new created file. #325

Closed ILG2021 closed 4 months ago

ILG2021 commented 4 months ago

Provide environment information

python 3.11 gdown 5.1.0

What OS are you using?

windows 11

Describe the Bug

Today I find that gdown can not work regularly. it failed to download even it is a new shared file:

Failed to retrieve file url:

    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:

    https://drive.google.com/uc?id=1lW4mf5YNtS4MAD7ZkAauDDWp2N3_Qzs7

but Gdown can't. Please check connections and permissions.

Expected Behavior

No response

To Reproduce

gdown https://drive.google.com/file/d/1lW4mf5YNtS4MAD7ZkAauDDWp2N3_Qzs7/view?usp=sharing --fuzzy

No response

davidsvy commented 4 months ago

I also encounter this with Python 3.10.12 on Ubuntu 22.04.3 LTS. I tried all versions of gdown from 5.1.0 to 4.7.1, but to no avail.

ILG2021 commented 4 months ago

I also encounter this with Python 3.10.12 on Ubuntu 22.04.3 LTS. I tried all versions of gdown from 5.1.0 to 4.7.1, but to no avail.

I think it is not related with os or gdown version, Google may update Security Mechanism.

ariefwijaya commented 4 months ago

Happened to me as well

Vidalnt commented 4 months ago

I have fixed this in a fork, but now it is mandatory that your google cookies are in the gdown cache.

https://github.com/IAHispano/gdown/commit/97bbdd4b2faada3bb5f1c773072261cc2dd54fec

wkentaro commented 4 months ago
% curl -L 'https://drive.usercontent.google.com/download?id=1lW4mf5YNtS4MAD7ZkAauDDWp2N3_Qzs7&confirm=t&uuid=f17ffa73-0e4b-4dea-a93c-12d3998030dc&export=download'

curl returns this with the "redirected url", so not sure what we can do to go further than this.

image

Even on a browser with Incognito mode:

image

Vidalnt commented 4 months ago

you forgot to put &at=idkforthis in the link like:

https://drive.usercontent.google.com/download?id=1RXpQlyovMrMJ0I0vvOk2ASPBN9LQ2WZ9&export=download&authuser=0&confirm=t&uuid=910396da-73bf-4cb9-be19-53bcd9d93666&at=APZUnTW26RpJ4RqCVf......

if you put this link in incognito of course it will not work because the cookies will be missing.

and the way to get it is to go to inspect element on the page and look at this part of the html image

try to complete the url in your browser without being in incognito mode and you will see that it works. that's why I said cookies were necessary.

wkentaro commented 4 months ago

What is the point of this tool if it doesn't work in Incognito mode?

Vidalnt commented 4 months ago

I don't know, but it helped me to know when the link works or not. xd

The only thing I know is that I don't know

Anyway, I repeat it again, it seems that the json with cookies will be necessary now, (in my case I have not used it in my life because I had no problems with gdown, but from one day to another now I have to do it). And I am writing all this for a translator, I am Spanish.

now I realize that I am in a very old version, in which the json is no longer used xD , well, at least that makes the process easier.

wkentaro commented 4 months ago

I mentioned GoogleDrive account on Twitter/X. Not sure if it helps. https://twitter.com/wkentaro_/status/1757343518622888088

I believe this needs a change from GoogleDrive's side. It won't allow us to access the file without sign-in even using a browser (so the reason why Gdown can't is not due to lack of Javascript, User-agent, etc).

rmcpantoja commented 4 months ago

Hi, I can confirm this issue as well. I suppose that alternatives or already integrated custom cookies could be created for this after these changes that Google made. I use gdown in my projects🥺.

Vidalnt commented 4 months ago

thanks kentaro, it seems that google already fixed it. :D

ILG2021 commented 4 months ago

Thanks everyone for you help.

wkentaro commented 4 months ago

Confirmed. Gdown tests are all green now. Thanks for the report.