Path: csiph.com!aioe.org!.POSTED!not-for-mail From: Ivan Shmakov Newsgroups: comp.file-sharing.bittorrent Subject: aria2c(1) JSON-RPC interface Date: Sun, 16 Sep 2018 08:07:15 +0000 Organization: Aioe.org NNTP Server Lines: 37 Message-ID: <874lepg91o.fsf@violet.siamics.net> NNTP-Posting-Host: 41vvMPMLxfEjizuK6lSUHw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cancel-Lock: sha1:0RbN+zEYKMl8Upk7iUq8P0YJQns= X-License: CC0-1.0 X-Notice: Filtered by postfilter v. 0.8.3 Xref: csiph.com comp.file-sharing.bittorrent:108 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