@cloud411716/fancy-webnovel 0.1.48 → 0.1.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud411716/fancy-webnovel",
3
- "version": "0.1.48",
3
+ "version": "0.1.49",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -88,6 +88,8 @@ function buildBookListJS() {
88
88
  }
89
89
  return list.map(function(b){return {
90
90
  bookId:String(b.bookId||b.book_id||''),
91
+ title:b.bookName||b.book_name||b.title||b.name||'',
92
+ author:b.authorName||b.author_name||b.author||'',
91
93
  read_count:b.read_count||b.readCount||b.read||'',
92
94
  wordNumber:b.wordNumber||b.word_number||b.wordCount||'',
93
95
  creationStatus:(b.creationStatus!=null?b.creationStatus:(b.creation_status!=null?b.creation_status:b.status)),
@@ -314,39 +316,31 @@ function scrapeChannel(ch, type) {
314
316
  }
315
317
  if (books.length > TOP) books = books.slice(0, TOP);
316
318
 
317
- // 分批解码真实书名/作者/简介/题材/评分/标签
318
- const bookIds = books.map((b) => String(b.bookId));
319
- const details = fetchDetails(PORT, bookIds);
319
+ // 直接用列表页数据,跳过详情页(字体反爬导致详情页不可靠)
320
+ // const bookIds = books.map((b) => String(b.bookId));
321
+ // const details = fetchDetails(PORT, bookIds);
320
322
 
321
323
  bodyLines.push(`## ${cat.name} — ${books.length} 本`, "");
322
324
 
323
325
  for (let i = 0; i < books.length; i++) {
324
326
  const b = books[i];
325
- const info = details[String(b.bookId)] || {};
327
+ // const info = details[String(b.bookId)] || {};
326
328
  totalBooks++;
327
- const resolved = !!info.title;
329
+ const resolved = !!b.title;
328
330
  if (resolved) resolvedTitles++;
329
331
 
330
- const title = info.title || "(标题待解析)";
331
- const author = info.author || "未知";
332
- const category = info.category || b.category || "";
332
+ const title = b.title || "(标题待解析)";
333
+ const author = b.author || "未知";
334
+ const category = b.category || "";
333
335
  const catSeg = category ? ` · ${category}` : "";
334
336
 
335
337
  bodyLines.push(`### #${i + 1} ${title}`);
336
338
  bodyLines.push(
337
339
  `*${author}${catSeg} · ${fmtStatus(b.creationStatus)} · ${fmtReads(b.read_count)} 在读 · ${fmtWords(b.wordNumber)}字*`
338
340
  );
339
- if (info.tags) bodyLines.push(`**标签:** ${info.tags}`);
340
341
  bodyLines.push(`**最新更新:** ${b.lastChapterTitle || "未知"}`);
341
342
  bodyLines.push(`**bookId:** ${b.bookId}`);
342
343
  bodyLines.push(`[作品页](https://fanqienovel.com/page/${b.bookId})`);
343
- const desc = cleanDesc(info.desc);
344
- if (desc) {
345
- bodyLines.push("");
346
- bodyLines.push("**简介**");
347
- bodyLines.push("");
348
- bodyLines.push(desc);
349
- }
350
344
  bodyLines.push("");
351
345
  }
352
346