-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Unsanitized filenames #340
Comments
Another note, google drive allows slashes in file names, meaning by the time the download function receives the output path it is impossible to tell whether that slash is part of a file name or represents a folder, so atleast some part of the sanitization would need to happen in the download_folder file. (The error raised here is related to trying to write to a nonexistant folder) |
Also, line 185 in download_folder.py does "file.name.replace(osp.sep, '_')" |
@OmarAHex Can you give me an example so that I can reproduce? |
Same problem, when I tried to download a drive folder like "2024/04/12", the gdown took this folder name as directory name and then suddenly the folder structure turn out to be ./2024/04/12 which is annoying for me. I recommend to add "restrict filename" option to filter or even omit the "unsafe symbols" before creating the local structure. |
or just an option to omit the creating of google drive parent folder.If we already had proper folder structure before, there is no need to re-create another duplicate parent folder. |
Provide environment information
Python 3.11.5 on windows
What OS are you using?
Windows 11
Describe the Bug
When downloading a folder, if any of the filenames in the folder contains an asterisk, gdown attempts to create a tempfile without changing it's base name to remove invalid characters such as /:?<>|
This is the error message
OSError: [Errno 22] Invalid argument: 'C:\Users\....filename.pdfo9gwxp5ltmp'
I'm specifying the tempfile because that's where the error pops up, not sure if the final file would have the same problem.
Expected Behavior
No response
To Reproduce
No response
The text was updated successfully, but these errors were encountered: