Rongronggg9 / RSS-to-Telegram-Bot

A Telegram RSS bot that cares about your reading experience
https://t.me/RSStT_Bot
GNU Affero General Public License v3.0
1.55k stars 276 forks source link

Subscription Failure for Valid RSS Feed #490

Closed tyff9527 closed 4 months ago

tyff9527 commented 4 months ago

Describe the bug

A clear and concise description of what the bug is: I encountered an issue while trying to subscribe to an RSS feed using the RSS-to-Telegram-Bot. Despite confirming that the RSS feed is valid, the subscription fails with an error message indicating that the RSS feed is invalid.

To Reproduce

Steps to reproduce the behavior:

  1. Use the command: /sub https://hostloc.com/?mod=rss
  2. See the error message:
    Subscription failed
    https://hostloc.com/?mod=rss (ERROR: RSS feed is invalid)

Screenshots

微信截图_20240715013056

Feed URL

https://hostloc.com/?mod=rss

Expected behavior

A clear and concise description of what you expected to happen: The bot should successfully subscribe to the RSS feed if it is valid.

Important log

[!IMPORTANT]\ Rerun RSStT with DEBUG=1 set in the environment variables, and paste the log below. If you are using Docker, you can get the log by executing:

docker logs <container name>
2024-07-14-17:36:02:INFO:RSStT.command - Allow [用户名] ([用户ID], ChannelParticipantCreator) in Rss订阅推送 ([频道ID]) to use /sub https://hostloc.com/?mod=rss
2024-07-14-17:36:02:WARNING:RSStT.command - Sub https://hostloc.com/?mod=rss for [频道ID] failed: (ERROR: RSS feed invalid)
Rongronggg9 commented 4 months ago
$ curl https://hostloc.com/?mod=rss
<html><body><script type="text/javascript" src="/aes.min.js" ></script><noscript><h1 style="text-align:center;color:red;"><strong>Please turn JavaScript on and reload the page.</strong></h1></noscript><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("7630ff4fe2ff985dd21f9f6491f8ac8c"),b=toNumbers("113e6887d0e7b983288025684c923a5d"),c=toNumbers("0c00fd9f8015291c3a7ec7923b2f0e9c");document.cookie="cnsL7="+toHex(slowAES.decrypt(c,2,a,b))+";  path=/";location.href="https://hostloc.com/?mod=rss&d=1";</script></body></html>

The RSS feed is behind a WAF so it is only a valid RSS after passing the browser integrity check. An RSS reader is not necessarily a browser and my opinion on these websites that put their RSS feeds behind a WAF is consistent:

it does harm to the Internet.