Expand description
§Usage:
To search for a torrent, simply use the search_l337x function
use torrent_search::{search_l337x, TorrentSearchResult, TorrentSearchError};
#[tokio::main]
async fn main() {
let debian_search_results = search_l337x("Debian ISO".to_string()).await.unwrap();
for result in debian_search_results {
println!("Name of torrent: {}\nMagnet: {}\nSeeders: {}\nLeeches: {}", result.name, result.magnet.unwrap(), result.seeders.unwrap(), result.leeches.unwrap());
}
}
This will return Result<Vec<TorrentSearchResult>, TorrentSearchError>, which when unwrapped
gives a Vector of TorrentSearchResults
Structs§
- Torrent
Search Result - Some of the basic information of the torrent
Enums§
- Torrent
Search Error - If you get this, that means something went wrong while either scraping or getting the torrent page.
Functions§
- search_
l337x - The function takes a search string, then uses web scraping using regex to find the various parts of the search. The search must be longer than 3 characters