feature: 完成部分GET API - #1
Open
Me9uru wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
该 PR 为 Wenku8API 补齐一批“GET 类”接口能力(列表/发现、书架操作、评论、用户信息、首页推荐),并新增配套的数据模型与 README 能力清单更新,整体上是在扩展现有 API 客户端对 wenku8 页面功能的覆盖面。
Changes:
- 在
wenku8/api.py中新增分类列表、已完结列表、书架增删、评论/回复、用户详情、首页推荐等抓取与解析方法,并补充若干解析 helper。 - 在
wenku8/models.py中新增NovelCover / CommentItem / ReplyItem / RecommendBlock / UserInfo等数据模型。 - 更新
README.md的能力列表与 TODO。
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| wenku8/models.py | 新增多种轻量列表/评论/推荐/用户信息的数据模型,供新增 API 返回使用 |
| wenku8/api.py | 新增多项 GET API(分类、完结、书架、评论/回复、用户信息、推荐)及解析辅助函数 |
| README.md | 更新已支持能力与评论相关 TODO 列表 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if rows: | ||
| imgs = rows[0].xpath('./td[3]//img') | ||
| if imgs: | ||
| avatar = (imgs[0].get("src") or "").replace("https", "http") |
| raw_time = "".join(divs[1].itertext()).strip() | ||
| pipe_idx = raw_time.find('|') | ||
| if pipe_idx > 0: | ||
| raw_time = raw_time[:pipe_idx - 1].strip() |
Comment on lines
+560
to
+561
| async def get_novel_by_category(self, tag: str, sort: str, page: int = 1, | ||
| lang: Lang = Lang.zh_CN) -> SearchResult: |
Comment on lines
+149
to
+153
| @dataclass | ||
| class RecommendBlock: | ||
| """首页推荐区块。""" | ||
| title: str | ||
| list: list[NovelCover] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
列表 / 发现
书架操作
评论
用户
首页
解析 helper
新增 model(models.py)
待办