diff --git a/buzzrss/bot.py b/buzzrss/bot.py index b9cbe08..994ab67 100644 --- a/buzzrss/bot.py +++ b/buzzrss/bot.py @@ -424,7 +424,10 @@ class RSSBot(Plugin): ).strip() id = str(entry["id"]) link = entry.get("url") or id - return Entry(feed_id=feed_id, id=id, date=date, title=title, summary=summary, link=link) + return Entry( + feed_id=feed_id, id=id, date=date, title=title, summary=summary, link=link, + paywalled=cls._is_paywalled_link(link), + ) @classmethod async def _parse_rss( @@ -445,6 +448,12 @@ class RSSBot(Plugin): entries = [e for e in entries if not e.paywalled] return feed, entries + @staticmethod + def _is_paywalled_link(link: str) -> bool: + # DPG Media premium articles live under /ps/ (Parool/VK/Trouw feeds + # carry no paywall marker; the /ps/ path is the only reliable signal). + return "/ps/" in (link or "") + @classmethod def _parse_rss_entry(cls, feed_id: int, entry: Any) -> Entry: return Entry( @@ -470,6 +479,8 @@ class RSSBot(Plugin): str(getattr(entry, "premium", "")).lower() == "true" # DPG Media (AD/Volkskrant/Parool/Trouw): true or str(getattr(entry, "dpp_paid", "")).lower() == "true" + # DPG Media /ps/ premium path (Parool/VK/Trouw carry no marker) + or cls._is_paywalled_link(getattr(entry, "link", "")) ), ) diff --git a/maubot.yaml b/maubot.yaml index f58ba4d..a76cf33 100644 --- a/maubot.yaml +++ b/maubot.yaml @@ -1,5 +1,5 @@ id: nl.eddydevink.rss -version: 1.5.1 +version: 1.5.2 modules: - buzzrss main_class: RSSBot