Fix support for Wikipedia URLs

Closes: #4
This commit is contained in:
Edward Betts 2023-10-30 06:43:45 +00:00
parent e4e9df88d7
commit 6f43cee91b

View file

@ -57,7 +57,7 @@ def start() -> str:
if not enwp: if not enwp:
return flask.render_template("combined.html") return flask.render_template("combined.html")
input_is = "url" if enwp.startswith(enwiki) else "title" input_is = "url" if enwiki in enwp else "title"
wikipedia_url: str wikipedia_url: str
wiki_part1: str wiki_part1: str
@ -70,7 +70,7 @@ def start() -> str:
wikipedia_url = enwp wikipedia_url = enwp
else: else:
name = enwp name = enwp
wiki_part1 = enwiki wiki_part1 = "https://" + enwiki
wiki_part2 = name.replace(" ", "_") wiki_part2 = name.replace(" ", "_")
wikipedia_url = wiki_part1 + wiki_part2 wikipedia_url = wiki_part1 + wiki_part2