添加超时
This commit is contained in:
parent
3b7943ca23
commit
b38431bf4c
2
api.py
2
api.py
@ -76,6 +76,8 @@ class XiGuaLiveApi:
|
|||||||
self.roomPopularity = _data["data"]["popularity"]
|
self.roomPopularity = _data["data"]["popularity"]
|
||||||
|
|
||||||
def getJson(self, url, **kwargs):
|
def getJson(self, url, **kwargs):
|
||||||
|
if "timeout" not in kwargs:
|
||||||
|
kwargs["timeout"] = 10
|
||||||
try:
|
try:
|
||||||
p = self.s.get(url, **kwargs)
|
p = self.s.get(url, **kwargs)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Reference in New Issue
Block a user