Add Erai-raws

This commit is contained in:
Michel Roux 2022-12-22 00:10:18 +00:00
parent dbb7586496
commit 933b016917

View File

@ -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}")