Skip to content

Commit d3f0fa8

Browse files
committed
domains: review FB URL patterns
1 parent 20f9635 commit d3f0fa8

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

lib/plugins/system/oembed/providers.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22
{
33
"name": "Facebook Post no query string",
44
"templates": [
5-
"(?:www|m|business)\\.(facebook\\.com/[a-zA-Z0-9\\.\\-]+/(?:posts|activity)/\\d{10,})",
6-
"(?:www|m|business)\\.(facebook\\.com/[a-zA-Z0-9\\.\\-]+/(?:posts|activity)/pfbid([a-zA-Z0-9\\.\\-]+))",
5+
"(?:www|m|business)\\.(facebook\\.com/[^/]+/(?:posts|activity)/\\d{10,})",
6+
"(?:www|m|business)\\.(facebook\\.com/posts/[^/]+/\\d{10,})",
7+
"(?:www|m|business)\\.(facebook\\.com/[^/]+/(?:posts|activity)/pfbid([a-zA-Z0-9\\.\\-]+))",
78
"(?:www|m|business)\\.(facebook\\.com/notes/[^/]+/[^/]+/\\d{10,})",
89
"(?:www|m|business)\\.(facebook\\.com/\\d+_\\d+)"
910
],
1011
"url": "https://www.{1}",
11-
"endpoint": "https://graph.facebook.com/v18.0/oembed_post"
12+
"endpoint": "https://graph.facebook.com/v24.0/oembed_post"
1213
},
1314
{
1415
"name": "Facebook Video no query string",
1516
"templates": [
16-
"(?:www|business)\\.(facebook\\.com/[a-zA-Z0-9.]+/videos/\\d+)",
17+
"(?:www|business)\\.(facebook\\.com/[^/]+/videos/\\d+)",
1718
"(?:www|m|business)\\.(facebook\\.com/watch/?\\?v=\\d+)"
1819
],
1920
"url": "https://www.{1}",
20-
"endpoint": "https://graph.facebook.com/v18.0/oembed_video"
21+
"endpoint": "https://graph.facebook.com/v24.0/oembed_video"
2122
},
2223
{
2324
"name": "Facebook Video",
@@ -31,50 +32,50 @@
3132
"(?:www|m|business)\\.facebook\\.com/watch/?\\?(?:.+&)?v=\\d+",
3233
"(?:www|m|business)\\.facebook\\.com/reel/\\d+"
3334
],
34-
"endpoint": "https://graph.facebook.com/v18.0/oembed_video"
35+
"endpoint": "https://graph.facebook.com/v24.0/oembed_video"
3536
},
3637
{
3738
"name": "Facebook Post",
3839
"templates": [
3940
"(?:www|m|business)\\.facebook\\.com/(permalink|story)\\.php\\?[^/]+(\\d{10,})",
4041
"(?:www|m|business)\\.facebook\\.com/photo\\.php\\?[^/]+(\\d{10,})",
4142
"(?:www|m|business)\\.facebook\\.com/photo/?\\?",
42-
"(?:www|m|business)\\.facebook\\.com/([a-zA-Z0-9\\.\\-]+)/(?:photos/)?[^\\/]+/(\\d{10,})",
43+
"(?:www|m|business)\\.facebook\\.com/[^/]+/(?:photos/)?[^\\/]+/(\\d{10,})",
4344
"(?:www|m|business)\\.facebook\\.com/media/set/\\?set=[^/]+(\\d{10,})"
4445
],
45-
"endpoint": "https://graph.facebook.com/v18.0/oembed_post"
46+
"endpoint": "https://graph.facebook.com/v24.0/oembed_post"
4647
},
4748
{
4849
"name": "Facebook Page",
4950
"templates": [
5051
"(?:www|m)\\.facebook\\.com/(?:pg|pages)/",
5152
"(?:www|m)\\.facebook\\.com/[^/]+/?(?:about|photos|videos|events|timeline|photos_stream)?/?(?:\\?[^/\\?]+)?$"
5253
],
53-
"endpoint": "https://graph.facebook.com/v18.0/oembed_page"
54+
"endpoint": "https://graph.facebook.com/v24.0/oembed_page"
5455
},
5556
{
5657
"name": "Instagram",
5758
"templates": [
5859
"(?:www\\.)?(instagram\\.com/(?:p|tv|reel)/([a-zA-Z0-9_-]+))",
5960
"(instagr\\.am/p/([a-zA-Z0-9_-]+))"
6061
],
61-
"endpoint": "https://graph.facebook.com/v18.0/instagram_oembed?format={format}&url=https://www.{1}/"
62+
"endpoint": "https://graph.facebook.com/v24.0/instagram_oembed?format={format}&url=https://www.{1}/"
6263
},
6364
{
6465
"name": "Instagram user page",
6566
"templates": [
6667
"(?:www\\.)?(instagram\\.com/)[a-zA-Z0-9_\\-\\.]+/((?:p|tv|reel)/[a-zA-Z0-9_-]+)",
6768
"(instagr\\.am/)[a-zA-Z0-9_\\-\\.]+/(p/[a-zA-Z0-9_-]+)"
6869
],
69-
"endpoint": "https://graph.facebook.com/v18.0/instagram_oembed?format={format}&url=https://www.{1}{2}"
70+
"endpoint": "https://graph.facebook.com/v24.0/instagram_oembed?format={format}&url=https://www.{1}{2}"
7071
},
7172
{
7273
"name": "Instagram profile",
7374
"templates": [
7475
"(?:www\\.)?(instagram\\.com/)([a-zA-Z0-9_\\-\\.]+)/?(?:\\?.+)?$"
7576
],
7677
"url": "https://www.{1}{2}/",
77-
"endpoint": "https://graph.facebook.com/v18.0/instagram_oembed?format={format}&&url={url}"
78+
"endpoint": "https://graph.facebook.com/v24.0/instagram_oembed?format={format}&&url={url}"
7879
},
7980
{
8081
"name": "Dailymotion",

plugins/domains/facebook.com/facebook.post.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ export default {
66
/^https?:\/\/(?:www|m|business)\.facebook\.com\/(permalink|story)\.php\?[^\/]+(\d{10,})/i,
77
/^https?:\/\/(?:www|m|business)\.facebook\.com\/photo\.php\?(?:[^\?]+)?fbid=(\d{10,})/i,
88
/^https?:\/\/(?:www|m|business)\.facebook\.com\/photo\/?\?(?:[^\?]+)?fbid=(\d{10,})/i,
9-
/^https?:\/\/(?:www|m|business)\.facebook\.com\/([a-zA-Z0-9\.\-]+)\/(posts|activity)\/(\d{10,})/i,
10-
/^https?:\/\/(?:www|m|business)\.facebook\.com\/([a-zA-Z0-9\.\-]+)\/(posts|activity)\/pfbid([a-zA-Z0-9\.\-]+)/i,
11-
/^https?:\/\/(?:www|m|business)\.facebook\.com\/([a-zA-Z0-9\.\-]+)\/photos(?:\/[^\/]+)?\/(\d{10,})/i,
12-
/^https?:\/\/(?:www|m|business)\.facebook\.com\/notes\/([^\/\?]+)\/[^\/]+\/(\d{10,})/i,
13-
/^https?:\/\/(?:www|m|business)\.facebook\.com\/media\/set\/\?set=[^\/]+(\d{10,})/i
9+
/^https?:\/\/(?:www|m|business)\.facebook\.com\/[^\/]+\/(posts|activity)\/(\d{10,})/i,
10+
/^https?:\/\/(?:www|m|business)\.facebook\.com\/[^\/]+\/posts\/[^\/]+\/(\d{10,})/i,
11+
/^https?:\/\/(?:www|m|business)\.facebook\.com\/[^\/]+\/(posts|activity)\/pfbid([a-zA-Z0-9\.\-]+)/i,
12+
/^https?:\/\/(?:www|m|business)\.facebook\.com\/[^\/]+\/photos(?:\/[^\/]+)?\/(\d{10,})/i,
13+
/^https?:\/\/(?:www|m|business)\.facebook\.com\/notes\/[^\/\?]+\/[^\/]+\/(\d{10,})/i,
14+
/^https?:\/\/(?:www|m|business)\.facebook\.com\/media\/set\/\?set=[^\/]+(\d{10,})/i,
1415
],
1516

1617
mixins: ["fb-error"],

0 commit comments

Comments
 (0)