Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied although I have set to "anyone with link" #146

Closed
thibaulttabarin opened this issue Feb 15, 2022 · 23 comments
Closed

Permission denied although I have set to "anyone with link" #146

thibaulttabarin opened this issue Feb 15, 2022 · 23 comments
Labels
feature for pr

Comments

@thibaulttabarin
Copy link

I have 355 MB file on google drive
I have download before with gdown and it worked (around Nov 2021)
Today 14 Feb 2022, when I tried again it didn't worked.

I use : gdown --id
Error:
Access denied with the following error:

    Cannot retrieve the public link of the file. You may need to change
    the permission to 'Anyone with the link', or have had many accesses. 

You may still be able to access the file from the browser:

     https://drive.google.com/uc?id=1QWzmHdF1L_3hbjM85nOjfdHsm-iqQptG 

I am the owner of the file on Google drive, I checked again for the status of the link (set to "Anyonae with the link")

I have asked a colleague to download the file and it worked for him using the same command : gdown --id
I uninstall and reinstall gdown
Still doesn't work
Any idea?

@thibaulttabarin
Copy link
Author

Solved!
after restarting my terminal. It worked!
I have no idea why. If someone knows?

@p208p2002
Copy link

having the same question, but still stuck. it might be google's problem

@d-01
Copy link

d-01 commented Feb 15, 2022

Stopped working for large files (197.4MB) about a day ago. Looks like google made some breaking changes recently.

Update:
Strange behavior: after restarting the session (Colab notebook) the first big file is downloaded successfully, the second download (same or another big file) fails with the error. Small files are not affected.

@wkentaro
Copy link
Owner

FYI: it probably the same problem as #43

@p208p2002
Copy link

so strange, same code pass on gh-action but failed on my own machine.
try add option --no-cookies, that works for me.

@d-01
Copy link

d-01 commented Feb 16, 2022

Google Drive link (Get link → Anyone with the link): https://drive.google.com/file/d/1AHn99gSXRWjPHixmni1Z5fAQ9Jf3xjrt/view?usp=sharing

> gdown --id 1AHn99gSXRWjPHixmni1Z5fAQ9Jf3xjrt

Access denied with the following error:

 	Cannot retrieve the public link of the file. You may need to change
	the permission to 'Anyone with the link', or have had many accesses. 

You may still be able to access the file from the browser:

	 https://drive.google.com/uc?id=1AHn99gSXRWjPHixmni1Z5fAQ9Jf3xjrt
  1. Same result with --no-cookies.
  2. Changing permissions (restricted, viewer, editor) didn't help.
  3. Small files work OK.

When the "Download anyway" button is pressed, a direct link is generated:

firefox_2022-02-16_041657+03

This link works only in the same browser.

@zagzam
Copy link

zagzam commented Feb 16, 2022

Same issue here.

@robmoore
Copy link

robmoore commented Feb 16, 2022

The page that is displayed (see comment two up for an example) contains a link in the source that can be used to download the item without being forced to click the button. The link has a query parameter of confirm=t. I'm able to download a file using curl like so:

curl -L -s -o data/my-file.h5 'https://drive.google.com/uc?id=my-file-id-here&confirm=t

@ZDisket
Copy link

ZDisket commented Feb 16, 2022

@robmoore This works for me if I modify it slightly
curl -L -o 'FILENAME.h5' 'https://drive.google.com/u/0/uc?id=MY_ID_HERE&export=download&confirm=t'
(I also removed the -s to ensure it is downloading the correct file)

mttr2021 added a commit to mttr2021/MTTR that referenced this issue Feb 16, 2022
Fixed a bug that prevented the Colab demo from downloading the model checkpoint file from Google Drive.
Apparently, the bug was caused by Google's recent changes to Google Drive which bricked all current Python methods to download large files from their servers.
The bug was fixed by moving the checkpoint file to OneDrive.
wkentaro/gdown#146
@VKarpick
Copy link

In the last week, I started having this problem with a file that I hadn't previously had any trouble with. This is the fix I found:

gdown.download(
    f"https://drive.google.com/uc?export=download&confirm=pbef&id={file_id}",
    output
)

@Edoardoba
Copy link

In the last week, I started having this problem with a file that I hadn't previously had any trouble with. This is the fix I found:

gdown.download(
    f"https://drive.google.com/uc?export=download&confirm=pbef&id={file_id}",
    output
)

