wkentaro / gdown

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

Folder Download: Subdirectories structure not kept. All files in one dir #181

Closed Dannypeja closed 1 year ago

Dannypeja commented 2 years ago

Maybe it is dumb user error but I cannot read from documentation or issues how to do this correctly:

Steps to reproduce: Use gdown in python OR CLI url = "" output = "sample-videos" gdown.download_folder(url=url, output=output, quiet=False, use_cookies=False)

Expected behavior: Download all files and subdirectories

Actual behavior: Output gives promise: Retrieving folder list completed Building directory structure Building directory structure completed BUT: No subdirectory gets created. All files get downloaded and end up in the same output directory.

wkentaro commented 2 years ago

It is working for me.

In [3]: gdown.download_folder("https://drive.google.com/drive/folders/1oow464Z4Et95RAwtRZn6dLOFb_YYpLwL?usp=sharing")
Retrieving folder list
Retrieving folder 1TMZoSAu4ecs_Q3GEEWfiyrQIPtj3DJAC folder_1
Retrieving folder 1-Z2wzjaaqqB1lBiPXNGfgkICA2Pc9q_U folder_1_1
Processing file 1eGGJOMWkEZCzfp5rT4fbZ3-lJ5ShDUST file.txt
Processing file 1T8RH3_FJMzShUfibltqBLCYvQN3QYWFG file.txt
Retrieving folder 1RRfB3nFcMtg_ibfCjoU6P6DbsrXkwnPF folder_2
Processing file 1ioOMsmyR9HRWvwTUFSPb__MoOs4wE42v file.txt
Processing file 15bpMH3clXwBJf9cdGpXIOgwKwHrg4T-- file.txt
Retrieving folder list completed
Building directory structure
Building directory structure completed
Downloading...
From: https://drive.google.com/uc?id=1eGGJOMWkEZCzfp5rT4fbZ3-lJ5ShDUST
To: /Users/wkentaro/Documents/gdown/deep_folder/folder_1/folder_1_1/file.txt
0.00B [00:00, ?B/s]
Downloading...
From: https://drive.google.com/uc?id=1T8RH3_FJMzShUfibltqBLCYvQN3QYWFG
To: /Users/wkentaro/Documents/gdown/deep_folder/folder_1/file.txt
0.00B [00:00, ?B/s]
Downloading...
From: https://drive.google.com/uc?id=1ioOMsmyR9HRWvwTUFSPb__MoOs4wE42v
To: /Users/wkentaro/Documents/gdown/deep_folder/folder_2/file.txt
0.00B [00:00, ?B/s]
Downloading...
From: https://drive.google.com/uc?id=15bpMH3clXwBJf9cdGpXIOgwKwHrg4T--
To: /Users/wkentaro/Documents/gdown/deep_folder/file.txt
0.00B [00:00, ?B/s]
Download completed
Out[3]:
['/Users/wkentaro/Documents/gdown/deep_folder/folder_1/folder_1_1/file.txt',
 '/Users/wkentaro/Documents/gdown/deep_folder/folder_1/file.txt',
 '/Users/wkentaro/Documents/gdown/deep_folder/folder_2/file.txt',
 '/Users/wkentaro/Documents/gdown/deep_folder/file.txt']

Can you give more detail to reproduce?