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

Skip process only for gdrive files by breaking early #302

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions gdown/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ def download(
while True:
res = sess.get(url, stream=True, verify=verify)

if not (gdrive_file_id and is_gdrive_download_link):
break

if url == url_origin and res.status_code == 500:
# The file could be Google Docs or Spreadsheets.
url = "https://drive.google.com/open?id={id}".format(id=gdrive_file_id)
Expand Down Expand Up @@ -213,8 +216,6 @@ def download(
if "Content-Disposition" in res.headers:
# This is the file
break
if not (gdrive_file_id and is_gdrive_download_link):
break

# Need to redirect with confirmation
try:
Expand Down
Loading