From 3f0eac88e3bdccc446b2b597026639df12ed85d7 Mon Sep 17 00:00:00 2001 From: Wenda Zhang Date: Mon, 15 Apr 2024 22:17:43 +0800 Subject: [PATCH] use new user agent --- src/dict.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dict.rs b/src/dict.rs index 027fa29..3bddb43 100644 --- a/src/dict.rs +++ b/src/dict.rs @@ -4,7 +4,6 @@ use itertools::{ EitherOrBoth::{Both, Left, Right}, Itertools, }; -use reqwest; use rodio::{Decoder, OutputStream, Sink}; use scraper::{Html, Selector}; use std::fmt; @@ -24,7 +23,7 @@ fn is_enword(word: &str) -> bool { /// Get web dictionary html by word. async fn get_html(word: &str) -> Result { - static APP_USER_AGENT: &str = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"; + static APP_USER_AGENT: &str = "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0"; let client = reqwest::Client::builder() .user_agent(APP_USER_AGENT) .build()