Skip to content

Commit

Permalink
stop recursing at max depth lol
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderGi committed Jan 29, 2024
1 parent 38badb9 commit 1c8179c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions daras_ai_v2/gdrive_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def url_to_gdrive_file_id(f: furl) -> str:


def gdrive_list_urls_of_files_in_folder(f: furl, max_depth=10) -> list[str]:
if max_depth <= 0:
return []
# get drive folder id from url (e.g. https://drive.google.com/drive/folders/1Xijcsj7oBvDn1OWx4UmNAT8POVKG4W73?usp=drive_link)
folder_id = f.path.segments[-1]
service = discovery.build("drive", "v3")
Expand Down

0 comments on commit 1c8179c

Please sign in to comment.