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
This commit is contained in:
Kumi 2024-08-25 17:09:45 +02:00
parent 90c068d128
commit efc48e83e8
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -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,
)