dev: update packages and disable paperteer features

This commit is contained in:
Kenneth Gitere 2022-02-01 20:16:29 +03:00
parent e777426c1b
commit abaa7d37df
4 changed files with 380 additions and 371 deletions

701
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -13,26 +13,26 @@ readme = "README.md"
[dependencies]
# atty = "0.2.14"
async-std = "1.9.0"
async-std = "1.10.0"
base64 = "0.13.0"
chrono = "0.4.19"
clap = { version = "2.33.3", features = ["yaml"] }
clap = { version = "2.34.0", features = ["yaml"] }
colored = "2.0.0"
comfy-table = "3.0.0"
derive_builder = "0.10.2"
directories = "3.0.2"
epub-builder = "0.4.8"
flexi_logger = "0.18.0"
futures = "0.3.15"
epub-builder = "0.4.10"
flexi_logger = "0.22.2"
futures = "0.3.19"
html5ever = "0.25.1"
indicatif = "0.16.2"
itertools = "0.10.1"
itertools = "0.10.3"
kuchiki = "0.8.1"
lazy_static = "1.4.0"
log = "0.4.14"
md5 = "0.7.0"
regex = "1.5.4"
serde = "1.0.130"
surf = "2.2.0"
thiserror = "1.0.25"
serde = "1.0.136"
surf = "2.3.2"
thiserror = "1.0.30"
url = "2.2.2"

View file

@ -1 +1 @@
1.52.1
1.57.0

View file

@ -24,7 +24,7 @@ pub fn download(
let mut responses = stream::from_iter(urls_iter).buffered(app_config.max_conn);
let mut articles = Vec::new();
// Collect all urls that couldn't extract here
let mut retry_with_paperteer: Vec<String> = Vec::new();
// let mut retry_with_paperteer: Vec<String> = Vec::new();
while let Some(fetch_result) = responses.next().await {
match fetch_result {
Ok((url, html)) => {
@ -40,7 +40,7 @@ pub fn download(
Ok(_) => bar.inc(1),
// All errors are pushed into here since they're readability issues.
Err(_) => retry_with_paperteer.push(url),
Err(e) => errors.push(e),
}
// Outside the stream, make a new one to retry with paperteer
@ -48,18 +48,18 @@ pub fn download(
Err(e) => errors.push(e),
}
}
if !retry_with_paperteer.is_empty() {
fetch_html_from_paperteer(
retry_with_paperteer,
app_config,
bar,
partial_downloads,
errors,
&mut articles,
)
.await
.unwrap();
}
// if !retry_with_paperteer.is_empty() {
// fetch_html_from_paperteer(
// retry_with_paperteer,
// app_config,
// bar,
// partial_downloads,
// errors,
// &mut articles,
// )
// .await
// .unwrap();
// }
articles
})
}
@ -130,7 +130,7 @@ struct PaperteerResponse {
// TODO: Change signature to simply take a vec of urls and return a vec of urls with either html or an error
// This also means that extracting and downloading imgs should be handled externally
async fn fetch_html_from_paperteer(
async fn _fetch_html_from_paperteer(
urls: Vec<String>,
_app_config: &AppConfig,
bar: &ProgressBar,