aria2 0.0.1 aria2: ^0.0.1 copied to clipboard
An aria2 api package developed with dart which can be used in a flutter project, support http and websocket connection to an aria2 jsonrpc server.
Aria2-Dart-Package #
An aria2 api package developed with dart which can be used in a flutter project, support http and websocket connection to an aria2 jsonrpc server.
Features #
- Connect to an aria2 jsonrpc server, control the aria2 downloader remotely.
- Support http, websocket.
- Support secret authentication
Getting started #
flutter get aria2
Usage #
You can use this package like this:
import 'package:aria2/aria2.dart';
// protocol can be "http" or "websocket"
Aria2c aria2c = Aria2c(rpcUrl, protocol, secret);
var version = await aria2c.getVersion();
print(version.toString());
// return {"id":"flutter","jsonrpc":"2.0","result":{"enabledFeatures":["Async DNS","BitTorrent","Firefox3 Cookie","GZip","HTTPS","Message Digest","Metalink","XML-RPC","SFTP"],"version":"1.36.0"}}
var globalStatus = await aria2c.getGlobalStat();
print(globalStatus.toString());
//return {"id":"flutter","jsonrpc":"2.0","result":{"downloadSpeed":"0","numActive":"0","numStopped":"34","numStoppedTotal":"36","numWaiting":"0","uploadSpeed":"0"}}
More aria2 usage can be found at aria2c API
Additional information #
If you have any usage problem ,please tell me in the Issues.