mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
adds instagram reels support (#8075)
This commit is contained in:
parent
97e781e31c
commit
23895120b0
@ -24,6 +24,7 @@ class InstagramOEmbedFinder(EmbedFinder):
|
||||
INSTAGRAM_URL_PATTERNS = [
|
||||
r"^https?://(?:www\.)?instagram\.com/p/.+$",
|
||||
r"^https?://(?:www\.)?instagram\.com/tv/.+$",
|
||||
r"^https?://(?:www\.)?instagram\.com/reel/.+$",
|
||||
]
|
||||
|
||||
def __init__(self, omitscript=False, app_id=None, app_secret=None):
|
||||
|
@ -634,6 +634,16 @@ class TestInstagramOEmbed(TestCase):
|
||||
"https://www.instagram.com/p/CHeRxmnDSYe/?utm_source=ig_embed"
|
||||
)
|
||||
)
|
||||
self.assertTrue(
|
||||
finder.accept(
|
||||
"https://www.instagram.com/tv/CZMkxGaIXk3/?utm_source=ig_embed"
|
||||
)
|
||||
)
|
||||
self.assertTrue(
|
||||
finder.accept(
|
||||
"https://www.instagram.com/reel/CZMs3O_I22w/?utm_source=ig_embed"
|
||||
)
|
||||
)
|
||||
self.assertFalse(
|
||||
finder.accept("https://instagr.am/p/CHeRxmnDSYe/?utm_source=ig_embed")
|
||||
)
|
||||
@ -659,8 +669,6 @@ class TestInstagramOEmbed(TestCase):
|
||||
)
|
||||
# check that a request was made with the expected URL / authentication
|
||||
request = urlopen.call_args[0][0]
|
||||
# check that a request was made with the expected URL / authentication
|
||||
request = urlopen.call_args[0][0]
|
||||
self.assertEqual(
|
||||
request.get_full_url(),
|
||||
"https://graph.facebook.com/v11.0/instagram_oembed?url=https%3A%2F%2Finstagr.am%2Fp%2FCHeRxmnDSYe%2F&format=json",
|
||||
|
Loading…
Reference in New Issue
Block a user