mirror of
https://github.com/Hopiu/python-markdown-oembed.git
synced 2026-03-16 22:10:24 +00:00
35 lines
860 B
Python
35 lines
860 B
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from mdx_oembed.oembed import OEmbedEndpoint
|
||
|
|
|
||
|
|
# URL patterns use shell-style globs with an "https?://" shorthand
|
||
|
|
# that matches both http and https schemes.
|
||
|
|
|
||
|
|
YOUTUBE = OEmbedEndpoint('https://www.youtube.com/oembed', [
|
||
|
|
'https?://*.youtube.com/*',
|
||
|
|
'https?://youtu.be/*',
|
||
|
|
])
|
||
|
|
|
||
|
|
SLIDESHARE = 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/*/*',
|
||
|
|
])
|
||
|
|
|
||
|
|
FLICKR = OEmbedEndpoint('https://www.flickr.com/services/oembed/', [
|
||
|
|
'https?://*.flickr.com/*',
|
||
|
|
])
|
||
|
|
|
||
|
|
VIMEO = OEmbedEndpoint('https://vimeo.com/api/oembed.json', [
|
||
|
|
'https?://vimeo.com/*',
|
||
|
|
])
|
||
|
|
|
||
|
|
DEFAULT_ENDPOINTS = [
|
||
|
|
YOUTUBE,
|
||
|
|
FLICKR,
|
||
|
|
VIMEO,
|
||
|
|
SLIDESHARE,
|
||
|
|
]
|