This Rust program dynamically finds the angel
program in the system's $PATH
, runs it with a specified keyword, extracts magnet links from the output, and opens them in qBittorrent.
- Dynamically finds the
angel
program using the$PATH
environment variable. - Extracts magnet links from the
angel
program output using regular expressions. - Opens magnet links in qBittorrent.
- Rust (for compiling and running the program)
- The
angel
program should be installed and accessible in your$PATH
. - qBittorrent (for handling magnet links)
-
Clone the repository:
git clone https://github.com/daite/magnet_extractor.git cd magnet_extractor
-
Add dependencies in
Cargo.toml
:[dependencies] which = "4.2" regex = "1"
-
Build the project:
cargo build --release
To run the program, provide a keyword to search via the angel
program:
./target/release/magnet_extractor <keyword>
For example:
./target/release/magnet_extractor "some keyword"
- The program checks if the
angel
program is available in the system's$PATH
using thewhich
crate. - If found, it runs the
angel
program with the specified keyword and extracts magnet links from the output using a regular expression. - The magnet links are automatically opened in qBittorrent.
Found 'angel' at: /usr/local/bin/angel
Opening magnet:?xt=urn:btih:6cf65299b5b48b077370f5675ce34b666e82cc3f in qBittorrent...