18 lines
427 B
Python
18 lines
427 B
Python
from .base import EmbedProvider
|
|
|
|
class CoubProvider(EmbedProvider):
|
|
name = "coub"
|
|
pattern = r"\{\{COUB:([A-Za-z0-9]+)\}\}"
|
|
|
|
def replace(self, match):
|
|
coub_id = match.group(1)
|
|
|
|
embed_html = f'''
|
|
<iframe src="https://coub.com/embed/{coub_id}"
|
|
width="640"
|
|
height="480"
|
|
frameborder="0"
|
|
allowfullscreen>
|
|
</iframe>
|
|
'''
|
|
return self.wrap_template("coub", embed_html) |