Releases: Rongronggg9/RSS-to-Telegram-Bot
Custom format, new l10n, improved media fallback, and more (v2.1.0)
Official public bot @RSStT_Bot is always using the dev
branch. If you are using it, you may have noticed the new features. Since new commands are added, please use /lang
command once again and select your language to let the bot update your command list.
BREAKING CHANGES
- Inline mode is now required to be enabled due to new custom settings. Go to @BotFather, send
/setinline
, select your bot, and reply with an inline placeholder you like. For example, @RSStT_Bot is usingPlease input a command to continue...
.
Additions
Highlights
- More custom formatting options:
/set
command now gains its full power. You can control media or any metadata to be displayed or not. Adding your custom hashtags and setting your custom subscription title are all possible, but the inline mode is required to be enabled. Read the detailed description of formatting settings in the Formatting Settings Guidebook. - User's default formatting settings: Use
/set_default
to set your default formatting settings. It applies to all your new subscriptions and if you like, you can make existing subscriptions use them. It is useful if you want to set similar settings for most of your subscriptions.
- New l10n: Italian (Italiano), Turkish (Türkçe), Catalan (Català), and French (français). Feel like adding your language? Please read the translation guide here.
- Feed sniffer: If you try to subscribe to a webpage instead of a feed, the bot will try to sniff the feed from the webpage. (Note: this only works if the webpage contains a feed link.)
- Enclosure support: The bot can now extract enclosures from posts. Enjoy listening to podcasts or downloading attachments!
<audio>
support: The bot can now extract audio from post content. Enjoy listening to podcasts!- Send long images as files: The bot can now send long images as files. This can prevent Telegram from compressing the image and making it unreadable.
- OPML importing w/ custom title: You can now import subscriptions from OPML files, without losing your custom title. The bot will ask you if the bot should use the custom titles from the OPML file or not.
- OPML exporting w/ custom title: You can now export your subscriptions to an OPML, without losing your custom title.
Other additions
- Image validation for more formats: The bot can now judge the validity of non-JPEG images and fall back automatically to alternative images (if any) when the image is invalid.
- Image fallback (
srcset
): The bot can now fall back an image to its alternative images (<img srcset="...">
, if any) when the image is invalid. - Image fallback for pixiv: The bot can now fall back an image from pixiv to its other sizes when the image is invalid. (#41, @NekoAria)
- Image fallback for all images: The bot can now use images.weserv.nl to fall back an invalid image to an image valid for Telegram API.
- Video fallback: The bot can now fall back a video to its alternative videos (
<video><source>...</video>
, if any) or its poster (<video poster="...">
, if any) when the video is invalid. - WEBP and SVG support: The bot can now use images.weserv.nl to convert WEBP and SVG to PNG, to make them compatible with Telegram API.
- Media uploader: The bot now uploads media by using bare MTProto API calls, instead of using the effective method of telethon. This is to avoid unnecessary media fallback and to improve performance.
Enhancements
- Page number: When a command needs to be paginated, the bot will show the current page number.
/unsub_all
confirmation and backup: When you unsubscribe from all feeds, the bot will ask you to confirm and send you a backup.- Cancel: Some commands can be canceled by tapping on the
Cancel
button. - Custom monitor interval: You have now more choice of monitor interval, and if you want, you can set any interval you like (need the inline mode to be enabled, note that the bot manager can prevent ordinary users from setting a too-small value).
- Deactivating reason: When a subscription is deactivated due to too many errors, the bot will tell you the reason.
- Drop more icons: Some posts have annoying icons. The bot can now detect and drop more.
- Monitor tasks order randomization: The order of the monitor tasks is randomized.
- Retry when Telegram internal error occurs: When Telegram internal error occurs, the bot will retry to send the message.
- Rewritten post parser: The post parser is rewritten to be more flexible and gain the ability to support custom formatting.
- Rewritten rich-text splitter: The rich-text splitter is rewritten to be more stable, flexible and gain the ability to support custom formatting. This also prevents it from prematurely splitting the text.
- Command speedup: Some commands are now faster.
/test
formatting: The/test
command now uses the user's default formatting settings or the formatting settings of the feed (if subscribed). (Note: only the bot manager can use this command.)- Minor enhancements
Bug fixes
- Feed title not updated: When a feed updates its title, the bot will now update the title in the DB and send messages with the new title.
- Content too long: Those commands that may contain long content now will be either shortened or paginated. If still too long, the bot will prompt you.
- Too many entities: The bot now ensures that the number of formatting entities in a message is not greater than 100 (Telegram API limit), otherwise a split is made. This is to prevent messages from losing their formatting.
- Potential deadlock: A potential deadlock issue has been fixed.
- Improper white-space and linebreak policy: The bot can now avoid unintended white spaces and linebreaks in messages, especially for weird feeds. This also applies to the feed/post title and post author.
- Minor bug fixes
自定义格式、新本地化、改进的媒体回落和更多 (v2.1.0)
官方的公开 bot @RSStT_Bot 一直使用 dev
分支。如果你正在使用它,你可能已经注意到新功能了。由于添加了新的命令,请使用 /lang
命令再一次选择你的语言,让 bot 更新你的命令列表。
重大变更
- 由于加入了新的自定义设置,现在需要启用 inline 模式。请到 @BotFather ,发送
/setinline
,选择你的 bot,并回复一个你喜欢的 inline 占位符。例如,@RSStT_Bot 使用的是Please input a command to continue...
。
新特性
亮点
- 更多自定义格式化选项:
/set
命令可以发挥它的全部威力了。你可以控制媒体或者任何元数据是否显示,还可以添加自定义 hashtag 和设置自定义订阅标题。但这些都需要启用 inline 模式。请阅读 格式设置指南 了解格式设置的详细信息。 - 用户默认格式化设置: 使用
/set_default
命令来设置你的默认格式化设置。这将应用到你的所有新订阅,如果你喜欢,你也可以让现有订阅也使用它。如果你想给大多数你的订阅应用相似的设置,这是非常有用的。
- 新本地化: 意大利语 (Italiano)、土耳其语 (Türkçe)、加泰罗尼亚语 (Català) 和法语 (français)。想要添加你的语言吗?请在这里阅读翻译指南。
- RSS 源嗅探器: 如果你尝试订阅一个网页而不是 RSS 源,bot 将尝试从网页中提取 RSS 源。(注意:这仅在网页中包含 RSS 源链接时有效。)
- Enclosure 支持: Bot 现在可以从文章的 enclosure 中提取附件。来享受听音频节目,或者下载附件吧!
<audio>
支持: Bot 现在可以从文章中提取音频。来享受听音频节目吧!- 长图作为文件发送: Bot 现在可以将长图作为文件发送,防止 Telegram 将它压缩得不可读。
- 导入含自定义标题的 OPML 文件: 你现在可以从 OPML 文件导入订阅,而不会丢失你的自定义标题。Bot 将会询问你是否应该使用 OPML 文件中的自定义标题。
- 导出含自定义标题的 OPML 文件: 你现在可以将你的订阅导出到 OPML 文件,而不会丢失你的自定义标题。
其他新特性
- 合法化更多图片格式: Bot 现在可以判断非 JPEG 图片的合法性,并在不合法时回落到替代图片 (如果有)。
- 图片回落 (
srcset
): Bot 现在可以在图片不合法时回落到替代图片 (<img srcset="...">
,如果有)。 - pixiv 图片回落: Bot 现在可以在 pixiv 图片不合法时回落到其他尺寸 (如果有)。 (#41, @NekoAria)
- 为所有图片设计的图片回落: Bot 现在会使用 images.weserv.nl 来将不合法的图片回落成对于 Telegram API 合法的图片。
- 视频回落: Bot 现在可以在视频不合法时回落到替代视频 (
<video><source>...</video>
,如果有) 或它的封面 (<video poster="...">
,如果有)。 - WEBP 和 SVG 支持: Bot 现在会使用 images.weserv.nl 来将 WEBP 和 SVG 转换成 PNG,使它们兼容于 Telegram API。
- 媒体上传器: Bot 现在使用基本的 MTProto API 调用来上传媒体,而不是使用 telethon 提供的便捷方法。这有助于避免不必要的媒体回落和提升性能。
增强
- 页码: 当命令需要分页时,bot 会显示当前页码。
/unsub_all
确认: 当你退订所有订阅时,bot 会向你确认并发送备份。- 取消: 一些命令可通过点击
取消
按钮取消。 - 自定义监视间隔: 你现在有了更多的监视间隔可选。如果你想的话,也可以设置任何你喜欢的监视间隔 (需要启用 inline 模式,注意 bot 管理员可以禁止普通用户设置太短的监视间隔)
- 停用原因: 当订阅由于出错太多次而被停用时,bot 会告知原因。
- 丢弃更多图标: 一些文章有烦人的图标,bot 现在可以检测并丢弃更多。
- 监视任务顺序随机化: 监视任务的顺序会被随机化。
- 发生 Telegram 内部错误时重试: 当发生 Telegram 内部错误时,bot 会重试发送消息。
- 重写的文章解析器: 文章解析器被重写,以使其更灵活,并获得支持自定义格式的能力。
- 重写的富文本分割器: 富文本分割器被重写,以使其更灵活,并获得支持自定义格式的能力。这同样避免了它过早地分割文本。
- 命令加速: 一些命令现在更快了。
/test
格式化:/test
命令现在会使用用户的默认格式化设置或者订阅的格式化设置 (如果已被订阅)。 (注: 只有 bot 管理员可以使用这个命令。)- 次要的增强
Bug 修复
- RSS 源标题未更新: 当 RSS 源更新了它的标题时,bot 现在会更新在数据库里的标题并在发送消息时使用新标题。
- 内容太长: 可能包含太长的内容的命令现在会被缩减或分页。如果还是太长,bot 会提示你。
- 太多 entity: Bot 现在会确保消息中格式化 entity 的数量不多于 100 个 (Telegram API 限制),否则就进行分割。这有助于避免消息丢失格式化。
- 潜在的死锁: 一个潜在的死锁问题被修复。
- 不正确的空格和换行策略: Bot 现在会避免在消息中出现非预期的空格和换行,特别针对怪异的 RSS 源。这同样应用到 RSS 源/文章的标题和文章作者之上。
- 次要的 bug 修复
Contributors: @Rongronggg9 @NekoAria
Multi-user, i18n, improved user-friendliness, and more (v2.0.0)
Official public bot: @RSStT_Bot
This is a major release. It introduces some major breaking changes. You must migrate to the new version manually.
PLEASE READ THE MIGRATION GUIDE BEFORE UPDATING!
BREAKING CHANGES
- User and subscription management has been rewritten. The bot now can be used by multiple users and each subscription may have its individual monitoring interval. Thus, env variables
CHATID
andDELAY
are deprecated and of no use.- The default behavior is to run as a multi-user bot. If you still would like to limit the bot to serve you only, follow the migration guide.
- Redis support has been dropped. Only SQLite and PostgreSQL are supported.
Additions
Highlights
- Multi-user: The bot can be used by any users, or in channels and groups (unless env variable
MULTIUSER
is set to0
). - I18n: The bot now supports multiple languages. Currently, English (en), Simplified Chinese (简体中文, zh-Hans) and Cantonese (廣東話, yue) are supported. You can contribute by translating the bot to your language following the translation guide.
- User-friendly: You can use most commands interactively, no need to remember their syntax.
- HTTP Caching: The bot has implemented the necessary parts of RFC7234 to "cache" feeds. It can reduce the servers loads of both the bot and the feed provider.
Other additions
- Customizing subscriptions: Subscriptions can be customized. Currently, only the settings below can be customized. Other settings are WIP.
- Pausing: You can deactivate a subscription. In this way, you can make the bot pause to send updates of it.
- Muting: You can mute a subscription. In this way, when the bot sends updates of it, silent messages will be sent. (You will still receive notifications, but no sound.)
- Interval: You can change the monitoring interval of a subscription.
- Documentation: The bot now has documentation. You can find it at docs.
Enhancements
- Better feed history management: All posts in a feed are now hashed and stored. This allows you to subscribe to almost any feeds without missing posts.
- Better error handling: The bot now has better error handling. It will now try to recover from errors and retry.
- Better logging: The bot now has better logging.
- Better performance: The bot now has a better performance.
- Dependence bump: Dependencies have been bumped to the latest version. Potential security vulnerabilities have been fixed.
- Proxy bypassing: If env variable
PROXY_BYPASS_PRIVATE
is set, the bot will bypass proxy for private IPs. And will bypass proxy for domains listed in env variablePROXY_BYPASS_DOMAINS
. - Bugfixes: A few bugfixes.
多用户、国际化、改进的用户友好性和更多 (v2.0.0)
官方的公开 bot: @RSStT_Bot
这是一个重大的发布。它引入了一些重大变更,因此迁移至新版本需要手动完成。
更新前请务必阅读迁移指南!
重大变更
- 重写用户及订阅管理。Bot 现在可以被多个用户同时使用,且各个订阅都可以独立设置监视间隔。因此,环境变量
CHATID
和DELAY
已经被弃用且不再有效。- 默认情况下,bot 将作为多用户机器人运行。如果你仍然希望限制 bot 仅为你服务,请按照迁移指南进行设置。
- 不再支持 Redis,仅支持 SQLite 和 PostgreSQL。
新特性
亮点
- 多用户: 任何用户都可以使用 bot,也可以在频道和群组中使用(除非环境变量
MULTIUSER
设置为0
)。 - 国际化: Bot 现在支持多语言。目前,英语 (English, en), 简体中文 (zh-Hans) 和 粤语 (廣東話, yue) 已被支持。你可以参考 翻译指南,通过将 bot 翻译为你的语言,为项目作出贡献。
- 用户友好: 你可以交互式地使用大部分命令,而不需要记住他们的语法。
- HTTP 缓存: Bot 已经实现了 RFC7234 中的必要部分,以“缓存”订阅源。这可以帮助 bot 所在的服务器和订阅源所在的服务器降低负载。
其他新特性
- 自定义订阅: 订阅可被自定义。目前,只有下面列出的设置可被自定义。其他设置正在开发中。
- 暂停订阅: 你可以暂停订阅。这样的话,你就可以让 bot 暂停发送订阅更新。
- 静音订阅: 你可以静音订阅。这样的话,当 bot 发送更新时,会发送静音消息。(你仍然会收到通知,但不会有声音)
- 监视间隔: 你可以更改订阅的监视间隔。
- 文档: Bot 现在有了文档。请查阅 docs。
增强
- 更好的订阅源历史管理: 订阅源中的所有文章都会经过散列并储存,这样你就可以订阅几乎任何订阅源而不必担心遗漏文章。
- 更好的错误处理: Bot 现在能更好地处理错误,它将会尝试恢复并重试。
- 更好的日志: Bot 现在能更好地记录日志。
- 更佳的性能: Bot 现在有着更佳的性能。
- 依赖更新: 依赖已被更新至最新版本。潜在的漏洞已被修复。
- 代理绕过: 如果设置了环境变量
PROXY_BYPASS_PRIVATE
,bot 会为私有网络绕过代理。在环境变量PROXY_BYPASS_DOMAINS
中列出的域名也会被绕过。 - Bug 修复: 修复了一些 bug。
Rushed release to fix login (v1.6.1)
This is a rushed release. It bumps the dependency telethon
to the latest version. Please upgrade to this version immediately to avoid being unable to login due to the outdated dependency.
The bot is currently being actively developed on the multiuser
branch but has not been merged back yet to avoid introducing breaking changes too early. If you would like to try the multi-user version, there is a public demo @RSStT_Bot.
Additions
.env
file support (only for manual execution, not for docker)- Unescape HTML-escaped post title
- Use the title as the content of a post if the latter is of no text
Enhancements
- Minor bug fixes
- Introduce some workarounds to avoid being flood-controlled frequently
- Introduce some deps to speed up HTTP requests
修复登录的仓促发布 (v1.6.1)
这是一个仓促的发布。它将依赖 telethon
升级到了最新版本。请立即升级到这个版本以免由于依赖过时而无法登录。
机器人正在 multiuser
分支上被活跃开发,但尚未被合并回来,以免过早引入重大变更。如果你想要尝试多用户版本,这里有一个公开的 demo @RSStT_Bot 。
新特性
.env
文件支持 (仅在手动执行时支持,不支持 docker)- 反转义受到 HTML 转义的文章标题
- 当文章内容不含有文本时,将标题作为文章的内容
增强
- 一些小的错误修复
- 引入了一些变通解决方案以免频繁受到泛洪控制
- 引入了一些依赖以加速 HTTP 请求
Switching to MTProto, OPML support, and more (v1.6.0)
BREAKING CHANGES
- The telegram bot library has been migrated from
python-telegram-bot
(which uses HTTP Bot API and is synchronous) totelethon
(which uses MTProto Bot API and is asynchronous)- However, to use MTProto Bot API, an API key is needed. The bot has 7 built-in API keys (collected from the Internet) and in most cases, it should not be unable to log in. But if so, please obtain your own API key
(see docker-compose.yml.sample for details)
- However, to use MTProto Bot API, an API key is needed. The bot has 7 built-in API keys (collected from the Internet) and in most cases, it should not be unable to log in. But if so, please obtain your own API key
Additions
- Thanks to the migration of the Telegram bot library, the bot can now connect to its DC directly, need not detour through the HTTP Bot API, and keep polling to get new messages. Which makes the bot receive and reply to messages more rapidly and lightweight. Even if the HTTP Bot API is down, the bot can still run unaffectedly.
(more details: Advantages of MTProto over Bot API, MTProto vs HTTP Bot API) - Support parsing more HTML elements
<iframe>
<video><source><source>...</video>
<code>
<pre>
- Support OPML importing and exporting
- Support sending too-long post via Telegraph (env variable
TELEGRAPH_TOKEN
must be set) - Support using Redis as DB
- Note: This is a workaround for deploying the bot on railway.app, will be dropped in the future
- Support arm64 (docker build)
- Support resending a message using a media relay server if Telegram cannot send a message with media due to Telegram server instability or network instability between the media server and Telegram server
- Support colored logging
docker-compose.yml.sample
/version
command to check bot version- Automatically use proxy if global proxy (env variable
SOCKS_PROXY
/HTTP_PROXY
) set
Enhancements
- Assign feed monitoring tasks to every minute, instead of executing all at once each
DELAY
- Thus, env variable
DELAY
can only be 60~3600 - Note: env variable
DELAY
will be deprecated in the future
- Thus, env variable
- Recognize a post by its
guid
/id
instead oflink
- Simplify the output of
/list
- Bump Python to 3.9 (docker build)
- Minor fixes
切换到 MTProto、OPML 支持和更多 (v1.6.0)
重大变更
- 与 Telegram 交互的库由使用 HTTP Bot API 的同步库
python-telegram-bot
改为使用 MTProto Bot API 的异步库telethon
- 这引入了 API key 的需求,程序已经内置了 7 个公开的 API key,通常情况下不应无法登入。如果无法登入,可以自己申请 API key (详见 docker-compose.yml.sample 中的说明)
新特性
- 由于 Telegram bot 库的替换,bot 可以直接连接到 bot 所属的 DC,不需绕经 HTTP Bot API;也不需轮询获得消息更新,它在接收及发送消息方面都更为迅速,资源占用也更低; 即使 HTTP Bot API 宕机,bot 也可以正常工作 (详见 Advantages of MTProto over Bot API 和 MTProto vs HTTP Bot API)
- 支持更多元素的解析
<iframe>
<video><source><source>...</video>
<code>
<pre>
- 支持 OPML 导入导出
- 支持超长文章通过 Telegraph 发送 (必须先设置
TELEGRAPH_TOKEN
环境变量) - 支持使用 redis 作为数据库
- 注意:这是为了在 railway.app 上部署而设计的变通解决方案,未来很可能丢弃
- 支持 arm64 (docker 构建)
- 支持在由于 Telegram 服务器不稳定或 Telegram 服务器与媒体服务器之间的网络连接不稳定而导致 Telegram 无法发出带有媒体的消息时,使用媒体反代服务器重新发送。
- 支持日志着色
docker-compose.yml.sample
- 用于检查 bot 版本的
/version
命令 - 如果设置了全局代理 (环境变量
SOCKS_PROXY
/HTTP_PROXY
),会使用它们
增强
- 将 feed 监视任务分配到每分钟,而不是每次
DELAY
一次性全部执行- 因此,环境变量
DELAY
将只能被设置为 60~3600 - 注意:环境变量
DELAY
未来将被弃用
- 因此,环境变量
- 使用
guid
/id
来辨识一个 post,而不是link
- 简化了
/list
的输出 - 升级为 Python 3.9 (docker 构建)
- 次要的修复