fix: AUR RPC API 404 — use list params for arg[] encoding
This commit is contained in:
+20
-10
@@ -34,11 +34,16 @@ class AURSource:
|
|||||||
async def aur_info(name: str) -> AURPackage | None:
|
async def aur_info(name: str) -> AURPackage | None:
|
||||||
"""Fetch package info from AUR RPC API."""
|
"""Fetch package info from AUR RPC API."""
|
||||||
async with httpx.AsyncClient(timeout=30) as client:
|
async with httpx.AsyncClient(timeout=30) as client:
|
||||||
resp = await client.get(AUR_RPC, params={
|
resp = await client.get(
|
||||||
"type": "info",
|
AUR_RPC,
|
||||||
"v": "5",
|
params=[
|
||||||
"arg[]": name,
|
("type", "info"),
|
||||||
})
|
("v", "5"),
|
||||||
|
("arg[]", name),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
if resp.status_code == 404:
|
||||||
|
return None
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
data: dict[str, Any] = resp.json()
|
data: dict[str, Any] = resp.json()
|
||||||
|
|
||||||
@@ -94,11 +99,16 @@ async def aur_sources(name: str) -> AURSource | None:
|
|||||||
async def _raw_info(name: str) -> dict[str, Any] | None:
|
async def _raw_info(name: str) -> dict[str, Any] | None:
|
||||||
"""Get raw RPC result for a package."""
|
"""Get raw RPC result for a package."""
|
||||||
async with httpx.AsyncClient(timeout=30) as client:
|
async with httpx.AsyncClient(timeout=30) as client:
|
||||||
resp = await client.get(AUR_RPC, params={
|
resp = await client.get(
|
||||||
"type": "info",
|
AUR_RPC,
|
||||||
"v": "5",
|
params=[
|
||||||
"arg[]": name,
|
("type", "info"),
|
||||||
})
|
("v", "5"),
|
||||||
|
("arg[]", name),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
if resp.status_code == 404:
|
||||||
|
return None
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
data = resp.json()
|
data = resp.json()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user