diff --git a/maubot.yaml b/maubot.yaml index 18fded8..71e7579 100644 --- a/maubot.yaml +++ b/maubot.yaml @@ -1,6 +1,6 @@ maubot: 0.3.1 id: com.3ddbrewery.media -version: 0.6.2 +version: 0.6.3 license: MIT modules: - media_bot diff --git a/media_bot/clients/seerr.py b/media_bot/clients/seerr.py index aab75de..3afe358 100644 --- a/media_bot/clients/seerr.py +++ b/media_bot/clients/seerr.py @@ -13,6 +13,7 @@ from typing import Optional from urllib.parse import quote import aiohttp +import yarl class SeerrError(RuntimeError): @@ -34,7 +35,10 @@ class SeerrClient: url = f"{self.base}{path}" if params: url += "?" + _qs(params) - async with self.session.get(url, headers=self.headers) as r: + # yarl decodes "safe" sub-delims like %27 back to literal ' in the query, + # which Seerr's strict ajv validator then rejects. encoded=True keeps the + # RFC 3986 encoding we built with _qs intact on the wire. + async with self.session.get(yarl.URL(url, encoded=True), headers=self.headers) as r: if r.status >= 400: raise SeerrError(f"GET {path} → {r.status}: {(await r.text())[:200]}") return await r.json()