utorrent-web-api
A powerful and complete implementation of the uTorrent Web API. It is compatible with both Javascript and TypeScript!
Note: This library is a work in progress, so not all features may be available.
Installation
npm i utorrent-web-api
Examples
Some neat examples to show the simplicity and power of the API.
Create a Client
Creating a new uTorrent client instance is easy!
; // Create an instance of the client;
Add Torrents
Torrents can be added by .torrent URL, magnet link, or file upload.
// Add a torrent via .torrent URL or magnet linkutorrent; // Add a torrent via .torrent file uploadWORK IN PROGRESS
List Torrents
It's easy to get the list of torrents currently in uTorrent!
let myAddedTorrent; utorrent;
Working with Torrents
Once you have a torrent object, you can use that object to work with the torrent directly. Each time an action is performed, it will update all of its attributes with the latest information from the server. View the full Torrent documentation here: Torrent Docs
// Check if the torrent status indicates it's pausedif myAddedTorrentstatus & TorrentStatusPaused console; // Refresh the torrentmyAddedTorrent; // Pause the torrentmyAddedTorrent; // Start the torrentmyAddedTorrentstart; // Delete the torrent with its datamyAddedTorrent;
Downloaded Files
It's a peace of cake to manage downloading or downloaded files with the API! You can check on their progress and manage their priority.
// Fetch the filesmyTorrent.files.then; // Set a file's download priorityfile.setPriorityPriority.Skip.then; // Set the priority of multiple files at oncemyTorrent.setFilePrioritymyTorrentFiles, Priority.High.then;
Documentation
Full Documention can be found here