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:
parent
73b4fbabf7
commit
68cfbb809f
6 changed files with 244 additions and 244 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue