What's new

Tutorial Aria2 - WebUI on AsusWRT-Merlin

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

rgnldo

Very Senior Member
aria2 is a lightweight multi-protocol & multi-source command-line download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink. aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces.

Features
  • Multi-Connection Download. aria2 can download a file from multiple sources/protocols and tries to utilize your maximum download bandwidth. Really speeds up your download experience.

  • Lightweight. aria2 doesn’t require much memory and CPU time. When disk cache is off, the physical memory usage is typically 4MiB (normal HTTP/FTP downloads) to 9MiB (BitTorrent downloads). CPU usage in BitTorrent with download speed of 2.8MiB/sec is around 6%.

  • Fully Featured BitTorrent Client. All features you want in BitTorrent client are available: DHT, PEX, Encryption, Magnet URI, Web-Seeding, Selective Downloads, Local Peer Discovery and UDP tracker.

  • Metalink Enabled. aria2 supports The Metalink Download Description Format (aka Metalink v4), Metalink version 3 and Metalink/HTTP. Metalink offers the file verification, HTTP/FTP/SFTP/BitTorrent integration and the various configurations for language, location, OS, etc.

  • Remote Control. aria2 supports RPC interface to control the aria2 process. The supported interfaces are JSON-RPC (over HTTP and WebSocket) and XML-RPC. aria2.github.io
iu



Instalation step:
Create Swap file
We will need the Entware-NG repository.

Code:
opkg update
opkg install aria2 lighttpd

Download the necessary configuration files.

get aria2.conf
Code:
curl -o /opt/etc/aria2.conf https://raw.githubusercontent.com/rgnldo/knot-resolver-suricata/master/aria2.conf
edit on:
set path folder download on your device.
Code:
dir= path_for_downloads


get lighttpd.conf
Code:
curl -o /opt/etc/lighttpd/lighttpd.conf https://raw.githubusercontent.com/rgnldo/knot-resolver-suricata/master/lighttpd.conf


Download pack Aria2 WebUI
Code:
curl -SL https://github.com/rgnldo/knot-resolver-suricata/raw/master/aria2_ui.tar.gz | tar -zxC /opt/share/www

Edit and setting firewall-start
Code:
iptables -A INPUT -p tcp --destination-port 6881:6999 -j ACCEPT
iptables -A OUTPUT -p tcp --source-port 6881:6999 -j ACCEPT


run aria2 and lighttpd web server
Code:
/opt/etc/init.d/S81aria2 start
Code:
/opt/etc/init.d/S80lighttpd start

Open url with Aria2 - WebUI
IP_ROUTER:81/aria2

Enjoy!
 
Last edited:
Great post!!!
Can you just help me with the download path to the USB disk?
 
aria2 is a lightweight multi-protocol & multi-source command-line download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink. aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces.

Features
  • Multi-Connection Download. aria2 can download a file from multiple sources/protocols and tries to utilize your maximum download bandwidth. Really speeds up your download experience.

  • Lightweight. aria2 doesn’t require much memory and CPU time. When disk cache is off, the physical memory usage is typically 4MiB (normal HTTP/FTP downloads) to 9MiB (BitTorrent downloads). CPU usage in BitTorrent with download speed of 2.8MiB/sec is around 6%.

  • Fully Featured BitTorrent Client. All features you want in BitTorrent client are available: DHT, PEX, Encryption, Magnet URI, Web-Seeding, Selective Downloads, Local Peer Discovery and UDP tracker.

  • Metalink Enabled. aria2 supports The Metalink Download Description Format (aka Metalink v4), Metalink version 3 and Metalink/HTTP. Metalink offers the file verification, HTTP/FTP/SFTP/BitTorrent integration and the various configurations for language, location, OS, etc.

  • Remote Control. aria2 supports RPC interface to control the aria2 process. The supported interfaces are JSON-RPC (over HTTP and WebSocket) and XML-RPC. aria2.github.io
iu



Instalation step:
Create Swap file
We will need the Entware-NG repository.

Code:
opkg update
opkg install aria2 lighttpd

Download the necessary configuration files.

get aria2.conf
Code:
curl -o /opt/etc/aria2.conf https://raw.githubusercontent.com/rgnldo/knot-resolver-suricata/master/aria2.conf
edit on:
set path folder download on your device.
Code:
dir= path_for_downloads


get lighttpd.conf
Code:
curl -o /opt/etc/lighttpd/lighttpd.conf https://raw.githubusercontent.com/rgnldo/knot-resolver-suricata/master/lighttpd.conf


