From 02133b79ddda3cafaeb5a392290409543ddf8b72 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Mon, 27 Oct 2025 10:08:16 +0200 Subject: [PATCH] fix(instagram): regex capture group --- src/handlers/instagram.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/handlers/instagram.rs b/src/handlers/instagram.rs index 04e863d..ffb6ab4 100644 --- a/src/handlers/instagram.rs +++ b/src/handlers/instagram.rs @@ -38,12 +38,12 @@ impl SocialHandler for InstagramHandler { fn try_extract(&self, text: &str) -> Option { shortcode_regex() .captures(text) - .and_then(|c| c.get(1).map(|m| m.as_str().to_owned())) + .and_then(|c| c.get(0).map(|m| m.as_str().to_owned())) } - async fn handle(&self, bot: &Bot, chat_id: ChatId, shortcode: String) -> Result<()> { - info!(handler = %self.name(), shortcode = %shortcode, "handling instagram code"); - let dr = download_instaloader(&shortcode).await?; + async fn handle(&self, bot: &Bot, chat_id: ChatId, url: String) -> Result<()> { + info!(handler = %self.name(), url = %url, "handling instagram code"); + let dr = download_instaloader(&url).await?; process_download_result(bot, chat_id, dr).await }