Update app.py
Browse files
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 |
-
|
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 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
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}")
|