use webp format for twitter links since those are cheaper

This commit is contained in:
dusk 2023-07-25 13:43:09 +03:00
parent 09da5c7cd4
commit afe5d44223
Signed by: dusk
SSH Key Fingerprint: SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw

View File

@ -134,9 +134,9 @@ async fn fetch_twitter_image_link(http: &reqwest::Client, url: &Uri) -> AppResul
.headers()
.get(http::header::LOCATION)
.unwrap()
.to_str()?
.to_owned();
Ok(link)
.to_str()?;
// use webp format for direct twitter links since webp is cheaper
Ok(format!("{link}?format=webp"))
}
fn get_conf(name: &str) -> String {