Add Erai-raws
This commit is contained in:
parent
dbb7586496
commit
933b016917
23
pynyaata/bridge/erairaws.py
Normal file
23
pynyaata/bridge/erairaws.py
Normal 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}")
|
Reference in New Issue
Block a user