4 releases (stable)
Uses new Rust 2024
| new 1.1.1 | Dec 16, 2025 |
|---|---|
| 1.0.0 | Dec 16, 2025 |
| 0.1.0 | Dec 15, 2025 |
#557 in Network programming
18KB
178 lines
━━━━ ❖ ━━━━
❖ Surgery
Surgery is a simple CLI to interact with Real Debrid. The aim is to allow users to fuzzy match and download torrents from their Real Debrid account.
❖ Requirements
- Ensure curl is installed
- Set the following environment variables:
# You likely do not need to change this
# also note the lack of trailing slash
export RD_BASE_URL="https://api.real-debrid.com/rest/1.0"
# Available at: https://real-debrid.com/apitoken
export RD_API_KEY=""
❖ Installation
Shell
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/dotzenith/surgery/releases/latest/download/surgery-installer.sh | sh
Brew
brew install dotzenith/tap/surgery
Powershell
powershell -ExecutionPolicy ByPass -c "irm https://github.com/dotzenith/surgery/releases/latest/download/surgery-installer.ps1 | iex"
Cargo
cargo install surgery
Binaries
Pre-Compiled binaries for linux, mac, and windows are available in Releases
Source
- First, install rust
git clone https://github.com/dotzenith/surgery.git
cd surgery
cargo build --release
./target/release/srg
❖ Usage
A simple CLI for Real Debrid
Usage: srg [OPTIONS] <NAME>
Arguments:
<NAME> torrent name for fuzzy matching (required)
Options:
-b, --best Download the best matching torrent for the provided name
-a, --all Download all files for the selected torrent
-h, --help Print help
-V, --version Print version
Normal Usage
srg "debian" # torrent names are fuzzy matched
- This will prompt the user to select a specific torrent if there is more than one match
- This will also prompt the user to select a range if the torrent has multiple files
Pick the best matched torrent
srg "ubuntu" --best
- This will pick the torrent that best matches the search string
- This will still prompt the user to select a range if the torrent has multiple files
Download all files for a given torrent
srg "ubuntu" --all
- This will prompt the user to select a specific torrent if there is more than one match
- This will download all files for the selected torrent
srg "ubuntu" --best --all
- This will pick the best matched torrent, and download all files
❖ What's New?
1.1.1 - Improvements to the UI
Dependencies
~15–28MB
~458K SLoC