优化搜索结果
This commit is contained in:
parent
a46f5bc9de
commit
0037637d83
1 changed files with 2 additions and 0 deletions
|
@ -73,6 +73,8 @@ class Ans(StdAns):
|
||||||
url='https://archlinux.org/packages/search/json/?name=' + self.parms[1] + '&arch=x86_64').json()
|
url='https://archlinux.org/packages/search/json/?name=' + self.parms[1] + '&arch=x86_64').json()
|
||||||
if req['results'] == []:
|
if req['results'] == []:
|
||||||
req = requests.get(url='https://aur.archlinux.org/rpc/?v=5&type=info&arg=' + self.parms[1]).json()
|
req = requests.get(url='https://aur.archlinux.org/rpc/?v=5&type=info&arg=' + self.parms[1]).json()
|
||||||
|
if req['resultcount']==0:
|
||||||
|
req = requests.get(url='https://aur.archlinux.org/rpc/?v=5&type=search&arg=' + self.parms[1]).json()
|
||||||
# print(req)
|
# print(req)
|
||||||
if req['resultcount'] > 0:
|
if req['resultcount'] > 0:
|
||||||
name = '包名:' + req['results'][0]['Name']
|
name = '包名:' + req['results'][0]['Name']
|
||||||
|
|
Loading…
Reference in a new issue