forked from PrivateCoffee/wikimore
fix(wiki-article): correct URL escaping issue
Switched to single quotes for the title replacement in the URL to ensure compatibility with older Python versions.
This commit is contained in:
parent
e8823de045
commit
0e37e0524b
1 changed files with 1 additions and 1 deletions
|
@ -112,7 +112,7 @@ def wiki_article(project, lang, title):
|
||||||
|
|
||||||
logger.debug(f"Fetching {title} from {base_url}")
|
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(' ', '_'), True)}&prop=revisions&rvprop=content&rvparse=1"
|
||||||
with urllib.request.urlopen(url) as response:
|
with urllib.request.urlopen(url) as response:
|
||||||
data = json.loads(response.read().decode())
|
data = json.loads(response.read().decode())
|
||||||
pages = data["query"]["pages"]
|
pages = data["query"]["pages"]
|
||||||
|
|
Loading…
Reference in a new issue