added a timeout
This commit is contained in:
parent
adba7ca14b
commit
96e575edba
1 changed files with 2 additions and 2 deletions
4
main.py
4
main.py
|
@ -50,9 +50,9 @@ class ReplyListener(mastodon.StreamListener):
|
||||||
|
|
||||||
kind = 'general' #todo: support for images
|
kind = 'general' #todo: support for images
|
||||||
if kind == 'images':
|
if kind == 'images':
|
||||||
r = requests.get("https://searx.lynnesbian.space/?category_images=1&q={}&format=json".format(q))
|
r = requests.get("https://searx.lynnesbian.space/?category_images=1&q={}&format=json".format(q), timeout=10)
|
||||||
else:
|
else:
|
||||||
r = requests.get("https://searx.lynnesbian.space/?q={}&format=json".format(q))
|
r = requests.get("https://searx.lynnesbian.space/?q={}&format=json".format(q), timeout=10)
|
||||||
j = r.json()
|
j = r.json()
|
||||||
|
|
||||||
if kind == 'images':
|
if kind == 'images':
|
||||||
|
|
Loading…
Reference in a new issue