From 76ac4ea57a6e2a33de95a7f1aa5f4db270e68255 Mon Sep 17 00:00:00 2001 From: James Price Date: Mon, 15 Jun 2026 21:41:57 -0400 Subject: [PATCH] Match Instagram /reels/ (plural), /tv/, and /share/ link forms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The share sheet in the Instagram app now emits instagram.com/reels/ (plural), which INSTAGRAM_URL_PATTERN didn't match — only /reel/ and /p/. A non-matching URL is silently dropped (regex never matches -> no download, no error reply), so reels links appeared to do nothing. Broaden the pattern to (?:share/)?(?:reels?|p|tv) to also cover IGTV (/tv/) and the /share/ prefix. Verified against should-match / should-not-match URL sets; other platform patterns unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- bot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index a428b3e..9d517a2 100644 --- a/bot.py +++ b/bot.py @@ -23,7 +23,11 @@ from signalbot.message import MessageType # (?:/[^/\s]+)* allows multi-segment forms like x.com/i/web/status/ while # still refusing whitespace (so two links can't merge). TWITTER_URL_PATTERN = r"https?://(?:www\.)?(?:twitter\.com|x\.com|fxtwitter\.com|vxtwitter\.com|fixupx\.com)/[^/\s]+(?:/[^/\s]+)*/status/\d+" -INSTAGRAM_URL_PATTERN = r"https?://(?:www\.)?instagram\.com/(?:reel|p)/[\w-]+" +# Instagram shares come in several path shapes: /p/ (posts), /reel/ (singular), +# /reels/ (plural — the form the app's share sheet now emits), /tv/ (IGTV), and a +# /share/ prefix on any of them. Match all of them or the link is silently dropped +# (regex never matches -> no download, no error reply). +INSTAGRAM_URL_PATTERN = r"https?://(?:www\.)?instagram\.com/(?:share/)?(?:reels?|p|tv)/[\w-]+" YOUTUBE_URL_PATTERN = r"https?://(?:www\.)?(?:youtube\.com/(?:watch\?v=|shorts/)|youtu\.be/)[\w-]+" TIKTOK_URL_PATTERN = r"https?://(?:(?:www|m)\.tiktok\.com/(?:@[\w.-]+/video/\d+|t/\w+|v/\d+)|(?:vm|vt)\.tiktok\.com/\w+)" VIDEO_URL_PATTERN = rf"(?:{TWITTER_URL_PATTERN}|{INSTAGRAM_URL_PATTERN}|{YOUTUBE_URL_PATTERN}|{TIKTOK_URL_PATTERN})"