Rats Search server using WebSockets for internal communication. It require two way communication and using socket.io internally. As alternative added REST API implementation, but because of one-way limitation, it require periodic check of backward messages with /api/queue . You free to choise one of the ways for communication and implementation of your own client.
At first you need to prepare server non-interface version
git clone --recurse-submodules https://github.com/DEgITx/rats-search.git
npm install --force
npm run buildweb
npm run server
You need to enable REST API configuration (disabled by default):
edit rats.json (change only restApi value):
{
"restApi": true
}
set restApi to true, save
endpoint (GET REQUEST):
https://localhost:8095/api/searchTorrent?text=DEgITx&navigation={}
example of request:
{
"text": "Search Name of the torrent",
"navigation": {
"index": 0,
"limit": 10,
"orderBy": "order_field",
"orderDesc": "DESC",
"safeSearch": false
}
}
Field | Type | Optional | Default Value | Description |
---|---|---|---|---|
text | string | ❎ | torrent search name | |
navigation | object (Navigation) | ✅ | object with navigation params | |
index | int | ✅ | 0 | stating of torrent index of navigation |
limit | int | ✅ | 10 | max number of results on page |
orderBy | text | ✅ | field which is using for order results | |
orderDesc | enum [DESC, ASC] | ✅ | ASC | sort direction of the field |
safeSearch | bool | ✅ | true | disable/enable safe search for torrents |
type | string | ✅ | type of content for search | |
size | object (Interval) | ✅ | size of torrent | |
min | uint64 | ✅ | minumum size of the torrent | |
max | uint64 | ✅ | maximum size of the torrent | |
files | object (Interval) | ✅ | files on the torrent | |
min | int | ✅ | minumum size of the torrent | |
max | int | ✅ | maximum size of the torrent |
As said before after each request and periodicly you need to read queue for additional messages.
endpoint (GET REQUEST):
https://localhost:8095/api/queue
after executing of search /api/searchTorrent request additional result of search will be in queue!
endpoint (GET REQUEST):
https://localhost:8095/api/searchFiles?text=TorrentWithFileName&navigation={}
Field | Type | Optional | Default Value | Description |
---|---|---|---|---|
text | string | ❎ | torrent search name | |
navigation | object (Navigation) | ✅ | object with navigation params | |
index | int | ✅ | 0 | stating of torrent index of navigation |
limit | int | ✅ | 10 | max number of results on page |
orderBy | text | ✅ | field which is using for order results | |
orderDesc | enum [DESC, ASC] | ✅ | ASC | sort direction of the field |
safeSearch | bool | ✅ | true | disable/enable safe search for torrents |
endpoint (GET REQUEST):
https://localhost:8095/api/checkTrackers?hash=29ebe63feb8be91b6dcff02bacc562d9a99ea864
Field | Type | Optional | Default Value | Description |
---|---|---|---|---|
hash | string | ❎ | torrent hash to refresh token |
endpoint (GET REQUEST):
https://localhost:8095/api/topTorrents?type=video&navigation={"time":"week"}
Field | Type | Optional | Default Value | Description |
---|---|---|---|---|
type | string | ❎ | type of category for top of the torrents | |
navigation | object (Navigation) | ✅ | object with navigation params (check /api/searchTorrent for mo details) | |
time | enum [hours, week, month] | ✅ | time for the top |