From 36b4c0b4fba57125791150c9df6740997d25d53c Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 8 Apr 2025 15:55:17 +0200 Subject: h2 only and par limit from args --- src/client.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/client.rs') 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 { -- cgit v1.2.3-70-g09d2