Skip to content

Unofficial API (backend) for RuTracker, Kinozal, RuTor and NoNameClub for receiving torrent files and detailed information about distribution by movie title, TV series or id, and also provides RSS news feed for all providers.

License

Notifications You must be signed in to change notification settings

Lifailon/TorAPI

Repository files navigation

Image alt


English | Русский

Unofficial API (backend) for torrent trackers RuTracker, Kinozal, RuTor and NoNameClub. Used for quick search of distributions, as well as obtaining torrent files, magnet links and detailed information about distribution by movie title, TV series or distribution ID, and also provides RSS news feed for all providers.

Project is inspired by ✨ Torrent-Api-py (previously Torrents-Api) for Russian-speaking torrent providers.

You can try the public and free version, which is published on 🔼 Vercel or deploy it yourself. OpenAPI specification is available on the official Swagger Hub website.

The implementation of a simple interface (frontend) is available in the Google Chrome extension 🍿 Libre Kinopoisk for simultaneous and fast search of distributions in all available torrent trackers.

Implemented:

  • Search by Title to get all available distributions from the specified torrent tracker or from all trackers simultaneously. Each distribution has its unique identifier (used for searching by id), brief information and a link to download the torrent file.
  • Search by ID of the specified provider to get additional information: magnet link and hash sum for direct download via any torrent client, links to the cinema databases Kinopoisk and IMDb, detailed description of the film or TV series, information about the distribution and the contents of the distribution (list of files and their size).
  • Get RSS news feeds from all used providers in XML and also JSON formats.

Examples of requests and responses are available in the static documentation hosted on the GitHub Wiki.

Released under MIT license.


🔗 Full list of available providers:

Provider name Mirrors Registration Search by ID RSS
RuTracker 3 Yes* Yes Native
Kinozal 3 Yes* Yes Native
RuTor 2 No Yes Custom
NoNameClub 1 No Yes Native

* Registration is required only when downloading a torrent file via a direct link. All distributions when searching by id contain hash (cookies have already been added) and magnet links (containing a list of trackers), which allow you to immediately start downloading contents or generate a torrent file using any torrent client after downloading the metadata.

The RSS feed is accessed by redirecting the original feed. For providers that do not support RSS by default, a custom news feed has been implemented from the main page.


🚀 Deploy

You can deploy your own public API to Vercel from this repository, just click the button below and follow the instructions:

Vercel

🐳 Docker

Docker Hub

The project uses GitHub Actions workflows to build the Docker container and automatically test the functionality of all endpoints.

Run

Upload the image and run the container from the Docker Hub:

docker run -d --name TorAPI -p 8443:8443 --restart=unless-stopped lifailon/torapi:latest

If you are using a proxy server:

docker run -d --name TorAPI -p 8443:8443 --restart=unless-stopped \
  -e PROXY_ADDRESS="192.168.3.100" \
  -e PROXY_PORT="9090" \
  -e USERNAME="TorAPI" \
  -e PASSWORD="TorAPI" \
  lifailon/torapi:latest

Replace the contents of the variables for connecting to the Proxy server with your own. If you do not use authorization on the proxy server, simply do not specify these parameters when starting the container.

Compose

You can download and use the docker-compose file to build the container from Docker Hub:

curl -sO https://raw.githubusercontent.com/Lifailon/TorAPI/main/docker-compose.yml
curl -sO https://raw.githubusercontent.com/Lifailon/TorAPI/main/.env.yml

Edit the environment variables in the .env file (required if using a proxy server) and start the container:

docker-compose up -d

Local image

You can save an image downloaded from Docker Hub to transfer it to a machine that does not have Docker Hub access:

docker save -o TorAPI-Docker-Image.tar lifailon/torapi

In the release files you can download the prepared image and boot it on your machine:

docker load -i TorAPI-Docker-Image.tar

Run the container from the downloaded local image:

docker run -d --name TorAPI -p 8443:8443 --restart=unless-stopped lifailon/torapi:latest

Dockerfile

You can build the image yourself from the project's source files using dockerfile.

Clone this repository:

git clone https://github.com/Lifailon/TorAPI
cd TorAPI

Edit variables or other settings in the dockerfile if necessary:

ENV PROXY_ADDRESS="192.168.3.100"
ENV PROXY_PORT="9090"
ENV USERNAME="TorAPI"
ENV PASSWORD="TorAPI"

Build the image and run the container:

docker build -t torapi .
docker run -d --name TorAPI -p 8443:8443 --restart=unless-stopped torapi

🔨 Install

Clone the repository, install dependencies and start the server:

git clone https://github.com/Lifailon/TorAPI
cd TorAPI
npm install
npm start

By default, the server will be launched on port 8443.

You can specify a different port:

npm start -- --port 2024

For development, use nodemon mode (restarts the server when the contents of files change):

npm run dev

OpenAPI

📚 Documentation is available in the Swagger UI at: http://localhost:8443/docs через модуль swagger-ui-express. The documentation is described through the swagger-jsdoc library.

To create up-to-date or update Swagger documentation files in JSON and YAML format, use the command:

npm run docs

Proxy

Use a proxy for all requests:

npm start -- --port 2024 --proxyAddress 192.168.3.100 --proxyPort 9090

If authorization on a proxy server is required:

npm start -- --port 2024 --proxyAddress 192.168.3.100 --proxyPort 9090 --username TorAPI --password TorAPI

🧪 Tests

You can run testing to quickly check the health of all endpoints in the console:

npm start -- --test

During testing, the local server is started, a request is made to the endpoint /api/provider/test, the output is logged in JSON format and the server exits.

Change header parameter in request:

npm start -- --test --q "The Rookie"

Other projects:

  • 🔎 LibreKinopoisk Chrome Extension - adds buttons to the Kinopoisk website and provides a TorAPI interface for quickly searching for movies and TV series in open sources.

  • 🧲 Telegram bot for Kinozal - allows you to automate the process of delivering content to your TV using only phone, providing a convenient and user-friendly interface for interacting with the torrent tracker Kinozal, as well as the ability to manage the torrent client qBittorrent or Transmission on your computer and synchronization with the Plex Media Server, located remotely from home.

  • ❤️ WebTorrent Desktop api - branch (fork) of the original version of WebTorrent Desktop, which add a remote control mechanism via the REST API on base Express Framework.

  • 📡 Reverse Proxy .NET - cross-platform command line utility for implementing a .NET-based reverse proxy. It is used to provide access to hosts from one network interface to remote applications via TCP, UDP or HTTP/HTTPS protocols accessible through another network interface without unnecessary settings and with authorization support.

About

Unofficial API (backend) for RuTracker, Kinozal, RuTor and NoNameClub for receiving torrent files and detailed information about distribution by movie title, TV series or id, and also provides RSS news feed for all providers.

Topics

Resources

License

Stars

Watchers

Forks