yarr

I feel lucky, for The Pirate Bay.

Yarr!

I feel lucky, for The Pirate Bay. A micro HTTP service, for picking the best torrent available for download, by searching TPB.

$ npm install yarr
$ yarr
Server started on localhost:8080

This will start the HTTP server, with default config. Then navigate to localhost:8080

$ yarr -h
 
I feel lucky, for The Pirate Bay
 
Usage:
    yarr [<config>]
    yarr [options]
 
Options:
    --host=HOST       Set server host
    --port=PORT       Set server port
    --source=URL      Set The Pirate Bay URL
    --api-key=TOKEN   Set API-key
    -h --help         Show this screen
    -v --version      Show version
 
Examples:
       yarr (run the server with default config)
       yarr ~/config.json
       yarr --host localhost --port 8080

Here, HTTPie is used when calling the API over HTTP. Using Curl is another option.

$ http localhost:8080/search q==Game s==1 e==5 hd==720p
{
    "name": "...",
    "added": "05-16 2011",
    "magnet": "magnet:?xt=urn:...",
    "size": "1.46 GiB",
    "seeders": "69",
    "leachers": "10"
}

Here, jq is used to parse the result from Yarr!. The result can then be piped to a torrent application of your choice.

$ http localhost:8080/search q==Game s==1 e==5 hd==720p | jq .magnet
magnet:?xt=urn:

All response is JSON formatted.

Returned is the best matching torrent.

$ http localhost:8080/search q==value [param==value]
Param Required Description Input type
q Yes Search query. Freetext string
s No Season, for shows. Number
e No Episode, for shows. Requires season. Number
hd No Flag for HD. 720p, 1080p

Returned is the running version of Yarr!

$ http localhost:8080/version
{
    "version": "1.0.1"
}
$ make test

Published under MIT License.