fix(api): correct API request URL handling of spaces

Switched double quotes to single quotes in URL handling code for better consistency and to avoid potential issues with escaping characters. This ensures the proper construction of the API request URL, improving reliability when fetching wiki articles.
This commit is contained in:
Kumi 2024-09-19 19:11:49 +02:00
parent 203e6cd2cf
commit 00d4f9694a
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -269,7 +269,7 @@ def wiki_article(
logger.debug(f"Fetching {title} from {base_url}") logger.debug(f"Fetching {title} from {base_url}")
api_request = urllib.request.Request( api_request = urllib.request.Request(
f"{base_url}/api/rest_v1/page/html/{escape(quote(title.replace(" ", "_")), True).replace('/', '%2F')}", f"{base_url}/api/rest_v1/page/html/{escape(quote(title.replace(' ', '_')), True).replace('/', '%2F')}",
headers=HEADERS, headers=HEADERS,
) )