Spaces:
Running
Running
Update gofile_downloader.py
Browse files- gofile_downloader.py +3 -3
gofile_downloader.py
CHANGED
|
@@ -231,7 +231,7 @@ class Downloader:
|
|
| 231 |
json_data = response.json()
|
| 232 |
if json_data.get("status") != "ok":
|
| 233 |
error_msg = json_data.get("error", "Unknown error")
|
| 234 |
-
raise RuntimeError(f"
|
| 235 |
|
| 236 |
data = json_data["data"]
|
| 237 |
|
|
@@ -322,7 +322,7 @@ class Manager:
|
|
| 322 |
time.sleep(1) # backoff nhẹ
|
| 323 |
continue
|
| 324 |
|
| 325 |
-
raise RuntimeError("Không thể tạo hoặc lấy account token
|
| 326 |
|
| 327 |
def run(self):
|
| 328 |
self._create_account_token() # ← gọi hàm này thay vì _set_account_access_token
|
|
@@ -357,7 +357,7 @@ def download_gofile(url: str, password: str | None = None) -> tuple[str, str]:
|
|
| 357 |
|
| 358 |
content_dir = os.path.join(tmp_base, content_id)
|
| 359 |
if not os.path.exists(content_dir) or not os.listdir(content_dir):
|
| 360 |
-
raise RuntimeError("Không tải được file hoặc thư mục
|
| 361 |
|
| 362 |
zip_path = os.path.join(tmp_base, f"{content_id}.zip")
|
| 363 |
with zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED) as zf:
|
|
|
|
| 231 |
json_data = response.json()
|
| 232 |
if json_data.get("status") != "ok":
|
| 233 |
error_msg = json_data.get("error", "Unknown error")
|
| 234 |
+
raise RuntimeError(f"API trả về lỗi: {error_msg} (status: {json_data.get('status')})")
|
| 235 |
|
| 236 |
data = json_data["data"]
|
| 237 |
|
|
|
|
| 322 |
time.sleep(1) # backoff nhẹ
|
| 323 |
continue
|
| 324 |
|
| 325 |
+
raise RuntimeError("Không thể tạo hoặc lấy account token")
|
| 326 |
|
| 327 |
def run(self):
|
| 328 |
self._create_account_token() # ← gọi hàm này thay vì _set_account_access_token
|
|
|
|
| 357 |
|
| 358 |
content_dir = os.path.join(tmp_base, content_id)
|
| 359 |
if not os.path.exists(content_dir) or not os.listdir(content_dir):
|
| 360 |
+
raise RuntimeError("Không tải được file hoặc thư mục")
|
| 361 |
|
| 362 |
zip_path = os.path.join(tmp_base, f"{content_id}.zip")
|
| 363 |
with zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED) as zf:
|