wkentaro / gdown

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

UnicodeEncodeError: 'ascii' codec can't encode character #635 #197

Closed gnuismo closed 2 years ago

gnuismo commented 2 years ago

Provide environment information

gdown/download_folder.py", line 345: (Not accept spanish character ex: áéíóúñ...

What OS are you using? (if relevant)

No response

Describe the Bug

output=str(file_path),

... change for ...

output=str(file_path.encode("utf-8")),

Expected Behavior

No response

To Reproduce

No response

wkentaro commented 2 years ago

How can I reproduce?

% gdown --folder 'https://drive.google.com/drive/folders/1fQrF9TapZVWrxiKmasMUbIMfPu-Kvv2J?usp=sharing'
Retrieving folder list
Processing file 1i_CrVrClbr_YNeiI50WGK8ccgpyiLg1J あいうえお.txt
Retrieving folder list completed
Building directory structure
Building directory structure completed
Downloading...
From: https://drive.google.com/uc?id=1i_CrVrClbr_YNeiI50WGK8ccgpyiLg1J
To: /Users/wkentaro/Downloads/áéíóúñ/あいうえお.txt
0.00B [00:00, ?B/s]
Download completed

% find áéíóúñ
áéíóúñ
áéíóúñ/あいうえお.txt
gnuismo commented 2 years ago

imagen

changed

imagen

wkentaro commented 2 years ago

Can you provide the following?

Provide environment information

Please run which python; python --version; python -m pip list | grep gdown in the root directory of your project and paste the results.

What OS are you using?

Please specify the exact version. For example: macOS 12.4, Ubuntu 20.04.4

gnuismo commented 2 years ago
root@casa:~# python --version; python -m pip list | grep gdown
Python 2.7.16
gdown                         4.4.0      
root@casa:~# uname -a
Linux casa 4.19.0-10-rpi #1 Debian 4.19.132-1 (2020-07-24) armv6l GNU/Linux

Sorry, I'm not sure if the solution is the most convenient. But for my case, I use UTF-8, it works and allows me to use the command. On the other hand, would it be possible to specify that only files that have changed be downloaded?

Anyway, thank you very much for your work.

wkentaro commented 2 years ago

Thank you. I think the issue should have something to do with Python2.

On the other hand, would it be possible to specify that only files that have changed be downloaded?

It can't at the moment. Please open a discussion to request the feature.