From febd253213cce3d9d5d8363cd98f4f7bcc0fc080 Mon Sep 17 00:00:00 2001 From: dgw Date: Thu, 10 Feb 2022 00:14:26 -0600 Subject: [PATCH] Backport pull request #2247 xkcd: account for Bing search returning mobile URLs --- sopel/modules/xkcd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sopel/modules/xkcd.py b/sopel/modules/xkcd.py index dc369010de..c628d2f7a2 100644 --- a/sopel/modules/xkcd.py +++ b/sopel/modules/xkcd.py @@ -49,7 +49,7 @@ def web_search(query): url = bing_search(query + sites_query) if not url: return None - match = re.match(r'(?:https?://)?xkcd.com/(\d+)/?', url) + match = re.match(r'(?:https?://)?(?:m\.)?xkcd\.com/(\d+)/?', url) if match: return match.group(1)