diff --git a/src/services.ts b/src/services.ts index 9bc5e49a..63f7bb8b 100644 --- a/src/services.ts +++ b/src/services.ts @@ -140,7 +140,7 @@ const SERVICES: ServicesConfigType = { id: (groups: string[]) => groups?.[0]?.split("/")[0], }, twitter: { - regex: /^https?:\/\/(www\.)?(?:twitter\.com|x\.com)\/.+\/status\/(\d+)/, + regex: /^https?:\/\/(www\.)?(?:twitter\.com|x\.com)\/.+\/status\/(\d+)(?:\/[^?]*)?(?:\?.*)?$/, embedUrl: 'https://platform.twitter.com/embed/Tweet.html?id=<%= remote_id %>', html: '', height: 300, diff --git a/test/services.ts b/test/services.ts index 6072671a..b6d2b4ae 100644 --- a/test/services.ts +++ b/test/services.ts @@ -264,6 +264,18 @@ describe('Services Regexps', () => { source: 'https://x.com/codex_team/status/1202295536826630145', embed: 'https://platform.twitter.com/embed/Tweet.html?id=1202295536826630145' }, + { + source: 'https://x.com/MrShibolet/status/1990842843481387410', + embed: 'https://platform.twitter.com/embed/Tweet.html?id=1990842843481387410' + }, + { + source: 'https://x.com/MrShibolet/status/1990842843481387410?s=20', + embed: 'https://platform.twitter.com/embed/Tweet.html?id=1990842843481387410' + }, + { + source: 'https://x.com/cb_doge/status/1817235892916146413/photo/1', + embed: 'https://platform.twitter.com/embed/Tweet.html?id=1817235892916146413' + }, ]; urls.forEach(url => {