mayswind / AriaNg

AriaNg, a modern web frontend making aria2 easier to use.

Home Page:http://ariang.mayswind.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When Metalink item fails and gets retried, "name" attribute is ignored

maliayas opened this issue · comments

I'm using AriaNg Native and I don't know if this issue belongs to AriaNg, AriaNg Native or aria2.

If an item in a Metalink file fails, the GUI provides a button to retry it. However using that button causes the download destination to be completely ignored.

Sample Metalink:

<?xml version="1.0" encoding="UTF-8"?>
<metalink version="3.0" xmlns="http://www.metalinker.org/" xmlns:a0="http://www.downthemall.net/properties#" >
    <files>
        <file name="lorem/ipsum.zip" >
            <resources>
                <url type="http" >https://download.gimp.org/pub/gimp/v2.10/windows/gimp-2.10.36-setup.exe</url>
            </resources>
        </file>
    </files>
</metalink>

If the download succeeds at first try, then the file successfully get saved as "lorem/ipsum.zip" (mind the subfolder). However if it fails and then I "retry", <file name="lorem/ipsum.zip" > becomes completely ignored as if I manually added a new URL.

When you retry a task, AriaNg would submit the download url and all original task options (including the file name set by user) to aria2. So it is very useful when retrying the task which downloads http url.
But the metalink file can also contain a custom filename, which aria2 neither put it as a task option nor can AriaNg get it through the RPC interface. Although AriaNg can get the full absolute file path of old task, if AriaNg submits this path to aria2, aria2 may consider the file already exists and cause a new failure.
Therefore, the current solution is a compromise for retry metalink task.

So "retrying" feature for Metalink is not a first class citizen in aria2. Maybe we can 1. get old task's info 2. delete old task 3. submit new task with the same info?

Or should I open an issue in aria2 repo?

If you think there is no robust solution to this usecase, you can close the issue.

So "retrying" feature for Metalink is not a first class citizen in aria2. Maybe we can 1. get old task's info 2. delete old task 3. submit new task with the same info?

aria2 itself does not support "retrying task". The "retrying task" feature of AriaNg is based on the existing api of aria2. I think you can ask aria2 why the download path specified in the metalink file is not set to the task options of aria2, but I think aria2 may not make the adjustment.