mirror of
https://github.com/maubot/rss.git
synced 2025-08-03 20:34:20 -04:00
Key entries by link if missing ID
Resolves the problem of incorrectly duplicated entries in feeds that update content but don’t explicitly provide entry IDs. Example feed: - https://www.to-rss.xyz/wikipedia/current_events/ Example entry: <item> <title>Current events: 2022-07-13</title> <link>https://en.wikipedia.org/wiki/Portal:Current_events/2022_July_13</link> <description>[VARIABLE CONTENT]</description> <pubDate>Wed, 13 Jul 2022 00:00:00 -0000</pubDate> </item> <item> This behavior is suggested by the common practice of using an entry’s link as its ID value, and is consistent with typical feed aggregators such as Feedbin and Inoreader.
This commit is contained in:
parent
30ad459870
commit
03bb128005
1 changed files with 1 additions and 1 deletions
|
@ -279,12 +279,12 @@ class RSSBot(Plugin):
|
|||
feed_id=feed_id,
|
||||
id=(
|
||||
getattr(entry, "id", None)
|
||||
or getattr(entry, "link", None)
|
||||
or hashlib.sha1(
|
||||
" ".join(
|
||||
[
|
||||
getattr(entry, "title", ""),
|
||||
getattr(entry, "description", ""),
|
||||
getattr(entry, "link", ""),
|
||||
]
|
||||
).encode("utf-8")
|
||||
).hexdigest()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue