Fixed missing segment error for aria2c downloader

This commit is contained in:
2025-09-27 20:00:51 +02:00
parent 8ea3b5b26c
commit 393b12c7f0

View File

@@ -220,6 +220,7 @@ def download(
for dl in stopped_downloads:
if dl["status"] == "error":
error_code = int(dl.get("errorCode", 0))
used_uri = next(
uri["uri"]
for file in dl["files"]
@@ -227,6 +228,11 @@ def download(
for uri in file["uris"]
if uri["status"] == "used"
)
if error_code == 404:
yield dict(downloaded=f"[yellow]Skipped missing segment: {used_uri}")
continue # dont raise, safely ignore
error = f"Download Error (#{dl['gid']}): {dl['errorMessage']} ({dl['errorCode']}), {used_uri}"
error_pretty = "\n ".join(textwrap.wrap(
error,