How to use aria2 - 6 common examples

To help you get started, we’ve selected a few aria2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github projectOpenRAP / OpenRAP / devmgmtui / src / components / cloud / DownloadManager.js View on Github external
import { CLOUD_DOWNLOAD_CONFIG } from '../../config/config';

import Aria2 from 'aria2';
const aria2 = new Aria2(CLOUD_DOWNLOAD_CONFIG);

export default class DownloadManager {

	constructor(dir) {
		this.connected = false;
		this.dir = dir;
		this.aria2 = aria2;

		this.aria2.on('close', () => {
			console.log('Disconnected from the download manager.');
			this.connected = false;
			this.connect();
		});

		this.aria2.on('open', () => {
			console.log('Connected to the download manager.');
github agalwood / Motrix / src / renderer / api / Api.js View on Github external
initClient () {
    const {
      rpcListenPort: port,
      rpcSecret: secret
    } = this.config
    const host = '127.0.0.1'
    this.client = new Aria2({
      host,
      port,
      secret
    })
    this.client.open()
  }
github baptistecdr / aria2-extensions / src / downloader / downloader.js View on Github external
constructor(settings) {
        this.settings = settings;
        this.aria2 = new Aria2(settings.toJSON());
    }
github hamidfzm / aria2-relectron / src / aria2.js View on Github external
import Aria2 from 'aria2';

const aria2 = new Aria2();

export const Open = () => aria2.open();
export const Close = () => aria2.close();
export const AddURI = (uri, options) => aria2.call('addUri', [uri], options);

export default aria2;
github hugetiny / negibox / src / api / Api.js View on Github external
constructor (options = {}) {
    this.options = options

    this.client = null
    this.loadConfig()
    const {
      rpcListenPort: port,
      rpcSecret: secret
    } = this.config
    const host = '127.0.0.1'
    this.client = new Aria2({
      host,
      port,
      secret
    })
    this.client.open()
  }
github zaidka / cliget / lib / getters.js View on Github external
exports.aria2 = function(request, filename) {
  if (request.method !== "GET" || request.payload)
    return null;

  let cmd = "aria2c";

  for (let i in request.headers) {
    cmd += ' --header ' + escapeShellArg(request.headers[i]);
  }

  if (filename)
    cmd += ' --out ' + escapeShellArg(filename);

  cmd += ' ' + escapeShellArg(request.uri);

  let aria2Options = prefs['aria2.options'];
  if (aria2Options)
    cmd += ' ' + aria2Options;

  return cmd;
};

aria2

Library and for aria2, "The next generation download utility."

ISC
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular aria2 functions