Archived
1
0
Fork 0
This commit is contained in:
yzhh 2020-08-01 12:05:17 +08:00
parent b0f71deb46
commit 291208f3e7
2 changed files with 2 additions and 6 deletions

View file

@ -68,9 +68,7 @@ async def im(str1):
searchurl = url1+'api.php?action=query&list=search&srsearch=' + pagename + '&srwhat=text&srlimit=1&srenablerewrites=&format=json'
f = requests.get(searchurl)
g = json.loads(f.text)
j = g['query']['search']
b = sorted(j.keys())[0]
m = j[b]['title']
j = g['query']['search'][0]['title']
if itw == 't':
m = w+':'+m
pagename = w+':'+pagename

View file

@ -30,9 +30,7 @@ async def Wiki(path1,pagename):
searchurl = '/api.php?action=query&list=search&srsearch='+pagename+'&srwhat=text&srlimit=1&srenablerewrites=&format=json'
f = requests.get(searchurl)
g = json.loads(f.text)
j = g['query']['search']
b = sorted(j.keys())[0]
m = j[b]['title']
m = g['query']['search'][0]['title']
return ('找不到条目,您是否要找的是:' + m +'')
except Exception:
return ('找不到条目。')