python-markdown-oembed/mdx_oembed/endpoints.py

32 lines
786 B
Python
Raw Normal View History

2012-11-13 21:28:10 +00:00
import oembed
2026-03-02 16:25:43 +00:00
# URL patterns use python-oembed's glob-like syntax, not standard regex.
2021-12-08 14:07:57 +00:00
YOUTUBE = oembed.OEmbedEndpoint('https://www.youtube.com/oembed', [
'https?://(*.)?youtube.com/*',
'https?://youtu.be/*',
])
2012-11-13 21:28:10 +00:00
2026-03-02 16:25:43 +00:00
SLIDESHARE = oembed.OEmbedEndpoint('https://www.slideshare.net/api/oembed/2', [
'https?://www.slideshare.net/*/*',
'https?://fr.slideshare.net/*/*',
'https?://de.slideshare.net/*/*',
'https?://es.slideshare.net/*/*',
'https?://pt.slideshare.net/*/*',
])
2026-03-02 16:25:43 +00:00
FLICKR = oembed.OEmbedEndpoint('https://www.flickr.com/services/oembed/', [
'https?://*.flickr.com/*',
])
2022-08-02 12:13:40 +00:00
VIMEO = oembed.OEmbedEndpoint('https://vimeo.com/api/oembed.json', [
'https?://vimeo.com/*',
])
DEFAULT_ENDPOINTS = [
YOUTUBE,
FLICKR,
VIMEO,
2026-03-02 16:25:43 +00:00
SLIDESHARE,
2015-04-21 09:23:39 +00:00
]