diff --git a/src/gallery_downloader.rs b/src/gallery_downloader.rs index 441c6c8..33b8a37 100644 --- a/src/gallery_downloader.rs +++ b/src/gallery_downloader.rs @@ -124,7 +124,7 @@ impl GalleryDownloader { warn!("Gallery file download error: url={}, err={}", url, err); // Try download without proxy at third time - if use_proxy && retry == 1 && err.downcast_ref().map(reqwest::Error::is_connect).unwrap_or(false) { + if retry == 1 && use_proxy { warn!("Retry download without proxy..."); reqwest = util::create_http_client(Duration::from_secs(300), None); } diff --git a/src/route/cache.rs b/src/route/cache.rs index 4540103..e9a44e3 100644 --- a/src/route/cache.rs +++ b/src/route/cache.rs @@ -147,7 +147,7 @@ async fn hath( error!("Cache download fail: url={}, err={}", source, err); // Disable proxy on third retry - if retry == 1 && data.has_proxy && err.is_connect() { + if retry == 1 && data.has_proxy { reqwest = create_http_client(Duration::from_secs(30), None); } };