Skip to content

hlymrk/torrent-stream-nextjs

Repository files navigation

Torrent for the Web 🌐

A Next.js application that converts, downloads, and streams torrents directly in the browser through a plain HTTP request.

© $crypt, ISC license.

Torrent Stream and Download

REST API Documentation 📚

Get All Torrents

{
  "endpoint": "/torrents",
  "method": "GET",
  "description": "Returns the list of all torrents"
}

Get Single Torrent

{
  "endpoint": "/torrents/{infoHash}",
  "method": "GET",
  "description": "Returns a single torrent"
}

Get Torrent Stats

{
  "endpoint": "/torrents/{infoHash}/stats",
  "method": "GET",
  "description": "Returns the torrent stats (speed, bandwidth, etc.)"
}

Get M3U Playlist

{
  "endpoint": "/torrents/{infoHash}/files",
  "method": "GET",
  "description": "Returns the M3U playlist"
}

Stream File

{
  "endpoint": " /torrents/{infoHash}/files/{path}",
  "method": "GET",
  "description": "Starts streaming the file (honoring the \`Range\` header)"
}

Pause/Resume Swarm and Peer Discovery

{
  "endpoint": "/torrents/{infoHash}/pause",
  "method": "POST",
  "description": "Pauses/resumes the swarm and peer discovery"
}

Start/Stop Download

{
  "endpoint": ["/torrents/{infoHash}/start", "/torrents/{infoHash}/stop"],
  "method": "POST",
  "description": "Starts/stops the download by selecting/deselecting all files"
}

Start/Stop Downloading a File

{
  "endpoint": [
    "/torrents/{infoHash}/start/{index}",
    "/torrents/{infoHash}/stop/{index}"
  ],
  "method": "POST",
  "description": "Starts/stops downloading a particular file (by index)"
}

Add New Torrent

{
  "endpoint": "/torrents",
  "method": "POST",
  "description": "Adds a new torrent (\`{"link":"magnet link or URL"}\`)"
}

Upload Torrent File

{
  "endpoint": " /upload",
  "method": "POST",
  "description": "Accepts a .torrent file as an attachment (\`file\` field in \`multipart/form-data\`)"
}

Delete Torrent

{
  "endpoint": "/torrents/{infoHash}",
  "method": "DELETE",
  "description": "Deletes the torrent"
}

Feel free to use and contribute to this project! 🚀

About

convert and stream torrents on the web via magnet URLs or torrent files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages