This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Commit 96705b7 1 parent e7e044e commit 96705b7 Copy full SHA for 96705b7
File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ async def cxmooc_tool(sess: requests.Session,
29
29
sess = requests .Session ()
30
30
31
31
# 接口
32
- url = "https://blog .icodef.com:8081 /v2/answer"
32
+ url = "https://cx .icodef.com/v2/answer"
33
33
34
34
# 接口参数
35
35
index = yield
@@ -296,9 +296,11 @@ async def www150s(sess: requests.Session,
296
296
res = res .json ()
297
297
answer = []
298
298
temp = {}
299
- temp ['topic' ] = res ['title' ]
300
- temp ['correct' ] = res ['answer' ]
301
- if temp ['topic' ] != "查无此题,请您换一道题查询!" :
299
+ for each in res :
300
+ temp ['topic' ] = each ['title' ]
301
+ temp ['correct' ] = each ['answer' ]
302
+ if temp ['topic' ] == "查无此题,请您换一道题查询!" :
303
+ break
302
304
answer .append (temp )
303
305
logging .info ("Yield question %s: %s" % (i + 1 , answer ))
304
306
index = yield answer
Original file line number Diff line number Diff line change @@ -542,7 +542,10 @@ async def search(self, frame_list):
542
542
for generator in generator_list .keys ():
543
543
label .insert (END , f"查询中。。。使用源{ generator } \n " )
544
544
label .configure (state = "disable" )
545
- result = await generator_list [generator ].asend (i )
545
+ try :
546
+ result = await generator_list [generator ].asend (i )
547
+ except Exception as e :
548
+ logging .error (repr (e ))
546
549
label .configure (state = "normal" )
547
550
if result and result [0 ]['correct' ]:
548
551
for answer in result :
You can’t perform that action at this time.
0 commit comments