@cloud411716/fancy-webnovel 0.1.51 → 0.1.52

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.51",
3
+ "version": "0.1.52",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -222,30 +222,29 @@ function spawnScraper(platform, length, outDir) {
222
222
  });
223
223
  }
224
224
 
225
- function scraperArgs(platform, length) {
225
+ function scraperArgs(platform, length, outDir) {
226
226
  switch (platform) {
227
227
  case 'fanqie':
228
228
  return {
229
229
  script: 'fanqie-rank-scraper.cjs',
230
- extra: ['--channel', 'all', '--top', '20'],
230
+ extra: ['--channel', 'all', '--top', '20', '--outdir', outDir],
231
231
  };
232
232
  case 'jinjiang':
233
233
  return {
234
234
  script: 'jjwxc-rank-scraper.cjs',
235
- extra: ['--type', '12'],
235
+ extra: ['--type', '12', '--outdir', outDir],
236
236
  };
237
237
  case 'zhihu':
238
238
  return {
239
239
  script: 'zhihu-rank-scraper.cjs',
240
- extra: ['--length', length === 'short' ? 'short' : 'long'],
240
+ extra: ['--length', length === 'short' ? 'short' : 'long', '--outdir', outDir],
241
241
  };
242
242
  case 'qimao':
243
243
  return {
244
244
  script: 'qimao-rank-scraper.cjs',
245
- extra: ['--channel', length === 'short' ? 'female' : 'male', '--type', 'hot'],
245
+ extra: ['--channel', length === 'short' ? 'female' : 'male', '--type', 'hot', '--outdir', outDir],
246
246
  };
247
247
  case 'dianzhong':
248
- // 点众没有 scraper,降级为 browser stub
249
248
  return { script: null, extra: [] };
250
249
  default:
251
250
  return { script: null, extra: [] };
@@ -399,7 +398,7 @@ async function main() {
399
398
  scanFiles = scrapeFiles.map(f => f.file);
400
399
  } else {
401
400
  // 其他平台:spawn scraper 进程
402
- const cfg = scraperArgs(platform, length);
401
+ const cfg = scraperArgs(platform, length, scanDir);
403
402
  if (!cfg.script) {
404
403
  console.error(` ❌ 平台 ${platform} 暂不支持采集`);
405
404
  process.exit(1);