Skip to content

BookItem

search()bookInfo()explore() 返回的书籍数据结构。

字段

字段类型必填说明
namestring书名
bookUrlstring书籍详情页 URL
authorstring推荐作者(视频源可填导演/主演)
coverUrlstring | CoverImageRef推荐封面图片;对象格式可指定来源与请求头
tocUrlstringbookInfo 中必填目录页 URL
introstring简介
lastChapterstring旧版最新章节字段,继续兼容
latestChapterstring最新章节名,优先使用
latestChapterUrlstring最新章节 URL
wordCountstring字数,保留站点格式,如 346.16万字
chapterCountnumber章节总数量
updateTimestring更新时间,保留站点格式
statusstring连载状态,如 连载中完本
kindstring分类标签

元数据规则

  • latestChapter 是推荐字段;旧书源的 lastChapter 仍然兼容。两者同时存在时,界面优先显示 latestChapter
  • latestChapterUrl 只在当前页面已经能拿到最新章节链接时填写,不要求额外请求。
  • wordCount 使用字符串,保留站点原始格式,例如 346.16万字约 80 万字

封面来源

coverUrl 兼容旧版字符串,也支持对象:

js
{
  url: 'https://img.example.com/cover.jpg',
  referer: 'https://www.example.com',
  sourceUrl: 'https://www.example.com/book/1',
  headers: { Cookie: '...' }
}

未指定 referer 时,运行时默认使用书源头部的第一个 @url。前端会等待 Rust 后端完成封面缓存后再显示本地缓存图片。

  • chapterCount 使用数字,只在站点直接提供总章节/总话数/总集数时填写。
  • updateTime 使用字符串,保留站点原始日期精度,例如 2026-04-30昨天
  • status 使用字符串,保留站点原文,例如 连载中完本更新至第12集
  • search()explore() 只提取当前列表页或接口已经提供的字段,不要逐本请求 bookInfo() 来补齐元数据。

各函数中的用法

search 返回

js
return [{
  name: '斗破苍穹',
  bookUrl: 'https://example.com/book/123',
  author: '天蚕土豆',
  coverUrl: 'https://example.com/cover/123.jpg',
  intro: '三十年河东,三十年河西...',
  latestChapter: '第1000章',
  wordCount: '346.16万字',
  chapterCount: 1000,
  updateTime: '2026-04-30',
  status: '连载中'
}];

bookInfo 返回

js
return {
  name: '斗破苍穹',
  bookUrl: bookUrl,
  tocUrl: bookUrl + '/chapters',   // 目录入口
  author: '天蚕土豆',
  coverUrl: 'https://example.com/cover/123.jpg',
  intro: '三十年河东,三十年河西...',
  latestChapter: '第1000章',
  latestChapterUrl: 'https://example.com/chapter/1000',
  wordCount: '346.16万字',
  chapterCount: 1000,
  updateTime: '2026-04-30',
  status: '连载中',
  kind: '玄幻'
};

explore 返回

js
return [{
  name: '斗破苍穹',
  bookUrl: 'https://example.com/book/123',
  author: '天蚕土豆',
  coverUrl: 'https://example.com/cover/123.jpg',
  kind: '玄幻',
  latestChapter: '第1000章',
  wordCount: '346.16万字',
  updateTime: '2026-04-30',
  status: '连载中'
}];

空值处理

字段缺失时填空字符串 '',不要返回 nullundefined。 搜索页和发现页只提取当前列表页已经提供的信息,不要为了补齐这些字段逐本请求详情页。

基于 MIT 许可发布