@cloud411716/fancy-webnovel 0.1.27 → 0.1.28

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.27",
3
+ "version": "0.1.28",
4
4
  "type": "module",
5
5
  "main": "plugins/fancy-bootstrap/index.js",
6
6
  "exports": {
@@ -129,7 +129,7 @@ async function scrapeQidian(outDir) {
129
129
  const outFile = join(outDir, `${PLATFORM_CN.qidian}${rt.label}_${today}.md`);
130
130
  const md = renderQidianMarkdown(rt.label, url, books);
131
131
  writeFileSync(outFile, md, 'utf-8');
132
- console.log(` ✅ ${rt.label}: ${books.length} 本 → ${outFile}`);
132
+ console.error(` ✅ ${rt.label}: ${books.length} 本 → ${outFile}`);
133
133
  results.push({ label: rt.label, count: books.length, file: outFile });
134
134
  }
135
135
 
@@ -181,8 +181,8 @@ function scrapeBrowserStub(platform, length, outDir) {
181
181
  const instructions = getBrowserInstructions(platform, length);
182
182
 
183
183
  writeFileSync(instrFile, JSON.stringify(instructions, null, 2), 'utf-8');
184
- console.log(` ℹ ${pcn}(${lenStr})需要 browser_* 工具,已生成指令文件:${instrFile}`);
185
- console.log(` ℹ 请让 LLM 读取并执行该指令文件中的 browser 操作`);
184
+ console.error(` ℹ ${pcn}(${lenStr})需要 browser_* 工具,已生成指令文件:${instrFile}`);
185
+ console.error(` ℹ 请让 LLM 读取并执行该指令文件中的 browser 操作`);
186
186
  return { file: instrFile, instructions };
187
187
  }
188
188
 
@@ -315,7 +315,7 @@ function generateReport(platform, length, scanFiles, outDir) {
315
315
 
316
316
  const reportFile = join(outDir, `${pcn}${lenStr}扫榜报告_${today}.md`);
317
317
  writeFileSync(reportFile, report, 'utf-8');
318
- console.log(` ✅ 扫榜报告 → ${reportFile}`);
318
+ console.error(` ✅ 扫榜报告 → ${reportFile}`);
319
319
  return reportFile;
320
320
  }
321
321
 
@@ -354,7 +354,7 @@ function appendTopicDecision(platform, length, reportFile, outDir) {
354
354
  const header = `# 选题决策:${today}\n\n---\n\n`;
355
355
  writeFileSync(decisionFile, header + section + '\n', 'utf-8');
356
356
  }
357
- console.log(` ✅ topic_decision 追加 → ${decisionFile}`);
357
+ console.error(` ✅ topic_decision 追加 → ${decisionFile}`);
358
358
  return decisionFile;
359
359
  }
360
360
 
@@ -406,7 +406,7 @@ async function main() {
406
406
 
407
407
  if (platform === 'qidian') {
408
408
  // 起点:HTTP mobile SSR
409
- console.log('→ 采集 起点(mobile SSR)...');
409
+ console.error('→ 采集 起点(mobile SSR)...');
410
410
  scrapeFiles = await scrapeQidian(scanDir);
411
411
  if (!scrapeFiles.length) {
412
412
  console.error(' ❌ 起点采集失败');
@@ -415,15 +415,15 @@ async function main() {
415
415
  scanFiles = scrapeFiles.map(f => f.file);
416
416
  } else {
417
417
  // 其他平台:browser_* 工具(LLM 读取指令文件后执行)
418
- console.log(`→ ${PLATFORM_CN[platform]}(browser_* 工具)...`);
418
+ console.error(`→ ${PLATFORM_CN[platform]}(browser_* 工具)...`);
419
419
  const { file, instructions } = scrapeBrowserStub(platform, length, scanDir);
420
420
  scrapeFiles.push({ file });
421
421
  scanFiles.push(file);
422
422
 
423
423
  // 输出指令供 LLM 读取
424
- console.log('\n=== 浏览器采集指令 ===');
425
- console.log(JSON.stringify(instructions, null, 2));
426
- console.log('=== 浏览器采集指令 END ===\n');
424
+ console.error('\n=== 浏览器采集指令 ===');
425
+ console.error(JSON.stringify(instructions, null, 2));
426
+ console.error('=== 浏览器采集指令 END ===\n');
427
427
  }
428
428
 
429
429
  // 生成扫榜报告
@@ -443,8 +443,7 @@ async function main() {
443
443
  summary: `${PLATFORM_CN[platform]}(${length})采集完成,共 ${scanFiles.length} 个文件`,
444
444
  };
445
445
 
446
- console.log('\n=== RECEIPT ===');
447
- console.log(JSON.stringify(receipt, null, 2));
446
+ console.log(JSON.stringify(receipt));
448
447
  }
449
448
 
450
449
  main().catch(e => {