Open levicki opened 4 years ago
I'm afraid AriaNg cannot do this, but I think there are some browser addons can do this job. This page (http://ariang.mayswind.net/3rd-extensions.html) lists some browser addons. In addition, AriaNg Native provides a native desktop app and it supports opening via torrent file or magnet link.
I'm afraid AriaNg cannot do this...
On the other hand I am almost sure it could, but sadly there seems to be no interest in implementing this feature in any of Aria web UIs.
It is nice that there is a Firefox addon, but I am not looking to fully replace Firefox download manager with AriaNg, just to register AriaNg as a magnet protocol handler.
Although the web UI doesn't implement this, if the native app registers as a magnet protocol handler (association) system-wide then technically Firefox should pick this up and present you with the dialog just like with QBitTorrent (which is just another "native app" in Firefox's perspective).
@VaslD If I am not mistaken, that would require using native app?
I have AriaNg Web UI served from an Owin-based Windows Service (which I wrote myself in C#, and which also brings up and down aria2c.exe
RPC server when started/stopped). This service is running on a remote server, I am not sure how native app would fit with all this,
@mayswind I have managed to register AriaNg as protocol handler:
However, the current implementation requires URL to be base64 encoded. When clicking on the magnet link I am getting the following error:
This is expected because browser always passes the plain URL and that cannot be changed without extension or say TamperMonkey userscript.
Could you please implement an API version that accepts unencoded URL, and encodes it before passing to Aria RPC server?
For example:
https://core.levicki.lan:8001/#!/new/task?rawurl=<unencoded url here>
Then it would be possible to handle magnet links directly from AriaNg. The only other thing you would need is a button which says Register AriaNg as magnet link handler and which executes the following javascript:
<script>
navigator.registerProtocolHandler("magnet", "https://<AriaNg URL>/#!/new/task?rawurl=%s", "AriaNg");
</script>
Which would look like this (Firefox Options) after registration:
For anyone interested, I have managed to find a way to register a protocol handler in Firefox using brute force, bypassing all sanity checks.
Still, implementing unsafe URLs or just using an extension/bookmarklet would be the proper way.
For anyone interested, I have managed to find a way to register a protocol handler in Firefox using brute force, bypassing all sanity checks.
Interesting approach. Is there a way to do similar thing in Chrome perhaps?
Still, implementing unsafe URLs or just using an extension/bookmarklet would be the proper way.
I'd prefer if AriaNg exposed an API for this purpose which is compliant with normal ways browsers handle this.
In the meantime I am using Chrome extension edcakfpjaobkpdfpicldlccdffkhpbfk
.
qBitTorrent web UI has an option to register as a protocol handler for magnet links.
After it is registered, clicking on a magnet link in your browser automatically opens Add URL dialog.
Does AriaNg support that?
If not, is there any chance it could be added?
This is what I have in mind (screenshot is from Firefox):
Please check here for implementation details: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler/Web-based_protocol_handlers#Registering
The only obstacle I see is the way adding a new download is implemented at the moment. You should have a GET-able URL which receives link as a parameter. For example:
Where
%s
is a magnet link placeholder.