From efc48e83e883e7af57dc5c14fa4b08ec55aa1c03 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sun, 25 Aug 2024 17:09:45 +0200 Subject: [PATCH] fix(app): encode slashes in wiki article requests Ensure slashes in Wiki article titles are URL encoded to prevent request errors. This change resolves issues where titles containing slashes could break the API calls. Fixes #23 --- src/wikimore/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wikimore/app.py b/src/wikimore/app.py index 6551941..73b17b7 100644 --- a/src/wikimore/app.py +++ b/src/wikimore/app.py @@ -223,7 +223,7 @@ def wiki_article( logger.debug(f"Fetching {title} from {base_url}") api_request = urllib.request.Request( - f"{base_url}/api/rest_v1/page/html/{quote(escape(title.replace(' ', '_'), False))}", + f"{base_url}/api/rest_v1/page/html/{quote(escape(title.replace(' ', '_'), False)).replace('/', '%2F')}", headers=HEADERS, )