@acanthis-dec/linovelib 1.1.2 → 1.3.0
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/README.md +4 -1
- package/README.zh-CN.md +4 -1
- package/assets/THIRD-PARTY-NOTICES.md +18 -0
- package/assets/captcha_cropped.onnx +0 -0
- package/dist/index.d.mts +9 -13
- package/dist/index.mjs +474 -182
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -17
package/README.md
CHANGED
|
@@ -50,7 +50,10 @@ const client = new LinovelibClient(
|
|
|
50
50
|
|
|
51
51
|
const results = await client.searchNovels("keyword");
|
|
52
52
|
const novel = await client.getNovelInfo("example-id");
|
|
53
|
-
const chapterHtml = await client.getChapter(
|
|
53
|
+
const chapterHtml = await client.getChapter(
|
|
54
|
+
"example-novel-id",
|
|
55
|
+
"example-chapter-id",
|
|
56
|
+
);
|
|
54
57
|
```
|
|
55
58
|
|
|
56
59
|
## API
|
package/README.zh-CN.md
CHANGED
|
@@ -50,7 +50,10 @@ const client = new LinovelibClient(
|
|
|
50
50
|
|
|
51
51
|
const results = await client.searchNovels("keyword");
|
|
52
52
|
const novel = await client.getNovelInfo("example-id");
|
|
53
|
-
const chapterHtml = await client.getChapter(
|
|
53
|
+
const chapterHtml = await client.getChapter(
|
|
54
|
+
"example-novel-id",
|
|
55
|
+
"example-chapter-id",
|
|
56
|
+
);
|
|
54
57
|
```
|
|
55
58
|
|
|
56
59
|
## API
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# 第三方声明
|
|
2
|
+
|
|
3
|
+
`assets/captcha_cropped.onnx` 是 [ddddocr](https://github.com/sml2h3/ddddocr)
|
|
4
|
+
`common_old.onnx` 的**裁剪版本**(仅把输出层 `(1024, 8210)` 裁到 `(1024, 63)`,
|
|
5
|
+
其余权重与结构未改动),直接取自 npm 包
|
|
6
|
+
[`captcha-ocr-model`](https://www.npmjs.com/package/captcha-ocr-model),
|
|
7
|
+
以 MIT 许可再分发。
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
The MIT License (MIT)
|
|
11
|
+
Copyright © 2022 <copyright holders>
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
18
|
+
```
|
|
Binary file
|
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { BinaryResponse,
|
|
1
|
+
import { BinaryResponse, BrowserProfileName, FlareSolverrOptions } from "@acanthis-dec/browser-fetch";
|
|
2
2
|
import { Novel, NovelSearchResult } from "@acanthis-dec/core";
|
|
3
3
|
import { StorageService } from "@acanthis-dec/storage";
|
|
4
4
|
import { Logger } from "winston";
|
|
5
|
-
|
|
6
|
-
//#region src/novel.d.ts
|
|
5
|
+
export declare function isUnresolvedChapterId(id: string): boolean;
|
|
7
6
|
interface NovelUpdateInfo {
|
|
8
7
|
coverUrl: string;
|
|
9
8
|
chapterCount: number;
|
|
10
9
|
}
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/client.d.ts
|
|
13
10
|
type SessionOptions = {
|
|
14
11
|
enabled: false;
|
|
15
12
|
} | {
|
|
@@ -36,12 +33,12 @@ type LinovelibClientOptions = {
|
|
|
36
33
|
cookies: CookieStoreOptions;
|
|
37
34
|
proxy?: string | undefined;
|
|
38
35
|
};
|
|
39
|
-
declare class LinovelibClient {
|
|
36
|
+
export declare class LinovelibClient {
|
|
40
37
|
private storage?;
|
|
41
38
|
private fetchClient;
|
|
42
39
|
private novelChapterQueue;
|
|
43
40
|
private novelInfoQueue;
|
|
44
|
-
private
|
|
41
|
+
private searchSession;
|
|
45
42
|
private options?;
|
|
46
43
|
private logger?;
|
|
47
44
|
private isSessionValid?;
|
|
@@ -58,11 +55,10 @@ declare class LinovelibClient {
|
|
|
58
55
|
url: string;
|
|
59
56
|
}>;
|
|
60
57
|
getCover(url: string, referer?: string): Promise<BinaryResponse>;
|
|
58
|
+
getIllustration(url: string, referer?: string): Promise<BinaryResponse>;
|
|
61
59
|
getChapter(novelId: string, chapterId: string): Promise<string | undefined>;
|
|
62
60
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
declare function
|
|
66
|
-
|
|
67
|
-
export { LinovelibClient, type LinovelibClientOptions, type SessionOptions, novelIdToCoverUrl };
|
|
68
|
-
//# sourceMappingURL=index.d.mts.map
|
|
61
|
+
export declare function novelIdToCoverUrl(novelId: string): string;
|
|
62
|
+
export declare function extractChapterIllustrationUrls(html: string): string[];
|
|
63
|
+
export declare function rewriteChapterIllustrations(html: string, mapUrl: (originalUrl: string) => string): string;
|
|
64
|
+
export type { LinovelibClientOptions, SessionOptions };
|