Skip to content

daite/magneta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

build

Magneta

A fast, extensible CLI tool for searching torrents across multiple torrent sites with failover support and pluggable site parsers.

Background

Korean torrent sites are often filled with aggressive advertisements, popups, and scripts.
Searching for a single show can take many minutes and multiple clicks.

Features

  • πŸ” Search torrents by keyword
  • 🌐 Supports multiple torrent sites with failover fallback (Multiplexer Nβ†’1)
  • 🧩 Pluggable site parsers (e.g., TorrentTop, TorrentSome, TorrentRJ)
  • πŸ› οΈ Built with pure Rust, 100% Rust project
  • πŸ§ͺ Full offline unit testing (HTML samples, GitHub Actions CI)
  • πŸ“¦ Pretty table CLI output
  • 🩺 doctor subcommand to check site health
  • πŸͺ΅ Integrated logging (RUST_LOG=warn for errors)

Requirements

  • Rust (stable)
  • Cargo

Install Rust:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Build and Run

Example

make run search "μ „κ³΅μ˜"
⠏ βœ… Search completed! (click to expand)
+-----------------------------------------------------+--------------------------------------------------------------+
| Title                                               | Magnet                                                       |
+-----------------------------------------------------+--------------------------------------------------------------+
| μ–Έμ  κ°€λŠ” 슬기둜울 μ „κ³΅μ˜μƒν™œ.E08.250504.1080p-F1RST        | magnet:?xt=urn:btih:a2ecde5ebdd06a486541559ab024c5b734af10aa |
| μ–Έμ  κ°€λŠ” 슬기둜울 μ „κ³΅μ˜μƒν™œ.E07.250503.1080p-F1RST        | magnet:?xt=urn:btih:3046d9446f0abf746bdb1b19ebc368873b84a8e5 |
| μ–Έμ  κ°€λŠ” 슬기둜울 μ „κ³΅μ˜μƒν™œ.E06.250427.1080p-F1RST        | magnet:?xt=urn:btih:cff190e74667137cd4c0aa84c4f3df70b1fd7183 |
| μ–Έμ  κ°€λŠ” 슬기둜울 μ „κ³΅μ˜μƒν™œ.E05.250426.1080p-F1RST        | magnet:?xt=urn:btih:03ad63f4cd3dcdb7cc62733f0ba0bdd754202ec0 |
| μ–Έμ  κ°€λŠ” 슬기둜울 μ „κ³΅μ˜μƒν™œ.E04.250420.1080p-F1RST        | magnet:?xt=urn:btih:76eed1fede165614410ca66483e9ba3cec1b1653 |
| μ–Έμ  κ°€λŠ” 슬기둜울 μ „κ³΅μ˜μƒν™œ.E03.250419.1080p-F1RST        | magnet:?xt=urn:btih:c15eccdd1feb967c11863c164ea949cb639ad560 |
| μ–Έμ  κ°€λŠ” 슬기둜울 μ „κ³΅μ˜μƒν™œ.E02.250413.1080p-F1RST        | magnet:?xt=urn:btih:90792e2be9aee17ca522aae8770503a7d5260415 |
| μ–Έμ  κ°€λŠ” 슬기둜울 μ „κ³΅μ˜μƒν™œ.E01.250412.1080p-F1RST        | magnet:?xt=urn:btih:ee8ea649250f1abdda5ba3765757ca0f544bf058 |
+-----------------------------------------------------+--------------------------------------------------------------+
# Build the project
make build

# Run the project
make run search "keyword"

# Example
make run search "μ „κ³΅μ˜"

# Run diagnostics
make run doctor

# Run all tests
make test

Or using Cargo directly:

cargo run -- search "keyword"
cargo run -- doctor
cargo test

Project Structure

magneta/
.
β”œβ”€β”€ Cargo.lock
β”œβ”€β”€ Cargo.toml
β”œβ”€β”€ LICENSE
β”œβ”€β”€ Makefile
β”œβ”€β”€ README.md
β”œβ”€β”€ config.toml
β”œβ”€β”€ src
β”‚Β Β  β”œβ”€β”€ lib.rs
β”‚Β Β  β”œβ”€β”€ main.rs
β”‚Β Β  β”œβ”€β”€ site_registry.rs
β”‚Β Β  └── sites
β”‚Β Β      β”œβ”€β”€ mod.rs
β”‚Β Β      β”œβ”€β”€ torrenttop.rs
β”‚Β Β      β”œβ”€β”€ torrentsome.rs
β”‚Β Β      └── torrentrj.rs
└── tests
    β”œβ”€β”€ data
    β”‚Β Β  β”œβ”€β”€ torrenttop
    β”‚Β Β  └── torrentsome
    └── torrenttop_test.rs

Site Diagnostics

Use the doctor subcommand to check which torrent sites are currently reachable:

cargo run -- doctor

Example Output:

πŸ” Running diagnostics for torrent sites:
+-------------+----------------------------+----------------------+
| Site Name   | Site URL                   | Status               |
+-------------+----------------------------+----------------------+
| torrenttop  | https://torrenttop151.com  | ❌ connection failed |
| torrentrj   | https://torrentrj199.com   | βœ… 200 OK            |
| torrentsome | https://torrentsome192.com | ❌ connection failed |
+-------------+----------------------------+----------------------+

Testing

This project uses offline HTML samples for testing:

make test

No external internet access required.
Tests are fully reproducible even in CI environments.

Contributing

Pull requests are welcome!
Please follow Rust's code style and run:

make fmt
make lint

before submitting a PR.

License

This project is licensed under the MIT License.

About

Experiment for torrent search in Rust πŸ’•

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages