diff --git a/pynyaata/bridge/erairaws.py b/pynyaata/bridge/erairaws.py new file mode 100644 index 0000000..e7bf016 --- /dev/null +++ b/pynyaata/bridge/erairaws.py @@ -0,0 +1,23 @@ +from urllib.parse import urlencode + +from pydantic import HttpUrl, parse_obj_as + +from pynyaata.bridge.nyaa import Nyaa + + +class EraiRaws(Nyaa): + title = "Erai-raws" + + def search_url(self, query: str = "", page: int = 1) -> HttpUrl: + params = urlencode( + { + "f": 0, + "c": "1_2", + "q": f"{query} fre", + "s": "size" if query else "id", + "o": "desc", + "p": page, + } + ) + + return parse_obj_as(HttpUrl, f"{self.base_url}/user/Erai-raws?{params}")