tFix Top100. - gopherbay - A Gopher interface to The Pirate Bay (HTM) git clone https://git.parazyd.org/gopherbay (DIR) Log (DIR) Files (DIR) Refs (DIR) README --- (DIR) commit 0ae042dfe0f452124240222d1ad52c0f10047a53 (DIR) parent b4784e4099197f9dc4c3c8e2ebfabde637343224 (HTM) Author: parazyd <parazyd@dyne.org> Date: Wed, 11 Nov 2020 21:07:44 +0100 Fix Top100. Diffstat: M q.dcgi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- (DIR) diff --git a/q.dcgi b/q.dcgi t@@ -1,6 +1,7 @@ #!/usr/bin/env python3 # Beerware License, parazyd <parazyd@dyne.org> +from syslog import syslog from collections import OrderedDict from json import loads from sys import argv t@@ -105,7 +106,7 @@ def httpget(url): return r.text def q(_argv): - query = quote(_argv[1] if _argv[1] else _argv[2]) + query = _argv[1] if _argv[1] else _argv[2] if query[0:10] == "top100:all": data = httpget(server + "/precompiled/data_top100_all.json") t@@ -116,7 +117,7 @@ def q(_argv): elif query[0:7] == "top100:": data = httpget(server + "/precompiled/data_top100_" + query[7:] + ".json") else: - data = httpget(server + "/q.php?q=" + query) + data = httpget(server + "/q.php?q=" + quote(query)) jsondata = loads(data)