You've already forked XiguaLiveDanmakuHelper
添加超时
This commit is contained in:
2
api.py
2
api.py
@@ -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:
|
||||
|
Reference in New Issue
Block a user