From d331edec94eaeed87ff949b4558d99d9a0d119ea Mon Sep 17 00:00:00 2001 From: Romain Etchegoyhen Date: Wed, 24 Jul 2024 12:03:10 +0200 Subject: [PATCH] Fix OEmbed for X.com (Twitter) --- src/ExtractorFactory.php | 1 + src/resources/oembed.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/ExtractorFactory.php b/src/ExtractorFactory.php index 846e1b39..55624f6c 100644 --- a/src/ExtractorFactory.php +++ b/src/ExtractorFactory.php @@ -30,6 +30,7 @@ class ExtractorFactory 'twitch.tv' => Adapters\Twitch\Extractor::class, 'bandcamp.com' => Adapters\Bandcamp\Extractor::class, 'twitter.com' => Adapters\Twitter\Extractor::class, + 'x.com' => Adapters\Twitter\Extractor::class, ]; private array $customDetectors = []; private array $settings; diff --git a/src/resources/oembed.php b/src/resources/oembed.php index 8ddd6f48..ead747af 100644 --- a/src/resources/oembed.php +++ b/src/resources/oembed.php @@ -1098,6 +1098,9 @@ '|^https?://twitter\\.com/.*$|i', '|^https?://twitter\\.com/.*/status/.*$|i', '|^https?://.*\\.twitter\\.com/.*/status/.*$|i', + '|^https?://x\\.com/.*$|i', + '|^https?://x\\.com/.*/status/.*$|i', + '|^https?://.*\\.x\\.com/.*/status/.*$|i', ], 'https://play.typecast.ai/oembed' => [ '|^https?://play\\.typecast\\.ai/s/.*$|i',