From afe5d44223a5f686a7bd452a174beb87284105a7 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Tue, 25 Jul 2023 13:43:09 +0300 Subject: [PATCH] use webp format for twitter links since those are cheaper --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 03e2434..4667caa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 {