Merge branch 'master' of https://gitlab.com/dessalines/torrents.csv
This commit is contained in:
commit
f5b1282a47
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue