xeruf / monsterutilities

Browse, stream and download Monstercat Songs
GNU General Public License v3.0
31 stars 2 forks source link

[Feature Request] Add aria2 support #41

Open Naville opened 5 years ago

Naville commented 5 years ago

Aria2 is an established download manager that provides an easy-to-use RPC interface, just craft the JSON and post it. Done :)
It provides all the features you would expect from a downloader as well,

defvs commented 5 years ago

Isn't Aria2 used in uget ? If so, that would be awesome because uget is a very cool software !

Le mar. 26 mars 2019 à 17:31, Zhang notifications@github.com a écrit :

Aria2 is an established download manager that provides an easy-to-use RPC interface, just craft the JSON and post it. Done :) It provides all the features you would expect from a downloader as well,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Xerus2000/monsterutilities/issues/41, or mute the thread https://github.com/notifications/unsubscribe-auth/ASW6QEUSOr8-D3kUCJgLr_gvvFiR0XGMks5vaktpgaJpZM4cL52u .

--

Merci, Daniel Thirion (defvs) defvs.daniel@gmail.com

xeruf commented 5 years ago

How/Where do I post it, and what is the JSON structure? If you want me to implement it, I'd like to not spend much time researching but get right to the point.

Naville commented 5 years ago
{
  "id": null,
  "jsonrpc": "2.0",
  "method": "system.multicall",
  "params": [
    [
      {
        "methodName": "aria2.addUri",
        "params": [
          "token":"TOKEN",
          [
            "https://google.com.jpg"
          ],
          {
            "allow-overwrite": "false",
            "auto-file-renaming": "false",
            "dir": "C://123/",
            "gid": "3D7010A78100A8CA",
            "out": "123213213.jpg"
          }
        ]
      },
      {
        "methodName": "aria2.addUri",
        "params": [
          "token":"TOKEN",
          [
            "https://4455.com"
          ],
          {
            "allow-overwrite": "false",
            "auto-file-renaming": "false",
            "dir": "C://123/",
            "gid": "663B74EDB4189497",
            "out": "123243224.jpg"
          }
        ]
      }
    ]
  ]
}

A quick example would be something like this

Naville commented 5 years ago

Eveything else should be pretty self explainary.

You should post it to USER_PROVIDED_RPC_INTERFACE/jsonrpc, an example of the full URL would be http://127.0.0.1:6800/jsonrpc

Naville commented 5 years ago

Those remaining fields correspond to the aria2 options listed here: https://aria2.github.io/manual/en/html/aria2c.html#options

Extra docs: https://aria2.github.io/manual/en/html/aria2c.html#rpc-interface

xeruf commented 5 years ago

Okay, thanks! And how would you suggest integrating it into the existing interface?

defvs commented 5 years ago

Maybe add a "popup" to the download button (a little arrow on it's side) with the option "Download with ARIA2" ?

defvs commented 5 years ago

And btw @Naville that means that sending that rpc request will start a download on any aria2 frontend like uget ? Or will it download in Aria2 web interface ?

Naville commented 5 years ago

@defvs Web is just another client using the API accessing the aria2 core service. the same goes for the uget frontend. Sorry for the late reply