Music Torrent Tool

Important:

This tool is not advertised in the descriptions of RKHM and is not supported. It exists for research purposes and personal use only.

Torrenting and downloading copyrighted material without proper authorization is illegal and can result in serious legal consequences. The "Music Torrent" tool within the RKHM CMS is provided for research and personal use only. Users are solely responsible for ensuring that their use of this tool complies with all applicable laws and regulations. We strongly advise against using this tool for any activities that infringe on copyright laws. Also please note that torrenting is never fully safe, beware of your server's security

Don't:

  • Don't use this tool if your country or your server's location's country is harsh towards torrenting.
  • Don't use this tool for commercial purposes or in an online project, as this may result in legal problems.
  • Don't download copyrighted material without proper authorization.
  • Don't take these warnings lightly.

How does it work?

It allows you to create a new type of music cronjob with "Torrent" as the API and "Music album" as the object type. When these new cronjobs are executed, the script goes through every single album, searches public torrent websites (such as The Pirate Bay, 1337x, and LimeTorrents) for semi-verifiable related torrents, and then uses the Transmission BitTorrent Client (which should be installed on your server) to try to download audio files for your items. It will keep checking the state of torrents in the background and remove stalled ones after a while. For successfully downloaded torrents, if the files are in mp3 format, they are used directly. Otherwise, the script will use FFmpeg to convert these files to mp3 before using them.

In other words, it downloads mp3 files for your albums from torrents

How to use it?

  1. Install 'Transmission BitTorrent Client' on your server
  2. Install and configure FFmpeg. Docs
  3. Install "Music torrent" tool in your RKHM
  4. Visit `Admin -> Setting -> Torrent -> Setting` and enter your Transmission RPC credentials
  5. Visit `Admin -> Content -> Music -> Cronjobs` and create a new cronjob. Choose `torrent` as api-name and `album` as object-type. In query, choose `dynamic IDS` and then use the filters to select the album(s) you wish to be downloaded from torrents
  6. Visit `Admin -> Setting -> Cronjobs -> Logs` to check the progress. You can also check the Transmission web-ui

Transmission configuration

  1. Install Transmission ( & transmission-daemon ) on your server
  2. Stop the daemon. Locate and edit settings.json, whitelist your server's ip ( and your own ), change username & password and save the file. Restart the daemon
  3. Create a folder somewhere in public_html, and give Transmission access to it
  4. Visit `Admin -> Setting -> Music Torrent -> Setting` and enter your Transmission RPC url & auth
  5. 'Transmission RPC URL' is something like "http://yourdomain:9091/transmission/rpc" or "http://127.0.0.1:9091/transmission/rpc" assuming you haven't changed the default port & path. 
  6. 'Transmission Auth' is username:password which you have entered in settings.json
  7. 'Transmission Download Dir' is the absolute path to the directory, for example: "/home/ramin/public_html/somefolder". Make sure Transmission's user ( debian-transmission on my Ubuntu 22.04 ) has access to this folder
  8. Set 'Stop seeding at radio' to 0 otherwise RKHM will wait until seeding is finished on Transmission