Releases: Rongronggg9/RSS-to-Telegram-Bot
v2.9.0: Telegraph-related revert, skip cert verification, and more
BREAKING CHANGES
Media (image and video) are no longer uploaded when generating Telegraph posts due to Telegraph disabling media upload. (first introduced in v2.6.0)
Addition
- Disable TLS certificate verification: The environment variable
VERIFY_TLS
has been added to disable (when set to0
) or enable (when set to1
, default) TLS certificate verification. This is useful when subscribing to feeds with their TLS misconfigured. Note: Disabling TLS certificate verification is not recommended and should only be used as a last resort.
Enhancements
- Sanitize post title and author: The title and author of a post (RSS item or Atom entry) are now sanitized to prevent unexpected formatting issues. In particular, unexpected whitespaces and linebreaks are removed, and any HTML elements are stripped. This helps display them correctly in Telegram messages as well as Telegraph posts.
- Improve robustness on Railway.app: Some Railway-specific environment variables are recognized to improve robustness on Railway.app. In particular,
DATABASE_PRIVATE_URL
andDATABASE_PUBLIC_URL
will be used whenDATABASE_URL
is unavailable or invalid. This should solve most database connection issues on Railway.app. - Minor refactor: Some internal functions have been refactored to improve readability and maintainability.
Bug fixes
/version
not working: When installed from PyPI (e.g.pip install rsstt
), the/version
command might cause an error. This was a regression introduced in v2.7.0.- Bot managers can set monitoring intervals shorter than limit: Due to the breaking change introduced in v2.8.0, the privilege of bot managers to set intervals shorter than the minimal monitoring interval became useless. While v2.8.0 only applied this limitation when monitoring the updates of feeds, this release also applies it to the attempts by bot managers to change the monitoring interval for a subscription. Note: bot managers can always lower the minimal monitoring interval by adjusting
minimal_interval
in/set_option
(see also Advanced Settings), but doing so will also permit anyone who is able to use the bot to set shorter intervals. - Minor bug fixes
v2.9.0: 与 Telegraph 相关的 revert、跳过证书校验和更多
重大变更
由于 Telegraph 禁用了媒体上传,生成 Telegraph 文章时不再上传媒体 (图片与视频) 。(在 v2.6.0 中首次引入)
新增功能
- 关闭 TLS 证书验证: 环境变量
VERIFY_TLS
已被添加以禁用 (设置为0
时) 或启用 (设置为1
时,默认) TLS 证书验证。当订阅 TLS 被错误配置的 feed 时,这很有用。注意:不建议禁用 TLS 证书验证,只应用作最后手段。
增强
- 净化文章标题和作者: 文章 (RSS item 或 Atom entry) 的标题和作者现在被净化以防止意外的格式问题。特别是,预期外的空格和换行符被移除,任何 HTML 元素都被剥离。这有助于在 Telegram 消息以及 Telegraph 文章中正确显示它们。
- 改善在 Railway.app 上的稳健性: 一些特定于 Railway 的环境变量被识别以提高在 Railway.app 上的稳健性。特别是,当
DATABASE_URL
不可用或无效时,将使用DATABASE_PRIVATE_URL
和DATABASE_PUBLIC_URL
。这应该解决在 Railway.app 上的大多数数据库连接问题。 - 次要的重构: 重构了一些内部函数以提高可读性和可维护性。
Bug 修复
/version
不工作: 当从 PyPI 安装时 (例如pip install rsstt
),/version
命令可能会导致错误。这是在 v2.7.0 中引入的一个回归 (regression)。- Bot 管理员可以设置比限制更短的监控间隔: 由于 v2.8.0 中引入的一个重大变更,bot 管理员可以设置比最小监控间隔更短的间隔的特权变得毫无意义。虽然 v2.8.0 只在监控 feed 的更新时应用了这个限制,但这个版本也将它应用于 bot 管理员的更改订阅监控间隔的尝试。注意: bot 管理员总是可以通过调整
/set_option
中的minimal_interval
来降低最小监控间隔 (另请参阅 高级设置),但这样做也会允许任何能够使用 bot 的人设置更短的间隔。 - 次要的 bug 修复
v2.8.0: Retain post order, rewritten monitor, and more
Highlights
- Retain post order: Retain the order of posts in a feed when sending them. Previously, all new posts were sent simultaneously, losing their order within the feed. Note: Posts from different feeds are still sent simultaneously, so it is expected to see them interlaced.
- Rewritten monitor: The feed monitor has been rewritten for flexibility and robustness. It is now more memory-efficient and can smooth out spikes in CPU usage.
Enhancements
- Print Telegram user info of bot: Print the bot's Telegram user info when the bot is started. This is to help bot managers to find the bot's username and user ID when deploying the bot.
- Minor refactor: Some internal functions have been refactored to improve performance and maintainability.
Bug fixes
- Exit with 0 when disconnected: If the bot was logged out due to a network error or Telegram DC degradation, it would exit with exit-code 0. This led to confusion when the bot was running in a container or as a service. Now the bot will exit with exit-code 100 when disconnected.
- Unable to handle completely empty posts: Fix
AttributeError
caused by completely empty posts. They are ignored now. - Minor bug fixes
v2.8.0: 保留文章顺序,重写的监视器和更多
亮点
- 保留文章顺序: 在发送文章时保留文章在 feed 中的顺序。先前,所有新文章都被同时发送,失去了它们在 feed 中的顺序。注意:来自不同 feed 的文章仍然同时发送,因此预计会看到它们交错。
- 重写的监视器: Feed 监视器已被重写,以提高灵活性和稳健性。它现在更节省内存,并且可以平滑 CPU 使用率的波动。
增强
- 打印 bot 的 Telegram 用户信息: 在 bot 启动时打印 bot 的 Telegram 用户信息。这是为了帮助 bot 管理员在部署 bot 时找到 bot 的用户名和用户 ID。
- 次要的重构: 重构了一些内部函数以提高性能和可维护性。
Bug 修复
- 断开连接后以 0 退出: 过去,如果 bot 由于网络错误或 Telegram DC 降级而被登出,它将以退出码 0 退出。当 bot 在容器中或作为服务运行时,这会导致混乱。现在,当断开连接时,机器人将以退出码 100 退出。
- 无法处理完全空白的文章: 修复由完全空白的文章引起的
AttributeError
。它们现在会被忽略。 - 次要的 bug 修复
v2.7.0: #Hashtags from post, Python 3.12 support, and more
BREAKING CHANGES
- Migrate to
aerich
0.7.2: A breaking change introduced inaerich
(a dependency of RSStT) 0.7.x has prevented RSStT from upgrading it for a long time. A lot of effort has been made, so the migration is expected to be seamless and shouldn't break anything. However, it is encouraged to make a database backup before upgrading RSStT. If you encounter any issues due to the migration, please file a bug report.
Highlights
- #Hashtags from post (feed entry): If enabled in
/set
or/set_default
, hashtags from posts (feed entries), merged with the custom hashtags of the feed, will be added to the message. The term "hashtags from post" refers to<category>
elements in RSS<item>
or Atom<entry>
. This feature is disabled by default. Thanks @maooyer for their first contribution in #449. - Support Python 3.12: Minor fixes have been made to support Python 3.12. The official Docker image is now based on Python 3.12 as well.
- Helper scripts to make contributions easier: When performing contributions that update database models, creating database migration files is not an easy job. scripts/aerich_helper.py is a helper script that can simplify the process. Passing
--help
to the script to see a detailed usage guide.
Enhancements
- Defer monitoring as per RSSHub TTL: Defer monitoring as per the TTL (Time To Live) of feeds generated by RSSHub. RSSHub caches feed until the TTL expires, so aggressively monitoring RSSHub feeds with a long TTL is unnecessary. This aims to reduce the load of RSStT instances, as well as RSSHub instances. No delay will be applied if TTL is unavailable or less than 5 minutes. Feeds not generated by RSSHub are unaffected, considering the widespread misuse of RSS TTL.
- Defer monitoring as per Cloudflare cache: Ditto, but for feeds proxied by Cloudflare. If Cloudflare proxies a feed without caching it, no delay will be applied to the feed.
- Better handling custom #hashtags: Invalid characters and punctuations that break hashtags are now replaced with
_
(underscore) when setting custom hashtags. - Refine monitoring logging: The monitoring log has been refined to be more informative and easier to read.
- Minor refactor: Some internal functions have been refactored to improve readability and maintainability.
v2.7.0: 来自文章的 #hashtag、Python 3.12 支持和更多
重大变更
- 迁移到
aerich
0.7.2:aerich
(RSStT 的一个依赖项) 0.7.x 中引入的一个重大变更使 RSStT 长期以来无法升级它。已经作出了很多努力,所以迁移预期为无缝的,且不应该造成任何破坏。但是,建议在升级 RSStT 之前进行数据库备份。如果您因迁移而遇到任何问题,请提交错误报告。
亮点
- 来自文章 (源条目) 的 #hashtag: 如果在
/set
或/set_default
中启用,来自文章 (源条目) 的 hashtag,在与源的自定义 hashtag 合并后,将被添加到消息中。术语“来自文章的 hashtag”指的是 RSS<item>
或 Atom<entry>
中的<category>
元素。此功能默认禁用。感谢 @maooyer 在 #449 中作出的初次贡献。 - 支持 Python 3.12: 进行了一些小的修复以支持 Python 3.12。官方 Docker 镜像现在也基于 Python 3.12。
- 使贡献更容易的辅助脚本: 在进行更新数据库模型的贡献时,创建数据库迁移文件并不是一件容易的事。scripts/aerich_helper.py 是一个可以简化这个流程的辅助脚本。将
--help
传递给脚本以查看详细的使用指南。
增强
- 根据 RSSHub TTL 推迟监控: 根据 RSSHub 生成的 feed 的 TTL (生存时间) 推迟监控。RSSHub 会缓存 feed 直到 TTL 过期,因此对 TTL 较长的 RSSHub feed 进行激进的监控是不必要的。这旨在减少 RSStT 实例以及 RSSHub 实例的负载。如果 TTL 不可用或小于 5 分钟,则不会应用延迟。考虑到 RSS TTL 被广泛误用的情况,并非由 RSSHub 生成的 feed 不受影响。
- 根据 Cloudflare 缓存推迟监控: 同上,但适用于由 Cloudflare 代理的 feed。如果 Cloudflare 代理一个 feed 但不缓存它,将不会对这样的 feed 应用延迟。
- 更好地处理自定义 #hashtag: 当设置自定义 hashtag 时,会将破坏 hashtag 的无效字符和标点符号替换为
_
(下划线)。 - 改进了监控日志: 监控日志已经被改进,使其更加信息丰富和易于阅读。
- 次要的重构: 重构了一些内部函数以提高可读性和可维护性。
v2.6.0: Upload media to Telegraph, management enhancements
Highlights
- Upload media to Telegraph: When generating Telegraph posts, images as well as videos will be uploaded to Telegraph. This is to solve anti-hotlinking issues and improve the load performance of posts. This feature depends on the latest version of the media relay server (Rongronggg9/rsstt-img-relay). Those images and videos that are too large to be uploaded will still be proxied by
wsrv.nl
(environment variableIMAGES_WESERV_NL
) or media relay server (environment variableIMG_RELAY_SERVER
). Thanks #431 for inspiration.
Addition
- Multiple managers: The environment variable
MANAGER
now accepts a single user ID as well as a list separated by;
,,
,(space)
,(linebreak)
, or(tab)
. Each user in the list will be able to manage the bot equally. - Customizable error logging chat: Previously, some error logs were always sent to the bot manager. To make it more flexible, a new environment variable
ERROR_LOGGING_CHAT
, accepting a single user/channel/group ID, has been added. If set, these error logs will be sent to the specified chat. Otherwise, the first user ID inMANAGER
will be selected as default.
Enhancements
- Strip whitespaces in
<li>
: Strip whitespaces (including linebreaks) in<li>
(list item) to improve readability. Only the leading and trailing whitespaces (including linebreaks) are stripped. - Only set "force reply" in groups: Only set
ReplyKeyboardForceReply
toTrue
in groups. Previously, it was also set in private chats. See also "Bug fixes" below. - Minor refactor: Some internal functions have been refactored to improve readability and maintainability.
Bug fixes
- (
/sub
) "force reply" not cleared: Both/sub
and/import
setReplyKeyboardForceReply
toTrue
to force the user to reply to the bot. However, due to a bug of Telegram, it keeps effective even if the user has made a reply, making the reply bar always reappear. Previously, a workaround has been applied to/import
by deleting the prompt message containingReplyKeyboardForceReply
after the user has made a reply (see also #170). But/sub
was forgotten at that time. Now the workaround has been applied to/sub
too. - "Remote"
/lang
unavailable: Fix a bug preventing users from using the/lang
command "remotely".
v2.6.0: 上传媒体到 Telegraph、管理增强
亮点
- 上传媒体到 Telegraph: 在生成 Telegraph 文章时,图片和视频都将被上传到 Telegraph。这是为了解决防盗链问题和提高文章的加载性能。此功能依赖媒体反代服务器 (Rongronggg9/rsstt-img-relay) 的最新版本。由于太大而无法上传的图片和视频仍将由
wsrv.nl
(环境变量IMAGES_WESERV_NL
) 或媒体反代服务器 (环境变量IMG_RELAY_SERVER
) 进行代理。感谢 #431 的启发。
新增功能
- 多个管理员: 环境变量
MANAGER
现在既接受单个用户 ID,也接受由;
,,
,(空格)
,(换行)
或(制表符)
分隔的列表。列表中的每个用户都可以平等地管理机器人。 - 可自定义的错误日志会话: 先前,一些错误日志总是发送到 bot 管理员。为了使其更加灵活,添加了一个新的环境变量
ERROR_LOGGING_CHAT
,其接受单个用户/频道/群组 ID。如果被设置,这些错误日志将被发送到指定的会话。否则,将选择MANAGER
中的第一个用户 ID 作为默认值。
增强
- 除去
<li>
中的表层空格: 除去<li>
(列表项) 中的表层空格 (包括换行符) 以提高可读性。只有前导和尾随空格 (包括换行符) 被除去。 - 只在群组中设置“强制回复”: 只在群组中设置
ReplyKeyboardForceReply
为True
。先前,它也在私聊中被设置。另请参阅下面的“Bug 修复”。 - 次要的重构: 重构了一些内部函数以提高可读性和可维护性。
Bug 修复
- (
/sub
) “强制回复”未被清除:/sub
和/import
都将ReplyKeyboardForceReply
设置为True
以强制用户回复 bot。然而,由于 Telegram 的一个 bug,即使用户已经回复过了,它仍然有效,导致回复栏总是重新出现。先前,通过在用户回复后删除包含ReplyKeyboardForceReply
的提示消息,为/import
应用了变通解决方案 (另请参阅 #170)。但是/sub
在那时被遗忘了。现在,这个变通解决方案也被应用到了/sub
上。 - “远程”
/lang
不可用:修复阻止用户“远程”使用/lang
命令的错误。
v2.5.0: Responsiveness improvement, tiny enhancements and fixes
Addition
- Set niceness for subprocesses/threads: (Unix only) Nice subprocesses and/or threads to improve the responsiveness of the main process. This is tunable via the environment variable
EXECUTOR_NICENESS_INCREMENT
.
Enhancements
- HTML list support improvement: Now
<menu>
and<dir>
are treated the same as<ul>
(unordered list). In addition, orphan<li>
(list item) without a valid list parent tag are no longer ignored but treated as an item in an single unordered list.
Bug fixes
- Stay in topic group even when the "General" topic is closed: Now that topic groups are not fully supported, the bot can only send messages in the "General" topic. Previously, the bot would only send an error message to the bot manager if the "General" topic is closed. Now the bot will leave the topic group, without disturbing the bot manager, if the "General" topic is closed. This is a temporary limitation before topic groups are fully supported.
- v2.4.1 not released to PyPI: Due to a previous mistake, v2.4.1 could not be released to PyPI. v2.5.0 fixes the mistake and is released to PyPI.
v2.5.0: 响应性优化、小的增强和修复
新增功能
- 为子进程/线程设置 nice 值: (仅限 Unix) 为子进程和/或线程提升 nice 值以改进主进程的响应性。这可通过环境变量
EXECUTOR_NICENESS_INCREMENT
调节。
增强
- 改进了对 HTML 列表的支持: 现在,
<menu>
和<dir>
被视为<ul>
(无序列表)。此外,没有有效列表父标签的孤立<li>
(列表项) 不再被忽略,而是被视为单个无序列表中的一个项目。
Bug 修复
- 即使 “General” 话题已关闭,也留在话题群组中: 由于话题群组尚未被完全支持,bot 只能在 “General” 话题中发送消息。先前,如果 “General” 话题被关闭,bot 只会向 bot 管理员发送错误消息。现在,如果 “General” 话题被关闭,bot 将离开话题群组,而不再打扰 bot 管理员。这是在话题群组完全受支持之前的一个临时限制。
- v2.4.1 未被发布到 PyPI: 由于一个先前的失误,v2.4.1 无法被发布到 PyPI。v2.5.0 修正了这一失误,并被发布到 PyPI。
v2.4.1: Minor enhancements, bug fixes, and Happy New Year! 🎉
Enhancements
wsrv.nl
via relay: Try to usewsrv.nl
(environment variableIMAGES_WESERV_NL
) via the media relay server (environment variableIMG_RELAY_SERVER
). This is a workaround for images from domains/TLDs banned bywsrv.nl
or CDNs that banwsrv.nl
. It can hopefully reduce the frequency of seeing "invalid media" in messages since RSStT useswsrv.nl
heavily to convert images into formats accepted by Telegram DCs. See also #369.- Append enclosures to Telegraph post: Append enclosures (if any) to Telegraph post if any. Previously, enclosures can only be sent in Telegram messages, but not in Telegraph posts.
- Dependencies update: Bumped most outdated dependencies to the latest version. An optional dependency
isal
has been added to slightly improve the performance of entry hashing. - L10n update: Localizations have been updated.
- Misc refactoring: Some code has been refactored to improve readability and maintainability.
Bug fixes
- "Remote"
/test
unavailable: Fix a bug preventing the bot manager from using the/test
command "remotely". - Resized images still too big: Fix a bug causing images resized by
wsrv.nl
to be sometimes too big (exceed the 5MiB limitation of Telegram DC) to send. - Sinaimg images not parsed properly: Fix the URL regex of Sinaimg images. It can hopefully reduce the frequency of seeing "invalid media" in messages.
- WEBP fully fetched regardless of fetch limit: Fix a bug causing WEBP without
Content-Length
header to be fully fetched regardless of the fetch limit. - Entry hashing for monitor and sub not unified: Unify the entry hashing for monitor and sub. Previously, the entry hashing for monitor and sub is not unified, which may cause the bot to send persisting entries (posts) after a feed is subscribed for the first time.
v2.4.1: 次要的增强和 bug 修复,以及新年快乐!🎉
增强
- 经反代的
wsrv.nl
: 尝试通过媒体反代服务器 (环境变量IMG_RELAY_SERVER
) 使用wsrv.nl
(环境变量IMAGES_WESERV_NL
)。这是对那些来自被wsrv.nl
封禁的域名或将wsrv.nl
封禁的 CDN 的图片的变通解决方案。考虑到 RSStT 大量使用wsrv.nl
将图片转换为 Telegram DC 所接受的格式,这有望减少在消息中见到 "Invalid media" 的频率。另请参阅 #369。 - 将 enclosure 附加到 Telegraph 文章: 如果有的话,将 enclosure (附件) 附加到 Telegraph 文章。先前,enclosure 只能在 Telegram 消息中发送,而无法在 Telegraph 文章中发送。
- 依赖项更新: 将大部分过时的依赖项更新到了最新版本。引入可一个可选依赖
isal
用于稍微提升条目散列的性能。 - 本地化更新: 本地化已被更新。
- 杂项重构: 重构了一些代码以提高可读性和可维护性。
Bug 修复
- “远程”
/test
不可用:修复阻止 bot 管理员“远程”使用/test
命令的错误。 - 调节尺寸后的图像仍然太大: 修复了一个错误,这个错误导致经过
wsrv.nl
调节尺寸后的图像有时候仍然太大(超过 Telegram DC 的 5MiB 限制)以至于无法发送。 - Sinaimg 图片未被正确解析: 修复了针对 Sinaimg (微博图床) 图片的正则表达式。这有望减少在消息中见到 "Invalid media" 的频率。
- WEBP 被完全获取,而没有考虑获取限制: 修复了一个导致不带有
Content-Length
标头的 WEBP 被完全获取,而没有考虑获取限制的错误。 - 监视器和订阅的条目散列不统一: 统一监视器和订阅的条目散列。先前,监视器和订阅的条目散列不统一,这可能导致 bot 在一个 RSS 源被首次订阅后发送已经存在的条目 (文章)。
v2.4.0: Significant performance improvement, native blockquote and syntax highlighting
BREAKING CHANGES
- Drop Python 3.7 & 3.8 support: The minimum Python version requirement is now 3.9.
Highlights
Performance enhancements
- Reuse SSL context: Reuse SSL context as
aiohttp
does. This improves performance (reduce load average by ~40%) and reduces memory usage. - Lazy CookieJar: Lazy creating CookieJar until there is really a Cookie. This improves performance (reduce load average by ~15%) and reduces memory usage.
Additions
- Native blockquote:
<blockquote>
is now rendered as a native Telegram blockquote rather than a text block wrapped with horizontal rules. - Syntax highlighting:
<pre>
is now rendered as a native Telegram code block with syntax highlighting, as long as the language is specified in theclass
attribute.
Enhancements
- Custom-title-aware OPML: When importing and exporting OPML, the bot will try to distinguish if a feed is of a custom title, and preserve it if so.
/lang
and/test
as "remote" commands:/lang
and/test
are now recognized as "remote" commands, which means you can use them in the private chat to make the operation actually apply to the channel/group you've specified in the command. Note:/test
is only available to the bot manager./user_info
UX enhancement:/user_info
now has a better UX. Note:/user_info
is only available to the bot manager.- Minor enhancements: The Docker image is now based on Debian bookworm.
Bug fixes
- Unexpected feed migration: Fix a bug causing the bot to migrate feeds to a new URL unexpectedly. More specifically, the bot will now only migrate a feed if a redirection is considered permanent (HTTP status code 301 or 308).
- WEBP sent with wrong color space: Fix a bug causing WEBP images sent with a wrong color space.
- Incorrect OPML format: Fix incorrect OPML format making some RSS readers unable to import the OPML file exported by the bot.
- Mistaken watchdog feed timing: Fix a bug causing the watchdog to be feed at the wrong time.
- Uncaught errors: Fix some uncaught errors causing messages failed to be sent.
v2.4.0: 显著提高性能、原生块状引用和语法高亮
重大变更
- 取消对 Python 3.7 和 3.8 的支持:最低的 Python 版本要求现在是 3.9。
亮点
性能增强
- SSL 上下文重用:像
aiohttp
那样重用 SSL 上下文。这将提高性能(将平均负载降低约 40%)并减少内存使用量。 - 懒惰 CookieJar:懒惰创建 CookieJar,直到真正有 Cookie。这将提高性能(将平均负载降低约 15%)并减少内存使用量。
新增功能
- 原生块状引用:
<blockquote>
现在被渲染为原生的 Telegram 块状引用,取代用横线包裹的文本块。 - 语法高亮显示:只要在
class
属性中指定了语言,<pre>
现在会呈现为带有语法高亮的 Telegram 原生代码块。
增强
- 可感知自定义标题的 OPML:在导入和导出 OPML 时,bot 会尝试判断订阅源是否具有自定义标题,如果是,则会保留它。
- 将
/lang
和/test
作为“远程”命令:/lang
和/test
现在被认定为“远程”命令,这意味着您可以在私聊中使用它们,但使操作实际应用于您在命令中指定的频道/群组。注意:/test
仅适用于 bot 管理员。 /user_info
UX 增强:/user_info
现在有了更好的 UX。注意:/user_info
仅对 bot 管理员有效。- 次要的增强: Docker 映像现在基于 Debian bookworm。
Bug 修复
- 意外迁移订阅源:修复一个导致 bot 意外将订阅源迁移到新 URL 的错误。更具体地说,bot 现在只会在重定向被视为永久性(HTTP 状态码为 301 或 308)的情况下迁移订阅源。
- 以错误的色彩空间发送 WEBP:修复导致 WEBP 图像以错误色彩空间发送的错误。
- 不正确的 OPML 格式:修正不正确的 OPML 格式,这导致某些 RSS 阅读器无法导入 bot 导出的 OPML 文件。
- 错误的看门狗饲喂时序:修复导致看门狗在不正确的时间被饲喂的错误。
- 未捕获的错误:修复一些导致消息发送失败的未捕获错误。
v2.3.0: Improved performance, subscription quantity limit, and more
This is a long-awaited release. Nice to meet you again in the changelog! This is the last release that supports Python 3.7, and there will not be any patch version for the v2.3.x series. Any fixes will only be applied to the next release, which will bump the minimum Python version requirement to 3.9.
Performance enhancements
- Support for Python 3.11: Released in 2022-10-24, Python 3.11 is 10–60% (on average 25%) faster than Python 3.10. RSStT now supports Python 3.11 and the official Docker image is based on Python 3.11.
- CPU: Decrease the load average by ~30% (depends on the usage scenario). Thanks to a dependency migration from pure Python
fuzzwuzz
to C-extensionrapidfuzz
and a lot of performance tuning. - Memory: (Docker image only) Reduce memory consumption and improve memory allocation performance by adopting
jemalloc
. - Multicore CPU: If the environment variable
MULTIPROCESSING
is set to1
, multiple processes will be started. The number of processes is equal to the cores of CPU, but the maximum is 3. One is the main process, the others (if any) are used to parse RSS feeds, etc. Note that it is only valid when there are more than 1 CPU core, otherwise only 1 process (main process) will be started. It may help improve the performance on multicore CPUs but consumes more memory. Usually you don't need to enable it. However, if there are tons of subscriptions or your VPS comes with multiple cores but the performance of each is poor, you may want to enable this feature. - Bandwidth usage: Work around an upstream (
uvloop
) bug that causes the bot to use too much bandwidth. Compared to previous releases, it cuts down up to 75% bandwidth usage whenuvloop
enabled. - Startup time: Decrease the startup time by increasing the startup concurrency and putting some unimportant startup tasks into the background.
- Minor enhancements: Some internal functions have been optimized to improve performance.
Additions
Highlights
- Subscription quantity limit: The maximum number of subscriptions per user is now configurable (default: unlimited). By using the
/set_option
command, you can setuser_sub_limit
andchannel_or_group_sub_limit
. To check or set the limit of a specific user/channel/group, use the/user_info
command. - Monitor watchdog: A watchdog has been implemented to check if the feed monitor is properly running. If not, the watchdog will exit the bot. Docker, Railway or Heroku will have it automatically restarted.
Other additions
- Leave chat if been banned: If the bot has not the permission to send messages in a channel/group, it will leave the chat.
<q>
tag as quotation marks: A<q>
tag is now converted to quotation marks (<q>I am a quote,</q> said Q.
->“I am a quote,” said Q.
).- New l10n: Multiple translations have been added.
Enhancements & bug fixes
- Accept 4-char usernames: You can now use the 4-char username of your channel/group in "remote" commands.
- Ignore inline query header in commands: Formerly, if the bot is not properly set up as an inline bot, commands would be sent with an inline query header (
@bot_username
), causing the bot not to respond. Now the bot will ignore the inline query header and respond to commands correctly. - Skip monitoring tasks if flood waiting: If the bot is unable to send messages to all subscribers of a feed due to rate limit, it will skip the monitoring task for that feed once.
- Exit gracefully: If the bot receives SIGINT or SIGTERM, it will exit gracefully by closing the database connections first. Formerly, unclosed database connections would block the bot from exiting.
- Encoding detection: Fix a bug resulting in incorrect encoding detection for some feeds.
- Drop
sr-only
elements: Dropsr-only
elements from the RSS feed. They are only for screen readers and should not be rendered. - Fix mistaken command regex: Fix some mistaken command regexes preventing the bot from responding commands correctly.
Minor bug fixes & changes
More unmentioned minor bugs have been fixed in the release. The changelog does not include all the changes. For more details, please refer to the compare view.
v2.3.0: 改进的性能、订阅数量限制等
这是一个期待已久的版本。很高兴在变更日志中再次相遇!这是支持 Python 3.7 的最后一个版本,v2.3.x 系列不会有任何补丁版本。任何修复都将只应用于下一个版本,且下一个版本将使 Python 的最低版本要求提高到 3.9。
性能增强
- 对 Python 3.11 的支持:Python 3.11 于 2022-10-24 发布,速度比 Python 3.10 快 10-60% (平均 25%)。RSStT 现在支持 Python 3.11,官方 Docker 镜像也基于 Python 3.11。
- CPU:将平均负载降低约 30%(取决于使用场景)。这要归功于将依赖
fuzzwuzz
(纯 Python) 迁移到rapidfuzz
(C 扩展) 以及大量的性能调校。 - 内存:(仅适用于 Docker 镜像)采用
jemalloc
降低内存消耗,提高内存分配性能。 - 多核 CPU:如果环境变量
MULTIPROCESSING
设置为1
,将启动多个进程。进程的数量将等于 CPU 核心数,但最大值为 3。一个是主进程,其它进程(如果有的话)用于解析 RSS 提要等。请注意,只有当有 1 个以上的 CPU 核心时,该选项才有效,否则将只启动 1 个进程(主进程)。它可能有助于在多核 CPU 上提升性能,但会消耗更多内存。通常你不需要启用它。但是,如果有大量订阅,或者您的 VPS 有多个核心,但每个核心的性能都很差,您可能需要启用此功能。 - 带宽使用:变通解决上游(
uvloop
)的 bug,这导致 bot 使用过多的带宽。与之前的版本相比,当启用uvloop
时,可以减少高达 75% 的带宽使用。 - 启动时间:通过增加启动时的并发性,将一些不重要的启动任务放到后台,来减少启动时间。
- 小的功能增强:一些内部功能已进行了优化,以提高性能。
新特性
亮点
- 订阅数量限制:现在可以配置每个用户的最大订阅数量(默认值:无限制)。通过使用
/set_option
命令,可以设置user_sub_limit
(普通用户的订阅数量限制) 和channel_or_group_sub_limit
(频道或群组的订阅数量限制)。要为特定用户/频道/群组检查或设置订阅数量限制,请使用/user_info
命令。 - 监视器看门狗:已经实现了一个看门狗来检查订阅源监视器是否正常运行。如果没有,看门狗将使 bot 退出。Docker、Railway 或 Heroku 将自动重新启动它。
其他新特性
- 如果被封禁,则离开聊天:如果 bot 没有在频道/群组中发送消息的权限,它将离开聊天。
<q>
标签转换为引号:<q>
标签现在会被转换为引号(<q>I am a quote,</q> said Q.
->“I am a quote,” said Q.
)。- 新的本地化:添加了多个翻译。
增强和 bug 修复
- 接受 4 个字符的用户名:现在可以在 “远程” 命令中使用 4 个字符的用户名来指定频道/群组。
- 忽略命令中的 inline query header:先前,如果 bot 没有被正确设置为 inline bot,命令会带着 inline query header (
@bot_username
) 发送,导致 bot 没有响应。现在, bot 将忽略 inline query header 并正确响应命令。 - 如果正等待速率控制,则跳过监控任务:如果 bot 由于速率限制而无法向订阅源的所有订阅者发送消息,则会跳过该订阅源的监控任务一次。
- 优雅地退出:如果 bot 接受到 SIGINT 或 SIGTERM,它将通过首先关闭数据库连接来优雅地退出。先前,未关闭的数据库连接会阻止 bot 退出。
- 编码检测:修复导致某些订阅源的编码检测不正确的错误。
- 删除
sr-only
元素:从 RSS 源中删除sr_only
元素。它们仅用于屏幕阅读器,不应被渲染。 - 修复错误的命令正则表达式:修复一些错误的命令正则表达式,它们使 bot 无法正确响应命令。
次要的 bug 修复和更改
更多未提及的小 bug 已在该版本被修复。变更日志不包括所有变更。有关更多详细信息,请参阅比较视图。
Published to PyPI, HTML table converter, and more (v2.2.1)
Additions
Highlights
- Published to PyPI: RSStT is now available on PyPI. You may install it with
pip install rsstt
. For more details, refer to the Deployment Guide. - HTML table converter: An HTML table converter has been implemented to convert HTML tables to images. It requires the environment variable
TABLE_TO_IMAGE
to be set to1
, and CJK fonts to be installed. Please do note that the converter is not perfect, cannot handle rich-text formatting, may not work for all HTML tables, and can potentially lead to a higher performance cost and longer processing time.
Other additions
- New l10n: The Indonesian (
id
, Bahasa Indonesia) translation has been added. - Add
.env.sample
: A sample.env
file has been added.
Enhancements
- Natural sorting: Send posts from the oldest to the newest.
- Timed GC: Perform a GC (garbage collection) every 10 minutes to clean up the memory.
- Update l10n: The Turkish (
tr
, Türkçe) translation has been updated. - Security: Execute
git
outside of the shell. - Minor enhancements
Bug fixes
- Misfired monitor job: Increased the
misfire_grace_time
to 10s to avoid monitor jobs being misfired because of high load. - Deps bump: Fixed an upstream bug preventing users from resetting all subscriptions to the user's default settings on a PostgreSQL-based instance.
- Minor bug fixes
发布至 PyPI、HTML 表格转换器和更多 (v2.2.1)
新特性
亮点
- 发布至 PyPI: RSStT 现在可从 PyPI 中获取。可通过
pip install rsstt
来安装。详细信息请参阅部署指南. - HTML 表格转换器: 实现了一个 HTML 表格转换器,可以将 HTML 表格转换为图片。需要将环境变量
TABLE_TO_IMAGE
设置为1
,并且需要安装 CJK 字体。请注意,转换器不是完美的,不能处理富文本格式,可能无法处理所有的 HTML 表格,并可能会导致更高的性能成本和更长的处理时间。
其他新特性
- 新的本地化: 增加了印度尼西亚语 (
id
, Bahasa Indonesia) 的翻译。 - 增加
.env.sample
: 增加了范例.env
文件。
增强
- 自然排序: 从旧到新推送文章。
- 定时 GC: 每 10 分钟执行一次 GC (垃圾回收) 以清理内存。
- 本地化更新: 更新了土耳其语 (
tr
, Türkçe) 的翻译。 - 安全: 在 shell 之外执行
git
。 - 次要的增强
Bug 修复
- 监视任务启动失败: 增加了
misfire_grace_time
至 10s 以避免监视任务由于高负载未能启动。 - 依赖更新: 修复了一个阻止用户在使用 PostgreSQL 的实例上重置所有订阅到用户的默认设置的上游 bug。
- 次要的 bug 修复
Channel remote management, more formatting options, and more (v2.2.0)
Additions
Highlights
- Channel/group remote management: Now you can manage the subscription of your channel/group in the private chat with the bot. Most commands are supported. Just send commands like
/sub @username https://exmaple.com
or/sub -10010000000000 https://exmaple.com
. (@username
is the channel/group's username,@
is required;-10010000000000
is the channel/group's ID, it must start with-100
) - More custom formatting options:
- Media: You can make Telegram messages come with no media (just text) if you want (by default, they always come with media if any media is attached to the post). Also, you can make Telegram messages come with only media and metadata (no content) if you want, only when any media is attached to the post, otherwise, they will still come with the content.
- Link Preview: Now you can force disable link preview for Telegram messages.
- Source: More sourcing formats available. Read the detailed description in the Formatting Settings Guidebook.
- Deployment to Heroku: The bot can now be deployed to Heroku. Read the detailed description in the Deployment Guide.
- User permission management: The bot manager can now manage the permissions of the bot users by using the
/user_info
command. In this way, the bot manager can set who (user/channel/group) can use the bot, even if the multi-user mode is disabled.
Other additions
- Single-column table support: Formerly, all HTML tables were dropped from the output. Now those tables with only one column are rendered as multi-line text. Note that multi-column tables will still be dropped from the output.
- Audio fallback for lizhi.fm: Automatically fallback to the less-quality version of the audio if the higher-quality version exceeds the file size limit. Only for lizhi.fm.
Enhancements
- Prettified Telegraph post: The format of Telegraph posts is prettified. In addition, all images and videos are using the media relay server to avoid anti-hotlinking.
- Non-HTTP hyperlinks: Non-HTTP hyperlinks are not supported by Telegram. The bot will automatically convert them to bare URLs.
- Enclosure cleaning: If an enclosure with a non-HTTP URL is already included in a link in the post, it will be removed.
- Lazy media validator: The media validator is now lazy. It will only run if a post will be probably sent as Telegram messages. This will reduce CPU usage and network traffic.
- Enhanced image dimension extraction: Image dimension extraction is now faster and more flexible. If failed, the bot will try to extract the dimension using images.weserv.nl.
- L10n update: Turkish (Türkçe) l10n file updated. (English, Simplified Chinese / 简体中文, Traditional Chinese / 正體中文, Cantonese / 廣東話 are always up-to-date.)
- Improved Docker build caching: If the dependencies are not changed, no need to fetch the whole Docker image again. Just use the cached dependencies and fetch the latest source code.
- Extract git info from Railway.app env variables: Deployment on Railway.app can now recognize the git info.
- Minor enhancements
Bug fixes
- Python 3.7 compatibility: The previous version of the bot broke the compatibility with Python 3.7. Now it has been fixed. Please note that only x86 and amd64 architectures are supported. For arm64, the minimum Python version requirement is 3.8.
- EntitiesTooLongError: Posts with tons of text hyperlinks could cause Telegram API to throw this error. Now the bot will try to fix this error by more aggressive post splitting.
<div>
: The bot will now ensure that each<div>
tag takes up a whole line.- Unnecessary image fallback: The bot will no longer fall back all images to file if at least one image needs to be sent as a file.
- Web retry: Added a need-to-retry exception.
- Webpage decode error:
cchardet
is not robust enough to handle all feeds. Now the bot will try to detect the encoding of the webpage according to the XML encoding declaration. Also, ifcchardet
returns a not-supported encoding, the bot will try to decode the webpage using UTF-8. Any character that cannot be decoded will be replaced with�
. - Extracting image dimension from Exif thumbnail: Some images may contain a thumbnail in the Exif data. The bot will now avoid extracting the dimension from the thumbnail.
- Minor bug fixes
频道远程管理、更多格式化选项和更多 (v2.2.0)
新特性
亮点
- 频道/群组远程管理: 现在你可以在和 bot 的私聊里管理你的频道/群组的订阅。支持使用大部分命令。只需以类似于
/sub @username https://exmaple.com
或/sub -10010000000000 https://exmaple.com
的格式发送命令。(@username
是频道/群组的用户名,@
是不可缺少的;-10010000000000
是频道/群组的 ID, 必须以-100
开头) - 更多格式化选项:
- 媒体: 你可以选择让 Telegram 消息不带任何媒体 (只有文字)。也可以选择让 Telegram 消息只带有媒体和元数据 (没有内容);只有当有媒体附加到文章时才可如此,否则,它们仍会带有内容。
- 链接预览: 现在你可以强制关闭 Telegram 消息的链接预览。
- 来源: 更多来源格式化选项。阅读 格式设置指南 以获取详细信息。
- 部署到 Heroku: Bot 现在可以部署到 Heroku。阅读 部署指南 以获取详细信息。
- 用户权限管理: Bot 管理员现在可以使用
/user_info
命令来管理 bot 用户 (用户/频道/群组) 的权限。这样管理员就可以设置谁可以使用 bot,即使禁用了多用户模式。
其他新特性
- 单列表格支持: 先前,所有 HTML 表格都被丢弃。现在,只含有单列的表格将被渲染为多行文本。请注意,多列表格仍会被丢弃。
- 适用于 lizhi.fm 的音频回落: 如果高音质音频超出了文件大小限制,自动回落到更低音质的音频。仅适用于 lizhi.fm。
增强
- Telegraph 文章美化: Telegraph 文章的格式美化。除此之外,所有图片和视频都使用媒体中继服务器来规避防盗链。
- 非 HTTP 超链接: Telegram 不支持非 HTTP 超链接。Bot 会自动将它们转换为裸 URL。
- Enclosure 清理: 如果一个附件包含非 HTTP URL 且文章中的链接已包含它,它将被移除。
- 懒惰的媒体验证器: 媒体验证器现在是懒惰的。它只有在一篇文章可能作为 Telegram 消息发送时才会运行。这将减少 CPU 使用量和网络流量。
- 增强的图片尺寸提取: 图片尺寸提取现在更快速和灵活。如果提取失败,bot 会尝试使用 images.weserv.nl 来提取。
- 本地化更新: 土耳其语 (Türkçe) 本地化文件已更新。 (英语 / English 、简体中文 、繁体中文 / 正體中文 和 粤语 / 廣東話 永远是最新的。)
- 改进的 Docker 构建缓存: 如果依赖未改变,无需再重新拉取完整的 Docker 镜像。只需使用缓存的依赖并拉取最新的源码。
- 从 Railway.app 的环境变量中提取 git 信息: Railway.app 上的部署现在可以识别 git 信息。
- 次要的增强
Bug 修复
- Python 3.7 兼容性: 上一个版本破坏了与 Python 3.8 的兼容性,现在已经修复了。请注意,仅支持 x86 和 amd64 架构。对于 arm64,最小的 Python 版本要求是 3.8。
- EntitiesTooLongError: 含有大量文本超链接的文章可引起 Telegram API 抛出这个错误。现在 bot 会尝试通过更激进的文章分割来修复这个错误。
<div>
: Bot 现在会确保每个<div>
标签都占据一整行。- 不必要的图片回落: 如果至少有一张图片需要作为文件发送,bot 不再会将所有图片都回落成文件。
- 网络重试: 增加了一个需要进行重试的异常。
- 网页解码错误:
cchardet
并不足够健壮以处理所有源。现在 bot 会尝试从 XML 编码声明中探测网页编码。同时,如果cchardet
返回了不支持的编码,bot 会尝试使用 UTF-8 来解码网页。任何无法被解码的字符都会被替换为�
。 - 从 Exif 缩略图中提取图片尺寸: 一些图片在 Exif 数据中含有缩略图。Bot 现在会避免从缩略图中提取尺寸。
- 次要的 bug 修复