27

I am not able to download file using gdown package.It is giving permission error. But when i am opening it manually.It is giving no such error and opening up fine. Here is the code i am using and link

import gdown
url='https://drive.google.com/uc?id=0B1lRQVLFjBRNR3Jqam1menVtZnc'
output='letter.pdf'
gdown.download(url, output, quiet=False)

Error is Permission denied: https://drive.google.com/uc?id=0B1lRQVLFjBRNR3Jqam1menVtZnc Maybe you need to change permission over 'Anyone with the link'?

DennisLi
  • 3,915
  • 6
  • 30
  • 66
jatin rajani
  • 495
  • 1
  • 6
  • 15
  • This seems like a problem with the permissions of the file. Take into account that `gdown` need to be able to see the file as you are not introducing any permissions the link must be completely public. If you want you can file a bug in the [official `gdown` library](https://github.com/wkentaro/gdown). – Raserhin Mar 19 '20 at 09:06

5 Answers5

64

In my case, I ran the following command and try using gdown, and problem was solved:

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

If you are using google-colab, try:

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

then: !gdown --id [id of your file]

s.abbaasi
  • 952
  • 6
  • 14
14

instead of

gdown <drive-id>

type

gdown "<drive-id>&confirm=t"

for large files.

Melih Dal
  • 393
  • 4
  • 12
9

If you're working with big files (in my case was a >1gb file), you can solve by copying the url from 'Download anyway' button in Google Drive.

vitorffd
  • 106
  • 1
  • 6
  • 3
    I am using gdown.cli. `python3 -m gdown.cli 0B1lRQVLFjBRNR3Jqam1menVtZnc` gives me the error, but when I use the URL with "confirm=t" it works: `python3 -m gdown.cli "https://drive.google.com/uc?id=0B1lRQVLFjBRNR3Jqam1menVtZnc&confirm=t"` – Eric Stdlib Nov 23 '22 at 21:34
  • 6
    simply calling `gdown "&confirm=t"` works. and yes problem is large file. – Melih Dal Nov 24 '22 at 02:27
  • 1
    Thanks @MelihDal for your answer ! This work like a charm for big file on Google Drive ! Thanks ! – Jérémie Guillot Nov 26 '22 at 18:59
2

Create your downloadable zip folder and make it "Anyone with the link" and change "Viewer" to "Editor".

Finally use:

!gdown --id 'id of the file'
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Amar Blog
  • 21
  • 2
  • This would not help if the file is coming from someone else and all we have is the google drive link without any permission to make aforementioned changes – Farid Alijani Dec 25 '22 at 13:22
2

pip install --upgrade --no-cache-dir gdown didn't work for me.

You can try pre-released version of this : pip install -U --no-cache-dir gdown --pre This worked for me.

JRiggles
  • 4,847
  • 1
  • 12
  • 27