aboutsummaryrefslogtreecommitdiff
path: root/src/client.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-04-08 15:55:17 +0200
committermetamuffin <metamuffin@disroot.org>2025-04-08 15:55:17 +0200
commit36b4c0b4fba57125791150c9df6740997d25d53c (patch)
treeeb82c8e035e753ec5d739092d7a2020596e947d5 /src/client.rs
parent7caef8ad89c09c172af84d592a6547882b7d62d0 (diff)
downloadweareearth-36b4c0b4fba57125791150c9df6740997d25d53c.tar
weareearth-36b4c0b4fba57125791150c9df6740997d25d53c.tar.bz2
weareearth-36b4c0b4fba57125791150c9df6740997d25d53c.tar.zst
h2 only and par limit from argsHEADmaster
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/client.rs b/src/client.rs
index 9c1b29a..8da86ce 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -27,10 +27,14 @@ impl GeClient {
download_counter: AtomicUsize::new(0),
cache_counter: AtomicUsize::new(0),
par_limit: Semaphore::new(par_limit),cache,
- client: Client::builder().default_headers(HeaderMap::from_iter([
- (HeaderName::from_static("user-agent"), HeaderValue::from_static("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36")),
- (HeaderName::from_static("referer"), HeaderValue::from_static("https://earth.google.com/"))
- ])).build().unwrap()
+ client: Client::builder()
+ .default_headers(HeaderMap::from_iter([
+ (HeaderName::from_static("user-agent"), HeaderValue::from_static("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36")),
+ (HeaderName::from_static("referer"), HeaderValue::from_static("https://earth.google.com/"))
+ ]))
+ .http2_prior_knowledge()
+ .build()
+ .unwrap()
})
}
pub async fn download(&self, path: &str) -> Result<Bytes> {