添加超时

This commit is contained in:
Jerry Yan 2020-04-12 20:37:33 +08:00
parent 3b7943ca23
commit b38431bf4c

2
api.py
View File

@ -76,6 +76,8 @@ class XiGuaLiveApi:
self.roomPopularity = _data["data"]["popularity"]
def getJson(self, url, **kwargs):
if "timeout" not in kwargs:
kwargs["timeout"] = 10
try:
p = self.s.get(url, **kwargs)
except Exception as e: