Crate torrent_search[−][src]
Usage:
To search for a torrent, simply use the search_l337x function
use torrent_search::{search_l337x, TorrentSearchResult, TorrentSearchError}; let debian_search_results = search_l337x("Debian ISO".to_string()).unwrap(); for result in debian_search_results { println!("Name of torrent: {}\nMagnet: {}", result.name, result.magnet.unwrap()); }
This will return Result<Vec<TorrentSearchResult>, TorrentSearchError>
, which when unwrapped
gives a Vector of TorrentSearchResults (shocking I know).
You can view more information about the data types of the structs here
Structs
TorrentSearchResult | Some of the basic information of the torrent |
Enums
TorrentSearchError | 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 |