1
0
Fork 0
mirror of https://git.sr.ht/~cadence/NewLeaf synced 2026-05-04 16:41:37 +00:00

Remove with requests when it is unnecessary

This commit is contained in:
Cadence Ember 2022-01-16 21:51:26 +13:00
parent 73b4fbabf7
commit 68cfbb809f
No known key found for this signature in database
GPG key ID: BC1C2C61CF521B17
6 changed files with 244 additions and 244 deletions

View file

@ -20,12 +20,12 @@ def extract_search_suggestions(q):
"xhr": "t",
# "xssi": "t"
}
with requests.get("https://clients1.google.com/complete/search", params=params) as r:
r.raise_for_status()
response = r.json()
result = {
"query": q,
"suggestions": [s[0] for s in response[1]]
}
suggestions_cache[q] = result
return result
r = requests.get("https://clients1.google.com/complete/search", params=params)
r.raise_for_status()
response = r.json()
result = {
"query": q,
"suggestions": [s[0] for s in response[1]]
}
suggestions_cache[q] = result
return result