From 3ee7e80c609afee314f3d7328b7e0c769020e407 Mon Sep 17 00:00:00 2001 From: xmengnet <51263043+xmengnet@users.noreply.github.com> Date: Sun, 9 May 2021 15:56:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worker/pkg.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/worker/pkg.py b/worker/pkg.py index 6c5f389..87047e4 100644 --- a/worker/pkg.py +++ b/worker/pkg.py @@ -73,6 +73,8 @@ class Ans(StdAns): url='https://archlinux.org/packages/search/json/?name=' + self.parms[1] + '&arch=x86_64').json() if req['results'] == []: 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) if req['resultcount'] > 0: name = '包名:' + req['results'][0]['Name']