https://github.com/bluecap-se/yarr
I feel lucky, for The Pirate Bay
https://github.com/bluecap-se/yarr
docker nodejs pirate-bay
Last synced: about 2 months ago
JSON representation
I feel lucky, for The Pirate Bay
- Host: GitHub
- URL: https://github.com/bluecap-se/yarr
- Owner: bluecap-se
- License: mit
- Created: 2013-12-27T18:04:20.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-11-04T00:40:03.000Z (over 5 years ago)
- Last Synced: 2024-04-14T09:02:42.230Z (about 1 year ago)
- Topics: docker, nodejs, pirate-bay
- Language: JavaScript
- Homepage: https://www.npmjs.org/package/yarr
- Size: 55.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE
Awesome Lists containing this project
README
# Yarr!
[](https://circleci.com/gh/bluecap-se/yarr)
[](https://gemnasium.com/bluecap-se/yarr)
[](https://www.npmjs.com/package/yarr)
[](https://registry.hub.docker.com/u/bluecap/yarr/)*I feel lucky*, for [The Pirate Bay](https://thepiratebay.se/). A micro HTTP service,
for picking the best torrent available for download, by searching TPB.## Install
Yarr! can be installed as a package either via NPM or Docker.
#### Using Docker
```console
$ docker run -d -p 80:8080 bluecap/yarr:latest
```#### Using a package manager
```console
$ npm install yarr
```## Usage
```console
$ yarr
Server started on localhost:8080
```This will start the HTTP server, with [default config](https://github.com/bluecap-se/yarr/blob/master/lib/defaults.json).
Then navigate to [localhost:8080](http://localhost:8080)### Full options
```console
$ yarr -hI feel lucky, for The Pirate Bay
Usage:
yarr []
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 versionExamples:
yarr (run the server with default config)
yarr ~/config.json
yarr --host localhost --port 8080
```#### Using Docker
Options can be set as environment variables. Only `source` and `api-key` can be set, the rest
can be configured by using the [port option](https://docs.docker.com/reference/commandline/run/).```console
$ docker run -d -p 80:8080 -e API_KEY='secret' -e SOURCE='http://thepiratebay.se' bluecap/yarr:latest
```## Use case
#### Getting the best torrent
Here, [HTTPie](https://github.com/jakubroztocil/httpie) is used when calling the API over HTTP. Using Curl is another option.
```console
$ 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"
}
```#### Getting the magnet
Here, [jq](http://stedolan.github.io/jq/) is used to parse the result from Yarr!. The result can then be piped to a torrent application of your choice.
```console
$ http localhost:8080/search q==Game s==1 e==5 hd==720p | jq .magnet
magnet:?xt=urn:
```## API
All response is JSON formatted.
#### Perform a search
Returned is the best matching torrent.```console
$ 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
#### Check version
Returned is the running version of Yarr!```console
$ http localhost:8080/version
{
"version": "1.1.0"
}
```## Run tests
```console
$ make test
```## License
Published under [MIT License](https://github.com/bluecap-se/yarr/blob/master/LICENSE).