euler314 commited on
Commit
1f8c849
·
verified ·
1 Parent(s): 455ef67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -423,7 +423,7 @@ class DownloadManager:
423
  base, ext = os.path.splitext(fname)
424
  counter = 1
425
  while os.path.exists(path):
426
- path = os.path.join(save_dir, f"{base}_{counter}{ext}")
427
  counter += 1
428
 
429
  os.makedirs(save_dir, exist_ok=True)
@@ -464,13 +464,13 @@ class DownloadManager:
464
  path = os.path.join(save_dir, f"{base}_{counter}{ext}")
465
  counter += 1
466
 
467
- output = gdown.download(file_url, path, quiet=False)
468
- if output:
469
- return path
470
- return None
471
- except Exception as e:
472
- logger.error(f"Google Drive download error: {e}")
473
- return None
474
 
475
  async with self.context.new_page() as page:
476
  st.write(f"Downloading: {fname}")
 
423
  base, ext = os.path.splitext(fname)
424
  counter = 1
425
  while os.path.exists(path):
426
+ path = os.path.join(save_dir, f"{base}_{counter}{ext}")
427
  counter += 1
428
 
429
  os.makedirs(save_dir, exist_ok=True)
 
464
  path = os.path.join(save_dir, f"{base}_{counter}{ext}")
465
  counter += 1
466
 
467
+ output = gdown.download(file_url, path, quiet=False)
468
+ if output:
469
+ return path
470
+ return None
471
+ except Exception as e:
472
+ logger.error(f"Google Drive download error: {e}")
473
+ return None
474
 
475
  async with self.context.new_page() as page:
476
  st.write(f"Downloading: {fname}")