Skip to content

Commit 1224020

Browse files
committed
update:小说加标题,重新编译打包
1 parent cc8b9ad commit 1224020

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ yarn build
4343

4444
# 更新记录
4545

46+
### 20250120
47+
48+
1. 小说自动加标题
49+
4650
### 20250119
4751

4852
1. 支持通用嗅探

nodejs/source/ds-cat.20250120-1.7z

502 KB
Binary file not shown.

nodejs/src/router.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const spiderPrefix = '/spider';
1313
let dsSites = [];
1414
let dsParses = [];
1515
let drpyS_data = {};
16+
let drpyS_error = null;
1617

1718
/**
1819
* A function to initialize the router.
@@ -89,7 +90,8 @@ export default async function router(fastify) {
8990
});
9091
}
9192
} catch (e) {
92-
console.log(`加载配置发生了错误: ${e.message}`)
93+
drpyS_error = e.message;
94+
console.log(`加载配置发生了错误: ${drpyS_error}`)
9395
}
9496
}
9597
}
@@ -183,6 +185,7 @@ export default async function router(fastify) {
183185
// config.video.sites = config.video.sites.concat(dsSites);
184186
drpyS.updateSiteMap(dsSites);
185187
config.parses = dsParses;
188+
config.drpyS_error = drpyS_error;
186189
drpyS.updateDsCache('parses', dsParses);
187190
console.log(JSON.stringify(config));
188191
reply.send(config);

nodejs/src/spider/video/drpyS.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ async function play(_inReq, _outResp) {
246246
let book = {};
247247
let referer = '';
248248
if (stags.includes('书')) {
249-
book.content = JSON.parse(result.url.replace('novel://', '')).content;
249+
let bookJson = JSON.parse(result.url.replace('novel://', ''));
250+
book.title = bookJson.title;
251+
book.content = book.title + '\n' + bookJson.content;
250252
book.header = result.header;
251253
result = book;
252254
}

0 commit comments

Comments
 (0)