From b99bec02880f2a774995f0d02ea8743e71f43ed6 Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Tue, 7 May 2024 01:29:32 +0100 Subject: [PATCH] Protect ID lookup from redirects --- notifier/wikiconnection.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/notifier/wikiconnection.py b/notifier/wikiconnection.py index 3fb8f276..c6d74ba3 100644 --- a/notifier/wikiconnection.py +++ b/notifier/wikiconnection.py @@ -408,8 +408,10 @@ def get_page_id(self, wiki_id: str, slug: str) -> int: raise RuntimeError( f"Cannot access page from unsupported wiki {wiki_id}" ) from error - page_url = "http{}://{}.wikidot.com/{}".format( - "s" if wiki["secure"] else "", wiki_id, slug + page_url = ( + "http{}://{}.wikidot.com/{}/norender/true/noredirect/true".format( + "s" if wiki["secure"] else "", wiki_id, slug + ) ) page = self._session.get(page_url).text return int(