diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client.rs | 12 | ||||
-rw-r--r-- | src/main.rs | 2 |
2 files changed, 9 insertions, 5 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> { diff --git a/src/main.rs b/src/main.rs index 6e3be3c..43c1d72 100644 --- a/src/main.rs +++ b/src/main.rs @@ -79,7 +79,7 @@ async fn main() -> Result<()> { .await?; } Action::CacheMetadata { level } => { - let c = GeClient::new(16, cache).await?; + let c = GeClient::new(args.par_limit, cache).await?; let entry = c.planetoid_metdata().await?; let epoch = entry.root_node_metadata.unwrap().bulk_metadata_epoch(); let count = cache_metadata(Arc::new(c), "".to_string(), epoch, level).await?; |