ziahamza / webui-aria2

The aim for this project is to create the worlds best and hottest interface to interact with aria2. Very simple to use, just download and open index.html in any web browser.
MIT License
9.95k stars 1.47k forks source link

Adding multiple uris with custom output filenames issue #152

Open promolic1 opened 9 years ago

promolic1 commented 9 years ago

Hello.

I am writing this because I am not sure if this is a bug, or I am using this feature in a wrong way.

I want to add multiple links with a custom filename for each one like this

http://example.com/file1.txt --out=f1.txt
http://example.com/file2.txt --out=f2.txt

So, file1.txt gets saved as f1.txt and file2.txt as f2.txt.

But when I do this, every file tries to save as the last name "f2.txt". Looking at the websocket frames every url is sent with that name, "f2.txt" instead of sending them with the corresponding filenames.

Any ideas on what's wrong with my usage or the code? I was trying to look at the code but didn't had enough time to understand and find the issue.

Thanks for reading.

ziahamza commented 9 years ago

It was a bug, thanks for reporting. its now fixed in the latest master commit. It should now work as expected. Is it working for you now?

promolic1 commented 9 years ago

Thanks! Working perfectly now.

Maybe another possible issue is about the order followed by the added uris? Tell me if I need to put this in another issue.

In my previous example, the f2.txt file gets downloaded first. This behavior is intended?

ziahamza commented 9 years ago

The order is decided by aria2. We just add the downloads and show the results as aria2 downloads them. does the order in which they start matter?

On 11 July 2015 at 10:49, promolic1 notifications@github.com wrote:

Thanks! Working perfectly now.

Maybe another possible issue is about the order followed by the added uris? Tell me if I need to put this in another issue.

In my previous example, the f2.txt file gets downloaded first. This behavior is intended?

— Reply to this email directly or view it on GitHub https://github.com/ziahamza/webui-aria2/issues/152#issuecomment-120579608 .

promolic1 commented 9 years ago

Maybe it matters depending on your use case. Probably at this particular moment, not for me.

Looking at the jsonrpc frames, I see the last file sent first in the array

{"jsonrpc":2,"id":"cde64894-edaa-4ed9-b253-3bb9160148c0","method":"system.multicall","params":[[{"methodName":"aria2.addUri","params":[["http://example.com/file2.txt"],{"out":"f2.txt"}]},{"methodName":"aria2.addUri","params":[["http://example.com/file1.txt"],{"out":"f1.txt"}]},{"methodName":"aria2.tellActive"},{"methodName":"aria2.tellWaiting","params":[0,1000]},{"methodName":"aria2.tellStopped","params":[0,1000]},{"methodName":"aria2.getGlobalStat"},{"methodName":"aria2.getGlobalOption"}]]}
ziahamza commented 9 years ago

I just changed that in master. WebUI will send commands to aria2 in the right order.

On 11 July 2015 at 10:53, promolic1 notifications@github.com wrote:

Maybe it matters depending on your use case. Probably at this particular moment, not for me.

Looking at the jsonrpc frames, I see the last file sent first in the array

{"jsonrpc":2,"id":"cde64894-edaa-4ed9-b253-3bb9160148c0","method":"system.multicall","params":[[{"methodName":"aria2.addUri","params":[["http://example.com/file2.txt"],{"out":"f2.txt"}]},{"methodName":"aria2.addUri","params":[["http://example.com/file1.txt"],{"out":"f1.txt"}]},{"methodName":"aria2.tellActive"},{"methodName":"aria2.tellWaiting","params":[0,1000]},{"methodName":"aria2.tellStopped","params":[0,1000]},{"methodName":"aria2.getGlobalStat"},{"methodName":"aria2.getGlobalOption"}]]}

— Reply to this email directly or view it on GitHub https://github.com/ziahamza/webui-aria2/issues/152#issuecomment-120579742 .

promolic1 commented 9 years ago

Now is working as expected.

Thanks for the quick help!

maxsnz commented 8 years ago

Same problem now, like topicstarter's problem: I want to add multiple links with a custom filename for each one like this

http://example.com/file1.txt --out=f1.txt
http://example.com/file2.txt --out=f2.txt

But it save f2.txt and f2.txt.1

ziahamza commented 8 years ago

I will reopen this issue for now perhaps @maxsnz

gerit1a commented 5 years ago

I am having this issue as well now. It seems to be an issue with a recent commit. I am running this in a docker container (abcminiuser/docker-aria2-with-webui). Inputting any url with --out results in the download not being added. In Chrome console, this error message appears. I have tried disabling all extensions as well.

vendor.js:10083 ReferenceError: uri_options is not defined
    at app.js:504
    at Ge (vendor.js:18198)
    at Function.Ba (vendor.js:20691)
    at app.js:502
    at Ge (vendor.js:18198)
    at Function.Ba (vendor.js:20691)
    at Object.addUris (app.js:499)
    at Object.e [as cb] (vendor.js:20201)
    at app.js:2523
    at vendor.js:10985 "Possibly unhandled rejection: {}"
(anonymous) @ vendor.js:10083
(anonymous) @ vendor.js:8939
c @ vendor.js:10962
$digest @ vendor.js:11414
$apply @ vendor.js:11543
(anonymous) @ vendor.js:14492
dispatch @ vendor.js:2507
g.handle @ vendor.js:2403
gerit1a commented 5 years ago

Tracked down where it started from. Starting with this commit, this error began happening. Not sure where to fix it since this commit seems to make huge changes to the code and structure.

pratikborsadiya commented 5 years ago

@irule311 The fix is proposed in #488

anthonyraymond commented 5 years ago

Merged