Skip to content

TorrentOps: A Node.js application for performing torrent-related operations using YGGTorrent and Transmission APIs. Search and download torrents easily.

Notifications You must be signed in to change notification settings

MozkaGit/docker-torrent-downloader

Repository files navigation

Docker torrent downloader
Docker build and release

This application allows you to download torrents from Yggtorrent and Nyaa.si using various APIs. You can run it with node.js or docker (recommended).

Features

  • Search from YGGTorrents
  • Search from Nyaa.si
  • Add torrent files from YGGTorrents
  • Add magnet links from Nyaa.si
  • Download torrents from Transmission

Getting Started

The application requires a Transmission server and a Yggtorrent user account (if you want to download from Yggtorrent too). If you don't have an account, please create one.

The recommended way of running this application is by using Docker. A Docker image is available on Docker Hub and installation instructions are detailed below.

This application can also be run natively with Node.js, see the detailed instructions below.

Docker installation

Run with Docker CLI

Here is an example of a cli command to run this application:

docker run -d --name torrents \
  -p 3000:3000 \
  --restart on-failure \
  -e YGG_USERNAME='your_username' \
  -e YGG_PASSWORD='your_password' \
  -v ./torrents/:/app/torrents/ \
  mozkadocker/torrents:main

Run with Docker Compose

Here is an example of a docker-compose configuration:

version: '3.3'
services:
    torrents:
        container_name: torrents
        ports:
            - '3000:3000'
        restart: on-failure
        environment:
            - YGG_USERNAME=your_username
            - YGG_PASSWORD=your_password
        volumes:
            - './torrents/:/app/torrents/'
        image: 'mozkadocker/torrents:main'

    transmission:
      image: linuxserver/transmission
      container_name: transmission
      environment:
        - PUID=1000
        - PGID=1000
        - TZ=Europe/Paris
      volumes:
        - ./config:/config
        - ./downloads:/downloads
      ports:
        - 9091:9091
        - 51413:51413
        - 51413:51413/udp
      restart: unless-stopped

Usage

Regardless of which method you use to run your container, to interact with the application you'll need to use the endpoint api detailed a little further down in the documentation.

Environment Variables

Tweak these environment variables to modify the config as needed:

  • YGG_BASE_URL: The url of yggtorrent. Since they often change their domain name, this variable will undoubtedly be useful to you.

  • FLARESOLVER_URL: The url of your FlareSolver instance. To avoid CloudFlare blocking.

  • YGG_USERNAME: Your yggtorrent account username.

  • YGG_PASSWORD: Your yggtorrent account password.

  • TRANSMISSION_HOST: The address of your Transmission server WEB UI.

  • TRANSMISSION_PORT: The port of your Transmission server WEB UI.

  • TRANSMISSION_USER: Username of your Transmission server WEB UI.

  • TRANSMISSION_PASS: Password of your Transmission server WEB UI.

Node.js installation

This application has only been tested with Node 12.22.12 and 18.17.1.

Configuration

  1. Clone this repository: git clone https://github.com/MozkaGit/torrent-downloader.git
  2. Navigate to the project directory: cd torrent-downloader
  3. Install dependencies: npm install
  4. Modify the settings in the config.js file as needed.
const config = {
  transmission: {
    host: 'transmissionHost',
    port: 9091,
  },
  ygg: {
    baseUrl: 'https://www3.yggtorrent.wtf',
    flareSolverUrl: 'http://localhost:8191',
    username: 'username',
    password: 'password',
  },
};

*

module.exports = config;

You will need to adapt the javascript code to point to the variables in the config.js file.

Usage

  1. Ensure you're in the project directory.
  2. Start the application: node torrent.js
  3. Use the API endpoints detailed below to use the downloader.

API Endpoints

  • /ygg: Performs a search on YGGTorrent and returns the results.
  • /nyaa: Performs a search on Nyaa.si and returns the results.
  • /choice1: Downloads a torrent file from YGGTorrent and adds it to Transmission.
  • /choice2: Adds a Nyaa.si torrent via its magnet link to Transmission.

Example

Perform a search : http://{{transmissionHost}}:3000/nyaa?anime={{your_query}}

search

Download a torrent : http://{{transmissionHost}}:3000/choice2?number={{your_number_query]]

download

You can use any method to interact with the Endpoints :

  • With Postman
  • With a simple browser search
  • With a curl request
  • With Apple Shortcuts
  • and so on.

Author

MozkaGit

About

TorrentOps: A Node.js application for performing torrent-related operations using YGGTorrent and Transmission APIs. Search and download torrents easily.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published