diff --git a/src/misc.py b/src/misc.py index ffd7c25..0506302 100644 --- a/src/misc.py +++ b/src/misc.py @@ -294,7 +294,7 @@ def prepare_paths(path: str, dry=False): misc_logger.critical("wiki_url is not specified in the settings. Please provide the wiki url in the settings and start the script again.") sys.exit(1) for url_scheme in (path, path.split("wiki")[0], urlunparse((*parsed_url[0:2], "", "", "", ""))): # check different combinations, it's supposed to be idiot-proof - tested = quick_try_url(url_scheme + "/api.php?action=query&format=json&meta=siteinfo") + tested = quick_try_url(url_scheme.rstrip("/") + "/api.php?action=query&format=json&meta=siteinfo") if tested: if not dry: WIKI_API_PATH = urlunparse((*parsed_url[0:2], "", "", "", "")) + tested.json()["query"]["general"]["scriptpath"] + "/api.php"