This commit is contained in:
Theenoro
2026-02-26 09:34:55 +01:00
parent ff9864a1db
commit a6d8f3c2ee
6 changed files with 435 additions and 0 deletions

15
providers/reddit.py Normal file
View File

@@ -0,0 +1,15 @@
from .base import EmbedProvider
class RedditProvider(EmbedProvider):
name = "reddit"
pattern = r"\{\{REDDIT:(https?://[^\}]+)\}\}"
def replace(self, match):
url = match.group(1)
embed_html = f'''
<blockquote class="reddit-embed-bq" data-embed-locale="en-EN" data-embed-theme="dark" data-embed-showedits="false" data-embed-created="2026-02-25T21:30:20.003Z" data-embed-showusername="false" style="height:500px" data-embed-height="546" >
<a href="{url}"></a>
</blockquote><script async="" src="https://embed.reddit.com/widgets.js" charset="UTF-8"></script>
'''
return self.wrap_template("reddit", embed_html)