Closed benscarlson closed 8 months ago
I can also confirm this issue
seems content_disposition does not contain filename so regex failed. Failing back to filename_from_url = osp.basename(url)
for now
Can confirm that this error arose for us today as well - three different computers (two sessions on GitHub Codespaces and a local computer). gdown
version = 4.7.1
Hot fix: Downgrading to 4.6.1 fixes it:
pip install gdown==4.6.1
Also seeing the same issue with gdown 4.7.1. Used last week without issue on Cygwin via Windows, but now getting the none type error noted above
Same problem, maybe google changed something to block gdown.
Same problem, maybe google changed something to block gdown.
How would it make any sense for them to decide to block gdown?
But yeah, I am getting the same error.
same issue, was relying on this
import gdown
url = "https://drive.google.com/file/d/1jjJ8k3L-BzFKSevoGo6yaJ-jCjc2SCK1/view"
filename = gdown.download(url, quiet=False, fuzzy=True)
When I run the code from jupyter notebook, I get Content-Disposition
:
attachment; filename="clean_battle_anony_20240109.json"
but when I run from file, I get
attachment; filename="clean_battle_anony_20240109.json"; filename*=UTF-8''clean_battle_anony_20240109.json
so it crashes only from jupyter.
yes me too, currently face the same issue. Yesterday still working.
Same problem here. I use google colab
and get this error:
Traceback (most recent call last):
File "/usr/local/bin/gdown", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/dist-packages/gdown/cli.py", line 156, in main
filename = download(
File "/usr/local/lib/python3.10/dist-packages/gdown/download.py", line 259, in download
filename_from_url = m.groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
My gdown version is the latest: v4.7.1.
I found out that versions above and equal to v4.6.4 are facing this probem but v4.6.3 is working fine. so all you need to do as a user is to downgrade your version:
pip install gdown==v4.6.3
I had this issue and also a permission error (“file is not public”). I believe both are connected to the removal of the headers:
headers = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36" # NOQA }
I readded them to the latest version and it fixed both issues.
This does appear to be an issue of a hard-coded assumption about the format of the Content-Disposition header entry which has changed. We've encountered the problem inside and outside notebooks.
Hello, why the developer still don't fix it, gdown is widely used.
@guesalomon Where should I add them?
@guesalomon Where should I add them?
You can add it on the line 153 of the download.py file:
res = sess.get(url, stream=True, verify=verify)
change to:
headers = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36" # NOQA }
res = sess.get(url, stream=True, headers=headers, verify=verify)
)
Quick Fix:
I found out that versions above and equal to v4.6.4 are facing this probem but v4.6.3 is working fine. so all you need to do as a user is to downgrade your version:
pip install gdown==v4.6.3
The above fixed it for me. Just downgrade the package to v4.6.3 for now!
pip install gdown==v4.6.3
It worked for me also downgrading the version, but I was just giving the author a hint on what fixed it for me!
@guesalomon Thank you.
i also face the same issue, but downgrading gdown version is working fine
Same issue here:
File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/gdown/download.py", line 248, in download
filename_from_url = m.groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
Downgrading the package to v4.6.3 solved it for me :smile:
Hi @wkentaro and all, I've fixed these two bugs in #293.
Hey guys. Sorry for being late (I missed the notifications), but this should be fixed now via https://github.com/wkentaro/gdown/pull/295 and the latest release.
v4.7.3 fixed the issue for me! Thank you wkentaro and everyone else who figured out the issue!
Hello, why the developer still don't fix it, gdown is widely used.
Please be respectful of the people who built a software that is widely used
Provide environment information
/Users/benc/.pyenv/shims/python Python 3.10.6 gdown 4.7.1
What OS are you using?
macOS Ventura 13.1 (M1)
Describe the Bug
Traceback (most recent call last): File "/Users/benc/.pyenv/versions/3.10.6/bin/gdown", line 8, in
sys.exit(main())
File "/Users/benc/.pyenv/versions/3.10.6/lib/python3.10/site-packages/gdown/cli.py", line 143, in main
filenames = download_folder(
File "/Users/benc/.pyenv/versions/3.10.6/lib/python3.10/site-packages/gdown/download_folder.py", line 303, in download_folder
filename = download(
File "/Users/benc/.pyenv/versions/3.10.6/lib/python3.10/site-packages/gdown/download.py", line 259, in download
filename_from_url = m.groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
Expected Behavior
It should download the folder
To Reproduce
This is accessing a folder with many large files. I'm sorry the folder can't be shared publically.