Skip to content

torrust/torrust-hash2torrent

Repository files navigation

Torrust Hash2Torrent

Testing Container

A web service to get torrents' metadata from the infohashes.

The API is based on the Rust BitTorrent client rqbit. The client uses BEP 9 to get the Metadata Files from other peers.

NOTICE: DHT must be enabled because the client needs to find peers first.

Live demo: https://hash2torrent.com/

Setup

sudo ./contrib/dev-tools/init/install.sh $(id -u)
cargo run

With Docker

Building the image from sources:

sudo ./contrib/dev-tools/init/install.sh $(id -u)
./contrib/dev-tools/containers/docker-build.sh
./contrib/dev-tools/containers/docker-run.sh

Usage

Download the torrent with curl:

curl -o ./ubuntu-23.04-desktop-amd64.iso.torrent http://127.0.0.1:3000/torrents/443c7602b4fde83d1154d6d9da48808418b181b6

Or with the browser:

http://127.0.0.1:3000/torrents/443c7602b4fde83d1154d6d9da48808418b181b6

NOTICE: The BitTorrent client may not find the torrent and the HTTP could return a 408 (timeout) error after 10

You can check the API with the health_check endpoint: http://127.0.0.1:3000/health_check

Troubleshooting

Session Directory Not Found

If you see an error about the session output directory not being found:

Error: Session output directory not found: /var/lib/torrust/hash2torrent/session

Make sure you've run the setup script first:

sudo ./contrib/dev-tools/init/install.sh $(id -u)

This script creates the necessary directories with proper permissions for the BitTorrent client session data.

Torrent Not Found (408 Timeout)

The BitTorrent client needs to find peers through DHT before it can download the metadata. This process can take time, and the request may timeout (10 seconds default). If this happens:

  • DHT needs time to bootstrap and find peers
  • Try the request again after a few moments
  • Some torrents may have very few or no active peers
  • Check that your network allows DHT traffic on the configured port

Acknowledgments

ikatson main contributor to rqbit.

About

A web service to get torrents' metadata from the infohashes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors 3

  •  
  •  
  •