Download pack Aria2 WebUI
Code:
wget -c https://github.com/rgnldo/knot-resolver-suricata/raw/master/aria2_ui.tar.gz
unpack for ~path/entware/share/www

run aria2 and lighttpd web server
Code:
/opt/etc/init.d/S81aria2 start
Code:
/opt/etc/init.d/S80lighttpd start

Open url with Aria2 - WebUI
IP_ROUTER:81/aria2

Enjoy!


Excellent Thank you very much for instructions Rgnldo - got it working perfectly - even learned about the Tar command on the journey!
 
Is anyone using this with their HTPC/kodi or "android box" ?
If so, please show us how; from what I understand of these things, it seems like it would be an ideal companion.
 
Can someone provide a use case on how this app is useful.

I'm curious since I also have a HTPC/Kodi setup.
 
Can someone provide a use case on how this app is useful.

I'm curious since I also have a HTPC/Kodi setup.
I suspect that this can run under entware on our merlin-flashed routers that have network/media server drives attached, and all we need to do is find the right app to control the torrenting feature, so that we torrent to that rather than our kodi box.
 
I suspect that this can run under entware on our merlin-flashed routers that have network/media server drives attached, and all we need to do is find the right app to control the torrenting feature, so that we torrent to that rather than our kodi box.

So this basically allow you to run bit torrent on the router then transfer the downloads elsewhere?
 
So this basically allow you to run bit torrent on the router then transfer the downloads elsewhere?

Do the torrenting on the router with the file going to the network drive/NAS, and your kodi box streams from there, possibly, yes. That’s my guess. Waiting for the OP to chime in.


Sent from my iPhone using Tapatalk
 
Yes. You can share the downloads folder. I use a Kody fork, MrMc. It is paid, but it brings several advantages.
 
What is the benefit from running the Torrent app on the router vs a pc on the network?
 
@Makaveli - it frees up resources on the streaming box, for transcoding etc I would guess. (kodi 18.6 doesn't cope well with x265 video at the moment, for instance)

@rgnldo could you post an example setup/tutorial? (this forum may not be the best place...)
 
@rgnldo can you tell me how i do this for future ref please?

unpack for ~path/entware/share/www
 
Last edited:
Yes. You can share the downloads folder. I use a Kody fork, MrMc. It is paid, but it brings several advantages.

Like this?
  1. install Aria2 as described above
  2. point your kodi addons to download to that downloads folder on the Network drive/NAS
  3. have your kodi addons use Aria2 to get the files and put them in that downloads folder
  4. have your kodi read the files from that downloads folder
I suppose if you're torrenting in a jurisdiction that doesn't take kindly to that, you could somehow have Aria2 use whatever VPN tunnel you have set up for yourself on the router.

I'm guessing here...I don't think I have the requisite understanding of how all this works or how to set it up. It seems you've piqued a bunch of interest here, @rgnldo
 
unpack for ~path/entware/share/www
As per the post, download the file, unzip and move it to the web sharing of the entware.
example:
/mnt/sda1/entware/share/www

sda1 (example) is your device USB
 
Like this?
  1. install Aria2 as described above
  2. point your kodi addons to download to that downloads folder on the Network drive/NAS
  3. have your kodi addons use Aria2 to get the files and put them in that downloads folder
  4. have your kodi read the files from that downloads folder
I suppose if you're torrenting in a jurisdiction that doesn't take kindly to that, you could somehow have Aria2 use whatever VPN tunnel you have set up for yourself on the router.

I'm guessing here...I don't think I have the requisite understanding of how all this works or how to set it up. It seems you've piqued a bunch of interest here, @rgnldo
I know what you want. But this forum has rules. This post is enough.
 
@Makaveli - it frees up resources on the streaming box, for transcoding etc I would guess. (kodi 18.6 doesn't cope well with x265 video at the moment, for instance)

@rgnldo could you post an example setup/tutorial? (this forum may not be the best place...)

Thanks for the info.

That may not be useful for me in my setup.

I use a Hi Media A5 Andriod Box which runs Kodi (need to double check which version its 18.*)

Media is stored on a HTPC(silverstone LC20M) with about 8TB's of storage space I use to do playback from this box, but now all playback is done from the Hi Media box.

There is no need to free up resources on the Android box as that is all it does is playback media does nothing else plus it has 8 cores itself.

The HTPC is a full blown PC that really just serves the data at the moment.
 
Last edited:

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top