Fixed Facebook media provider
authorSascha Greuel <github@1-2.dev>
Thu, 4 Aug 2022 04:58:21 +0000 (06:58 +0200)
committerSascha Greuel <github@1-2.dev>
Thu, 4 Aug 2022 05:13:39 +0000 (07:13 +0200)
Usernames CAN contain periods, but they're currently not supported. There's also no need for a trailing slash.

Example: https://www.facebook.com/RaiPlay.it/videos/1059491774481091

com.woltlab.wcf/mediaProvider.xml

index 2c4b9993afea17618392e9f15c7d184f73ea2770..0b065dae0bd05d8f925c59abf75a927133945b7d 100644 (file)
@@ -72,8 +72,8 @@ https?://www.twitch.tv/[a-zA-Z0-9]+/v/(?<VIDEO>[0-9]+)]]></regex>
                </provider>
                <provider name="facebook-video">
                        <title>Facebook Video</title>
-                       <regex><![CDATA[(?<HREF>https?://(www\.)?facebook\.com/watch/\?v=(?<ID>[0-9]+))
-(?<HREF>https?://(www\.)?facebook\.com/[a-zA-Z0-9_-]+/videos/(?<ID>[0-9]+)/)
+                       <regex><![CDATA[(?<HREF>https?://(www\.)?facebook\.com/watch/?\?v=(?<ID>[0-9]+))
+(?<HREF>https?://(www\.)?facebook\.com/[a-zA-Z0-9_\.-]+/videos/(?<ID>[0-9]+))
 (?<HREF>https?://fb\.watch/(?<ID>[a-zA-Z0-9_-]+)/)]]></regex>
                        <html><![CDATA[<div class="fb-video" data-href="{$HREF}" data-allowfullscreen="true">{$HREF}</div>
 <script>require(['WoltLabSuite/Core/Wrapper/FacebookSdk'],function(FB){FB.XFBML.parse()})</script>]]></html>