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)
Close https://github.com/wkentaro/gdown/pull/310 Close https://github.com/wkentaro/gdown/discussions/309
Why?
In https://github.com/wkentaro/gdown/discussions/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
todownload_folder
, you can get list of files as list of tuple of (id, path, local_path). After that you can just usegdown.download
to download the ones you want.