fix(wiki_article): correct URL escaping for title
Corrected the URL escaping for titles in `wiki_article` function by setting `escape` flag to `False`. This ensures the correct handling of titles with special characters. Resolves potential issues with fetching article content due to over-escaping.
This commit is contained in:
parent
c4e7acdae4
commit
b7ba63688d
1 changed files with 1 additions and 1 deletions
|
@ -119,7 +119,7 @@ def wiki_article(project, lang, title):
|
|||
|
||||
logger.debug(f"Fetching {title} from {base_url}")
|
||||
|
||||
url = f"{base_url}/w/api.php?action=query&format=json&titles={escape(title.replace(' ', '_'), True)}&prop=revisions&rvprop=content&rvparse=1"
|
||||
url = f"{base_url}/w/api.php?action=query&format=json&titles={escape(title.replace(' ', '_'), False)}&prop=revisions&rvprop=content&rvparse=1"
|
||||
with urllib.request.urlopen(url) as response:
|
||||
data = json.loads(response.read().decode())
|
||||
pages = data["query"]["pages"]
|
||||
|
|
Loading…
Reference in a new issue