diff --git a/new_torrents_fetcher/src/main.rs b/new_torrents_fetcher/src/main.rs index 5ef42c9..f2488b8 100644 --- a/new_torrents_fetcher/src/main.rs +++ b/new_torrents_fetcher/src/main.rs @@ -2,6 +2,7 @@ extern crate clap; extern crate csv; extern crate reqwest; extern crate select; + use clap::{App, Arg}; use select::document::Document; use select::predicate::{Attr, Class, Name, Predicate}; @@ -179,6 +180,7 @@ fn skytorrents(save_dir: &Path) { for page in pages.iter() { println!("Fetching page {}", page); + let html = match fetch_html(page) { Ok(t) => t, _err => continue, @@ -289,19 +291,19 @@ fn fetch_torrent(hash: String, save_dir: &Path) { if !Path::new(&full_path).exists() { unsafe { Command::new("curl") - .args(&[ - &url, - "-H", - USER_AGENT, - "-H", - COOKIE, - "--compressed", - "-o", - &full_path, - "-s", - ]) - .output() - .expect("curl command failed"); + .args(&[ + &url, + "-H", + USER_AGENT, + "-H", + COOKIE, + "--compressed", + "-o", + &full_path, + "-s", + ]) + .output() + .expect("curl command failed"); check_cloud_flare(Path::new(&full_path)); thread::sleep(time::Duration::from_millis(2742)); println!("{} saved.", &full_path);