torznab

Client implementation of the torznab API.
https://gitlab.com/haath/torznab-haxe

To install, run:

haxelib install torznab 0.1.0 

See using Haxelib in Haxelib documentation for more information.

README.md

torznab-haxe

build status test coverage license haxelib version haxelib downloads


Simple library for interfacing with a torznab API.

Installation

Package is available on Haxelib.

haxelib install torznab

Usage

Get the API url and key of the Torznab endpoint. In the following example Jackett is used.

var client: TorznabClient = new TorznabClient('http://jackett:9117/api/v2.0/indexers/all/results/torznab', 'api key');

Note that all methods return tink_core promises. As such they are compatible with the rest of the tink framework. For the examples here, it is assumed that tink_await is also installed, but it is not a dependency of this library.

If needed, fetch the server's capabilities.

var caps: Capabilities = @await client.getCapabilities();

trace(caps.limits.max); // server supports fetching a maximum of this many results on each search

if (caps.searching.tvSearch.available)
{
    // server supports search for tv shows
}

Then search for torrents using the search() method.

var result: SearchResult = @await client.search('the avengers');

for (torrent in result.items)
{
    trace(torrent.magnetUrl);
}

Searches can be narrowed down with the second optional argument.

client.search('the avengers', {
    searchType: Movie,
    categories: [ 2045, 2050 ], // UHD and BluRay; obtained from the server's capabilities
    limit: 10
});
Contributors
Haath
Version
0.1.0
Published
3 years ago
Dependencies
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub