• aria2c(1) JSON-RPC interface

    From Ivan Shmakov@21:1/5 to All on Sun Sep 16 08:07:15 2018
    After almost a decade of on-and-off use, I've finally learned
    the Aria2 JSON-RPC interface.

    I still consider it a bug that it only provides an AF_INET{6,}
    socket interface. Arguably, and also for security reasons,
    Unix sockets should also be supported.

    Consider, e. g.:

    $ curl --silent --data '{
    "jsonrpc": "2.0", "id": "1",
    "method": "aria2.getGlobalStat", "params": []
    }' -- http://ip6-localhost:38534/jsonrpc ; printf \\n {"id":"1","jsonrpc":"2.0",
    "result":{
    "downloadSpeed":"0","numActive":"4","numStopped":"1",
    "numStoppedTotal":"1","numWaiting":"0","uploadSpeed":"0"}}
    $ curl --silent --data '{
    "jsonrpc": "2.0", "id": "1",
    "method": "aria2.tellActive", "params": [ [
    "gid", "infoHash", "totalLength", "uploadLength",
    "uploadSpeed", "status", "numSeeders", "connections"
    ] ]
    }' -- http://ip6-localhost:38534/jsonrpc ; printf \\n {"id":"1","jsonrpc":"2.0",
    "result":[
    {"connections":"1","gid":"879f781e664fdb6c",
    "infoHash":"2e636b6583e04dbe7e9d4490e43b9eb2fb855c9c",
    "numSeeders":"0","status":"active","totalLength":"1176185140",
    "uploadLength":"39043072","uploadSpeed":"0"},
    ...]}
    $

    PS. And curl(1) should also support the --OPTION=VALUE GNU convention, IMO.

    --
    FSF associate member #7257 np. Rambo (in game theme) -- Johan Andersson

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)