This solution worked for me. Huge thanks

@wkentaro
Copy link
Owner

@VKarpick It also worked in my environment! Thank you so much for finding the solution!!
#147 will include your solution. Hope this fixes all the problems related to Permission Error after many accesses.

@wkentaro
Copy link
Owner

wkentaro commented Feb 17, 2022

Gdown v4.3.0 is out! https://github.com/wkentaro/gdown/releases/tag/v4.3.0
Hope it fixes this issue. (Please request reopening if not)

FYI, you can upgrade gdown by:

pip install --upgrade --no-cache-dir gdown

@abdelmalek13
Copy link

In the last week, I started having this problem with a file that I hadn't previously had any trouble with. This is the fix I found:

gdown.download(
    f"https://drive.google.com/uc?export=download&confirm=pbef&id={file_id}",
    output
)

The new version still produced the same error, but this comment solve it.
Thanks 🙏

@wkentaro
Copy link
Owner

wkentaro commented Mar 8, 2022

@abdelmalek13 Can you possibly share the file id (privately via email)? I need to know why is that.

@reisner
Copy link

reisner commented Mar 22, 2022

@wkentaro Does it have something to do with open vs uc links? The first snippet below works (using the open link) and the second doesn't (using the uc link):

# Works:
>>> for i in range(10):
...     gdown.download('https://drive.google.com/open?id=1EC5XAM-maBPsbMTfvpBs_NFo3UC_qFMy', 'temp.pdf', use_cookies = False, quiet = True)
... 
'temp.pdf'
'temp.pdf'
'temp.pdf'
'temp.pdf'
'temp.pdf'
'temp.pdf'
'temp.pdf'
'temp.pdf'
'temp.pdf'
'temp.pdf'
# Fails
>>> for i in range(10):
...     gdown.download('https://drive.google.com/uc?id=1EC5XAM-maBPsbMTfvpBs_NFo3UC_qFMy', 'temp.pdf', use_cookies = False, quiet = True)
... 
Access denied with the following error:

        Cannot retrieve the public link of the file. You may need to change
        the permission to 'Anyone with the link', or have had many accesses. 

You may still be able to access the file from the browser:

         https://drive.google.com/uc?id=1EC5XAM-maBPsbMTfvpBs_NFo3UC_qFMy 

@abdelmalek13
Copy link

abdelmalek13 commented Mar 25, 2022

@abdelmalek13 Can you possibly share the file id (privately via email)? I need to know why is that.

I'm too sorry 🙏 @wkentaro it's a sensitive document that belonged to a customer I can't share this file with you, I'll try to reproduce the error with another dummy file

@amituofo1996
Copy link

Solved! after restarting my terminal. It worked! I have no idea why. If someone knows?

Thanks a lot

@maheshmestry
Copy link

Solved by upgrading python version 2.7 to latest along with pip3 version

@AnirudhJayant06
Copy link

AnirudhJayant06 commented Dec 21, 2022

In google colab try this, it solved my issue

!pip install --upgrade --no-cache-dir gdown

@Q8sh2ing
Copy link

Gdown v4.3.0 is out! https://github.com/wkentaro/gdown/releases/tag/v4.3.0 Hope it fixes this issue. (Please request reopening if not)

FYI, you can upgrade gdown by:

pip install --upgrade --no-cache-dir gdown

thanks, mine works after updating. Hope it doesn't crash again

@Sanyam-oss
Copy link

In the last week, I started having this problem with a file that I hadn't previously had any trouble with. This is the fix I found:

gdown.download(
    f"https://drive.google.com/uc?export=download&confirm=pbef&id={file_id}",
    output
)

Huge Thanks ! Saviour

@Bastukorv
Copy link

Hello!
I understand if this is a beginners question, but nonetheles:
I get the above error msg:

"Access denied with the following error:

Cannot retrieve the public link of the file. You may need to change
the permission to 'Anyone with the link', or have had many accesses. 

You may still be able to access the file from the browser:"

And I have tried reading through the fixes for this problem. However, Im not sure how to try them since I just use GitHub through the web browser to do RVC (change audio files through pre-trained voice models). All I do is run a session with the small play-button and I dont know how to solve the problem that I can no longer add new AI-voice models.

Is this problem solvable without using external software (many are refering to updating python and gdown)
Thanks for your help! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature for pr
Projects
None yet
Development

No branches or pull requests