From fd0a1079c4b785877535516dd0211312a3781c22 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 11 Oct 2018 21:13:04 -0700 Subject: [PATCH] Adding a fetch from skytorrents --- new_torrents_fetcher/src/main.rs | 15 ++++++++++++++- scripts/update.sh | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/new_torrents_fetcher/src/main.rs b/new_torrents_fetcher/src/main.rs index cfb9777..b6be744 100644 --- a/new_torrents_fetcher/src/main.rs +++ b/new_torrents_fetcher/src/main.rs @@ -20,12 +20,25 @@ fn main() { } fn skytorrents() { + + let base_url = "https://www.skytorrents.lol"; + let mut pages: Vec = Vec::new(); + for i in 1..20 { - let page = format!("{}{}", "https://www.skytorrents.lol/top100?page=", i); + let page = format!("{}/top100?page={}", base_url, i); pages.push(page); } + let types = ["video", "audio", "games", "software", "doc", "ebook", "yify", "epub"]; + for c_type in types.iter() { + for i in 1..20 { + let page = format!("{}/top100?type={}&page={}", base_url, c_type, i); + pages.push(page); + } + + } + for page in pages.iter() { println!("Fetching page {}", page); let html = fetch_html(page); diff --git a/scripts/update.sh b/scripts/update.sh index d1b4851..a8d5161 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -2,6 +2,6 @@ pushd ../new_torrents_fetcher cargo run cat tmp_adds.csv >> ../torrents.csv -rm tmp_adds.csv +#rm tmp_adds.csv popd . prune.sh