The repository is a branch (fork) of the original version of ❤️ WebTorrent Desktop, which add a remote control mechanism via the REST API on base Express Framework.
The source code (as well as telemetry) has not changed, the description provides instructions for merging and assembling with the original version.
To start the API server, click the Enable
checkbox (no application restart required).
Defualt port 9099
. When you change the port, you must disable and enable the API for the changes to take effect.
The current version implements 15 endpoints:
- Method:
GET
/stats
- Get a list of current client settings, torrent statistics and system information/torrents
- Get a list of added torrents, as well as download status and details/torrent/<hash>
- Get the information of the selected torrent by its info hash/torrentFiles/<hash>
- Get a list of files of the selected torrent
- Method:
POST
/pauseAllTorrents
- Pause all torrents/resumeAllTorrents
- Resume downloading all torrents/prioritizeTorrent
- Pause all torrents exception the selected one- Data:
hash
:<string>
- Data:
/resumePausedTorrents
- Resume all torrents from pause/toggleTorrent
- Set download status for selected torrent (paused or download)- Data:
hash
:<string>
- Data:
/toggleTorrentFile
- Set the download status of the selected file for the specified torrent (skip or download)- Data:
hash
:<string>
- Data:
index
:<int>
- Data:
/toggleAllTorrentFile
- Set download status for all files from a torrent- Data:
hash
:<string>
- Data:
/addTorrent
- Add new torrent for download frominfo hash
orurl
- Data:
source
:<string>
- Data:
/deleteTorrent
- Delete the selected torrent from the client (iftrue
, remove downloaded data from the system)- Data:
hash
:<string>
- Data:
deleteData
:<boolean>
- Data:
/createTorrent
- Create a torrent from a file or directory with files- Data:
path
:<string>
- Data:
/saveTorrentFile
- Download.torrent
file- Data:
hash
:<string>
- Data:
To get a list of files for further creation of a torrent from a remote Windwos system, you can use the 🔎 Everything api.
The example uses two queries to retrieve torrent list information and files of the selected torrent.
git clone https://github.com/webtorrent/webtorrent-desktop.git
git clone https://github.com/Lifailon/webtorrent-desktop-api.git
cp "webtorrent-desktop-api/src/renderer/main.js" "webtorrent-desktop/src/renderer/main.js"
cp "webtorrent-desktop-api/src/renderer/pages/preferences-page.js" "webtorrent-desktop/src/renderer/pages/preferences-page.js"
cd webtorrent-desktop
npm install
npm install express
git diff
npm start
npm run watch
npm test
npm run test-integration
npm run package