achillean / shodan-python

The official Python library for Shodan
https://developer.shodan.io
Other
2.52k stars 569 forks source link

Added timeout to session requests #166

Open d0lb33 opened 2 years ago

d0lb33 commented 2 years ago

I've been having issues lately with shodan.count with the python client. It seems to hang at this get request. I went ahead and gave the get request a timeout of 1, while allowing retries up to five times. This works for me, if there is a better way please feel free to let me know!

Most of the time, it simply needs one retry. I played with the timeout time, and anything above1 takes way to long, 1 seemed to be the best.

d0lb33 commented 2 years ago

Fixes #167

d0lb33 commented 2 years ago

I should note this is after consecutively running a program I am writing that calls this count method.