All Projects → epistrephein → rarbg

epistrephein / rarbg

Licence: MIT license
Ruby client for the RARBG Torrent API.

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to rarbg

Api Fuzzer
API Fuzzer which allows to fuzz request attributes using common pentesting techniques and lists vulnerabilities
Stars: ✭ 238 (+1300%)
Mutual labels:  ruby-gem, rubygem
ruby-sdk
♦️ Ruby SDK to use the IBM Watson services.
Stars: ✭ 45 (+164.71%)
Mutual labels:  ruby-gem, rubygem
Torrents-Api
Torrent Api ✨
Stars: ✭ 82 (+382.35%)
Mutual labels:  rarbg, torrentapi
jekyll-gzip
Generate gzipped assets and files for your Jekyll site at build time
Stars: ✭ 34 (+100%)
Mutual labels:  ruby-gem, rubygem
hatenablog
A Ruby gem for Hatena Blog AtomPub API
Stars: ✭ 40 (+135.29%)
Mutual labels:  ruby-gem, ruby-client
glimmer-dsl-tk
Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library)
Stars: ✭ 26 (+52.94%)
Mutual labels:  ruby-gem, rubygem
ruby terraform
A simple Ruby wrapper for invoking terraform commands.
Stars: ✭ 92 (+441.18%)
Mutual labels:  ruby-gem, rubygem
Str metrics
Ruby gem (native extension in Rust) providing implementations of various string metrics
Stars: ✭ 68 (+300%)
Mutual labels:  ruby-gem, rubygem
glimmer-dsl-swt
Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)
Stars: ✭ 53 (+211.76%)
Mutual labels:  ruby-gem, rubygem
ruby attic
💍 Unmaintained ruby projects needing people!
Stars: ✭ 26 (+52.94%)
Mutual labels:  ruby-gem, rubygem
Matestack Ui Core
Matestack enables you to create sophisticated, reactive UIs in pure Ruby, without touching JavaScript and HTML. You end up writing 50% less code while increasing productivity, maintainability and developer happiness.
Stars: ✭ 469 (+2658.82%)
Mutual labels:  ruby-gem, rubygem
glimmer-dsl-opal
Glimmer DSL for Opal (Pure-Ruby Web GUI and Auto-Webifier of Desktop Apps)
Stars: ✭ 22 (+29.41%)
Mutual labels:  ruby-gem, rubygem
gcra-ruby
Generic cell rate algorithm (leaky bucket) implementation for rate limiting
Stars: ✭ 49 (+188.24%)
Mutual labels:  ruby-gem
jekyll-extlinks
This Jekyll plugin adds custom attributes (rel="nofollow", target="_blank", etc.) to external links in your content.
Stars: ✭ 18 (+5.88%)
Mutual labels:  ruby-gem
Dry Schema
Coercion and validation for data structures
Stars: ✭ 249 (+1364.71%)
Mutual labels:  ruby-gem
oanda api
A ruby client for the Oanda REST API.
Stars: ✭ 35 (+105.88%)
Mutual labels:  rubygem
tty-platform
Operating system detection
Stars: ✭ 28 (+64.71%)
Mutual labels:  ruby-gem
Unimidi
Realtime MIDI IO for Ruby
Stars: ✭ 229 (+1247.06%)
Mutual labels:  ruby-gem
Caxlsx
xlsx generation with charts, images, automated column width, customizable styles and full schema validation. Axlsx excels at helping you generate beautiful Office Open XML Spreadsheet documents without having to understand the entire ECMA specification. Check out the README for some examples of how easy it is. Best of all, you can validate your xlsx file before serialization so you know for sure that anything generated is going to load on your client's machine.
Stars: ✭ 221 (+1200%)
Mutual labels:  ruby-gem
Filestack Rails
Official Ruby on Rails plugin for Filestack File Picker that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
Stars: ✭ 220 (+1194.12%)
Mutual labels:  ruby-gem

RARBG

Ruby client for the RARBG Torrent API.

RubyGemsDocumentation

Gem Version Build Status Dependencies
Maintainability Test Coverage Inline Docs

Installation

Install as a gem

$ gem install rarbg

Or add it to your Gemfile and execute bundle install

gem 'rarbg', '~> 2.0'

Usage

This gem wraps all API methods available from RARBG TorrentAPI.

An authentication token is automatically generated on the first request, stored with a timestamp and renewed every 800 seconds.

Rate limit (1req/2s) is automatically enforced.

Check out the full documentation for details on all methods and parameters.

Getting started

Require the gem and initialize a new RARBG::API object.

require 'rarbg'

rarbg = RARBG::API.new

Methods

Use list to list torrents. Additional parameters are passed as keyword arguments and can be mixed together.

All successful method calls return an array of hashes (or an empty array for no results).

# List last 100 torrents.
rarbg.list(limit: 100)

# List torrents with at least 20 seeders, sorted by seeders.
rarbg.list(min_seeders: 20, sort: :seeders)

# List torrents with extended json infos.
rarbg.list(format: :json_extended)

Use search to search torrents. One search type parameter among string, imdb, themoviedb and tvdb is required.

# Search torrents using literal string query.
rarbg.search(string: 'Force Awakens')

# Search by IMDB id, in `Movies/x264/1080` and `Movies/x264/720`.
rarbg.search(imdb: 'tt2488496', category: [44, 45])

# Search unranked torrents by TheMovieDB id, sorted by last.
rarbg.search(themoviedb: 140607, ranked: false, sort: :last)

These methods are also available from the top module namespace for convenience.

RARBG.list(sort: :leechers, min_leechers: 10)

RARBG.search(string: 'Star Wars', category: [48])

A list of name/id pairs for each category is available for quick lookup.

RARBG::CATEGORIES
# => { "Movies/XVID"     => 14,
#      "Movies/XVID/720" => 48,
#      "Movies/x264"     => 17,
#      ...

Errors

API endpoint errors will raise a RARBG::APIError exception with the API error message.

rarbg.list(sort: :name)
# => RARBG::APIError: Invalid sort

rarbg.search(string: 'Star Wars', min_seeders: 'notanumber')
# => RARBG::APIError: Invalid value for min_seeders

rarbg.search(imdb: 'tt0121765')
# => RARBG::APIError: Service unavailable (503)

Parameter validation errors on client side will raise an ArgumentError.

rarbg.list('a string instead of an hash')
# => ArgumentError: Expected params hash

rarbg.search(limit: 50)
# => ArgumentError: One search parameter required among: string, imdb, tvdb, themoviedb

Lower level connection errors will raise Faraday::Error subclasses exceptions.

rarbg.search(string: 'a timeout error')
# => Faraday::ConnectionFailed: execution expired

Contributing

Bug reports and pull requests are welcome on GitHub.

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Code of Conduct.

You can contribute changes by forking the project and submitting a pull request. To get started:

  1. Fork the repo
  2. Install the dependencies (bin/setup)
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Pass the test suite (rake spec)
  6. Push to the branch (git push origin my-new-feature)
  7. Create a new pull request

For more information about contributing to this project, check out CONTRIBUTING.

License

This gem is released as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].