Giter Club home page Giter Club logo

aria2-ruby's Introduction

Aria2

Aria2 JSON RPC client

Installation

Add this line to your application's Gemfile:

gem 'aria2'

And then execute:

$ bundle

Or install it yourself as:

$ gem install aria2

Usage

  # create a client instance
  client = Aria2::Client.new(host: 'localhost', port: 6800)
  client.addUri 'http://example.com/images/1.jpg', 'http://example.com/images/2.jpg'
  # or
  client.add_uri 'http://example.com/images/1.jpg', 'http://example.com/images/2.jpg'
  client.xxxx
  ...
  
  # or 
  Aria2.with(host: 'localhost', port: 6800) do |client|
    client.addUri 'http://example.com/images/1.jpg', 'http://example.com/images/2.jpg'
    client.xxxx
    ...
  end

  # or
  Aria2.with(host: 'localhost', port: 6800) do
    addUri 'http://example.com/images/1.jpg', 'http://example.com/images/2.jpg'
    xxxx
    ...
  end

  # If you invoke method end with '!', then raise Aria2::Error when json contains 'error' key
  @client = Aria2::Client.new token: 'your_token'
  @client.getVersion!
  

Suport Methods (snakecase or camelCase)

See Methods

  • addUri(*uris)
  • addTorrent(torrent) torrent is the contents of the ".torrent" file
  • addMetalink(metalink)
  • remove(gid)
  • forceRemove(gid)
  • pause(gid)
  • pauseAll
  • forcePause(gid)
  • forcePauseAll
  • unpause(gid)
  • unpauseAll
  • tellStatus(gid)
  • getUris(gid)
  • getFiles(gid)
  • getPeers(gid)
  • getServers(gid)
  • tellActive
  • tellWaiting(offset, num)
  • tellStopped(offset, num)
  • changePosition(gid, pos, how)
  • changeUri(gid, fileIndex, delUris, addUris)
  • getOption(gid)
  • changeOption(gid, options)
  • getGlobalOption
  • changeGlobalOption(options)
  • getGlobalStat
  • purgeDownloadResult
  • removeDownloadResult(gid)
  • getVersion
  • shutdown
  • forceShutdown
  • saveSession

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/songjiz/aria2-ruby.

aria2-ruby's People

Contributors

songjiz avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.