RARBG
This is a very simple rarbg api wrapper in Node using Promises.
Installation
$ npm i rarbg --save
Usage
const RarbgApi = // Create a new instance of the moduleconst rarbg = // Or create a new instance with different configurationconst rarbg = host: 'torrentapi.org' path: '/pubapi_v2.php?' app_id: 'my_application' user_agent: 'My Application 0.0.1'
Methods
There are two methods, search()
and list()
that you can use. The search()
method takes an object of options (see below) for various searching and sorting capabilities. Both methods return an array of objects containing filename
, category
, and download
properties, or an error in the case of nothing being found or a different error.
// Searching by various parametersrarbg // List recent torrentsrarbg
Options
Searching
search_string
: The string to searchsearch_imdb
: Search by imdb idsearch_tvdb
: Search by tvdb idsearch_themoviedb
: Search by TMdb id
Categories
category
: The only two string values can be'movies'
and'tv'
, but you can use the following constants:
rarbgcategoriesXXXrarbgcategoriesMOVIES_XVIDrarbgcategoriesMOVIES_XVID_720rarbgcategoriesMOVIES_X264rarbgcategoriesMOVIES_X264_1080rarbgcategoriesMOVIES_X264_720rarbgcategoriesMOVIES_X264_3DrarbgcategoriesMOVIES_X264_4KrarbgcategoriesMOVIES_X265_4KrarbgcategoriesMOVIES_X265_4K_HDRrarbgcategoriesMOVIES_FULL_BDrarbgcategoriesMOVIES_BD_REMUXrarbgcategoriesTV_EPISODESrarbgcategoriesTV_HD_EPISODESrarbgcategoriesMUSIC_MP3rarbgcategoriesMUSIC_FLACrarbgcategoriesGAMES_PC_ISOrarbgcategoriesGAMES_PC_RIPrarbgcategoriesGAMES_PS3rarbgcategoriesGAMES_XBOX_360rarbgcategoriesSOFTWARE_PC_ISOrarbgcategoriesE_BOOKS // `category` can be an array to search in more than one categoryrarbg
Sorting
sort
: Possible values are'seeders'
,'leechers'
, or'last'
Limiting
limit
: Possible values are25
,50
, or100
. Default is25
Minimum seeders/leechers
min_seeders
: Numerical value for the minimum seeders availablemin_leechers
: Numerical value for the minimum leechers available