diff --git a/README.md b/README.md index 6a9d1ae..066a79c 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ that contains a better embed (that allows to play videos directly in Discord, fo ## Features & Highlights - Supports Twitter, Nitter, Instagram, TikTok, Reddit, Threads, Bluesky, Snapchat, Facebook, Pixiv, Twitch, Spotify, - DeviantArt, Newgrounds, Mastodon, Tumblr, BiliBili, Pinterest, IFunny, YouTube, Imgur, Weibo, Fur Affinity, + DeviantArt, Newgrounds, Mastodon, Tumblr, BiliBili, Xiaohongshu, Pinterest, IFunny, YouTube, Imgur, Weibo, Fur Affinity, Rule34.xxx, Danbooru, Gelbooru, e621, e926, Realbooru, Hypnohub, Konachan, Yande.re, Derpibooru, Rule34.paheal, XBooru, TBIB, and any custom websites of your choice - Posts translation @@ -475,6 +475,22 @@ _Are you aware of any other fixer that isn't included here? Feel free to open an - Other official public instances/redirects: `ppxiv.net` - Pinterest Pinterest - [EmbedEZ • pinterestez.com](https://embedez.com) *Used by FixTweetBot* +- 📕 Xiaohongshu + - [EmbedEZ](https://embedez.com) *Used by FixTweetBot* +
+ Comparison table + + | Link type | [EmbedEZ](https://embedez.com) | Link example | + |--------------------|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `/explore/:id` | ✔️ | https://www.xiaohongshu.com/explore/6a7a9cdb000000003301195a?xsec_token=AB483N-FfOfHY6C00apje97XpgXQ9SNRon6-WNUzBxzl4=&xsec_source=pc_feed | + | Translation | ❌ | / | + | Normal view | ✔️ | / | + | Direct view | ❌ | / | + | Gallery view | ❌ | / | + | Text view | ❌ | / | + + > Tested the 08/09/2026 +
- IFunny IFunny - [EmbedEZ • ifunnyez.co](https://embedez.com) *Used by FixTweetBot* - Youtube YouTube diff --git a/config.yml b/config.yml index cbea4fd..496c854 100644 --- a/config.yml +++ b/config.yml @@ -38,6 +38,7 @@ emoji: twitch: "🎮" spotify: "🎵" bilibili: "📺" + xiaohongshu: "📕" ifunny: "🙂" furaffinity: "🐾" youtube: "📺" diff --git a/database/migrations/2026_09_10_010100_add_xiaohongshu.py b/database/migrations/2026_09_10_010100_add_xiaohongshu.py new file mode 100644 index 0000000..039719c --- /dev/null +++ b/database/migrations/2026_09_10_010100_add_xiaohongshu.py @@ -0,0 +1,15 @@ +"""AddXiaohongshu Migration.""" + +from masoniteorm.migrations import Migration + + +class AddXiaohongshu(Migration): + def up(self): + """Add Xiaohongshu website settings.""" + with self.schema.table("guilds") as table: + table.boolean("xiaohongshu").default(True) + + def down(self): + """Remove Xiaohongshu website settings.""" + with self.schema.table("guilds") as table: + table.drop_column("xiaohongshu") diff --git a/locales/en-US.yml b/locales/en-US.yml index ad6649a..9b0e6e2 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -296,7 +296,7 @@ misc: ## Features & Highlights - Supports Twitter, Nitter, Instagram, TikTok, Reddit, Threads, Bluesky, Snapchat, Facebook, - Pixiv, Twitch, Spotify, DeviantArt, Newgrounds, Mastodon, Tumblr, BiliBili, Pinterest, IFunny, YouTube, Imgur, + Pixiv, Twitch, Spotify, DeviantArt, Newgrounds, Mastodon, Tumblr, BiliBili, Xiaohongshu, Pinterest, IFunny, YouTube, Imgur, Weibo, Fur Affinity, Rule34.xxx, Danbooru, Gelbooru, e621, e926, Realbooru, Hypnohub, Konachan, Yande.re, Derpibooru, Rule34.paheal, XBooru, TBIB, and any custom websites of your choice and any custom websites of your choice diff --git a/src/settings.py b/src/settings.py index 0305f54..6e1fdfb 100644 --- a/src/settings.py +++ b/src/settings.py @@ -1417,6 +1417,15 @@ class BilibiliSetting(WebsiteBaseSetting): proxies = {"BiliFix": "https://www.vxbilibili.com/"} +class XiaohongshuSetting(WebsiteBaseSetting): + """Represents the Xiaohongshu setting""" + + id = 'xiaohongshu' + name = 'Xiaohongshu' + emoji = discore.config.emoji.xiaohongshu + proxies = {"EmbedEZ": "https://embedez.com"} + + class IFunnySetting(EmbedEZBaseSetting): """Represents the ifunny setting""" @@ -1721,6 +1730,7 @@ def __init__(self, interaction: discore.Interaction, view: SettingsView, ctx: Da MastodonSetting(interaction, view, ctx), TumblrSetting(interaction, view, ctx), BilibiliSetting(interaction, view, ctx), + XiaohongshuSetting(interaction, view, ctx), WeiboSetting(interaction, view, ctx), ImgurSetting(interaction, view, ctx), IFunnySetting(interaction, view, ctx), diff --git a/src/websites.py b/src/websites.py index f710ee6..155e651 100644 --- a/src/websites.py +++ b/src/websites.py @@ -698,6 +698,20 @@ async def get_fixed_url(self) -> tuple[str | None, str | None]: return fixed_url, self.fixer_name +class XiaohongshuLink(EmbedEZLink): + """Xiaohongshu website.""" + + id = 'xiaohongshu' + hypertext_label = 'Xiaohongshu' + is_translation = False + subdomains = None + routes = generate_routes( + "xiaohongshu.com", + { + "/explore/:id": ["xsec_token", "xsec_source"], + }) + + class IFunnyLink(EmbedEZLink): """IFunny website.""" @@ -945,6 +959,7 @@ async def get_original_url(self) -> tuple[str | None, str | None]: MastodonLink, TumblrLink, BiliBiliLink, + XiaohongshuLink, IFunnyLink, YouTubeLink, ImgurLink,