Skip to content

feature: 完成部分GET API - #1

Open
Me9uru wants to merge 1 commit into
WorldObservationLog:masterfrom
Me9uru:feature/hikari-get-endpoints
Open

feature: 完成部分GET API#1
Me9uru wants to merge 1 commit into
WorldObservationLog:masterfrom
Me9uru:feature/hikari-get-endpoints

Conversation

@Me9uru

@Me9uru Me9uru commented Aug 7, 2026

Copy link
Copy Markdown

列表 / 发现

  • get_novel_by_category(tag, sort, page) tags.php
  • get_finished_novels(page) articlelist.php

书架操作

  • add_to_bookshelf(aid) addbookcase.php
  • remove_from_bookshelf(bid) bookcase.php?delid
  • vote_novel(aid) uservote.php
  • get_user_bookshelf(uid) userpage.php

评论

  • get_comments(aid, page) reviews.php
  • get_replies(rid, page) reviewshow.php

用户

  • get_user_info() userdetail.php

首页

  • get_recommend() index.php

解析 helper

  • _is_error_page(html) 识别 wenku8 操作错误页(「出现错误!」)
  • _block_content_text(html, xpath) 提取操作提示页 .blockcontent 文本
  • _card_list_parser(html, parser) 解析 articlelist 373px 卡片列表
  • _parse_recommend_items(items) 从推荐区块 div 提取 NovelCover

新增 model(models.py)

  • NovelCover / CommentItem / ReplyItem / RecommendBlock / UserInfo

待办

  • sendComment 发表书评 review.php <- README TODO
  • sendReply 回复书评 reviewshow.php <- README TODO
  • removeNovelFromList 批量删除书架项
  • moveNovelToOther 书架分类间移动
  • fetchLatestRelease 首页最新发布

Copilot AI lite review requested due to automatic review settings August 7, 2026 07:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread wenku8/api.py
if rows:
imgs = rows[0].xpath('./td[3]//img')
if imgs:
avatar = (imgs[0].get("src") or "").replace("https", "http")
Comment thread wenku8/api.py
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 thread wenku8/api.py
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 thread wenku8/models.py
Comment on lines +149 to +153
@dataclass
class RecommendBlock:
"""首页推荐区块。"""
title: str
list: list[NovelCover]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants