Skip to content
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

Add skip_download option to download_folder to return the list of files without download #317

Conversation

wkentaro
Copy link
Owner

@wkentaro wkentaro commented Feb 3, 2024

Close #310
Close #309

Why?

In #309, @o-laurent explained an interesting use case where he wants to select which file to download in a Google Drive folder based on its file name.

What is this?

If you pass skip_download=True to download_folder, you can get list of files as list of tuple of (id, path, local_path).
After that you can just use gdown.download to download the ones you want.

# Example:
files = gdown.download_folder(..., skip_download=True)
for file in files:
    if file.path.endswith(".txt"):
        gdown.download(id=file.id, output=file.local_path)

@wkentaro wkentaro self-assigned this Feb 3, 2024
@wkentaro wkentaro force-pushed the add_dry_run_option_to_download_folder_to_return_the_list_of_files_without_download branch from 0e51393 to f65a5cf Compare February 3, 2024 13:28
@wkentaro wkentaro added the feature for pr label Feb 3, 2024
@wkentaro wkentaro force-pushed the add_dry_run_option_to_download_folder_to_return_the_list_of_files_without_download branch from f65a5cf to 1c53066 Compare February 3, 2024 13:32
@wkentaro wkentaro merged commit f3bee0c into main Feb 3, 2024
2 checks passed
@wkentaro wkentaro deleted the add_dry_run_option_to_download_folder_to_return_the_list_of_files_without_download branch February 3, 2024 13:34
@wkentaro wkentaro changed the title Add dry_run option to download_folder to return the list of files without download Add skip_download option to download_folder to return the list of files without download Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature for pr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant