Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update aapi.py #276

Merged
merged 6 commits into from
Jul 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions pixivpy3/aapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,27 @@ def novel_new(
r = self.no_auth_requests_call("GET", url, params=params, req_auth=req_auth)
return self.parse_result(r)

def novel_follow(
self,
req_auth: bool = True,
Solomon-Edwards marked this conversation as resolved.
Show resolved Hide resolved
restrict:str= 'public',
offset:int|None = None
Solomon-Edwards marked this conversation as resolved.
Show resolved Hide resolved
) -> ParsedJson:
'''
返回已关注用户的新小说。最多30个项目。

restrict(int): 返回内容的限制。可以是 'all', 'public' or 'private'。public表示非R18且非R18G,private表示R18或R18G,all表示二者全部。

offset(int|None): 距离最新的小说的距离。为None时表示从最新的小说开始取得,为1时表示从第二新的小说开始取得,以此类推。不可以填0。
'''
Solomon-Edwards marked this conversation as resolved.
Show resolved Hide resolved
url = "%s/v1/novel/follow" % self.hosts
params: dict[str, Any] = {
"restrict":restrict,
"offset":offset
Solomon-Edwards marked this conversation as resolved.
Show resolved Hide resolved
}
r = self.no_auth_requests_call("GET", url, params=params,req_auth=req_auth)
Solomon-Edwards marked this conversation as resolved.
Show resolved Hide resolved
return self.parse_result(r)

# 小说正文
def novel_text(self, novel_id: int | str, req_auth: bool = True) -> ParsedJson:
url = "%s/v1/novel/text" % self.hosts
Expand Down