wkentaro / gdown

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

DeprecationWarning: Invalid escape sequence in gdown.download_folder #232

Closed LucaBonfiglioli closed 1 year ago

LucaBonfiglioli commented 1 year ago

Provide environment information

python 3.8.10 in a virtual environment of which I will not share the details. gdown version 4.6.0

What OS are you using?

Ubuntu 20.04

Describe the Bug

I get a DepcrecationWarning when downloading a folder from google drive:

python3.8/site-packages/gdown/download_folder.py:61: DeprecationWarning: invalid escape sequence '\/'

This warning gets raised because if for some reason the encoded string contains the hex 5c 2f, the decoding will fail to recognize this as a valid escape sequence. The problem is that it is perfectly normal for that sequence to appear inside the encoded data, and so I get cluttered with warnings that I have to manually catch whenever I attempt to download a folder. Can you please handle that properly?

Expected Behavior

Avoid having to deal with useless warnings when I download a folder.

To Reproduce

gdown.download_folder(url=my_folder_url)