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).
- Search from YGGTorrents
- Search from Nyaa.si
- Add torrent files from YGGTorrents
- Add magnet links from Nyaa.si
- Download torrents from Transmission
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.
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
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
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.
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.
This application has only been tested with Node 12.22.12 and 18.17.1.
- Clone this repository:
git clone https://github.com/MozkaGit/torrent-downloader.git
- Navigate to the project directory:
cd torrent-downloader
- Install dependencies:
npm install
- 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.
- Ensure you're in the project directory.
- Start the application:
node torrent.js
- Use the API endpoints detailed below to use the downloader.
/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.
Perform a search : http://{{transmissionHost}}:3000/nyaa?anime={{your_query}}
Download a torrent : http://{{transmissionHost}}:3000/choice2?number={{your_number_query]]
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.
MozkaGit