koishi-plugin-magnet-get-lizard 0.0.1 → 0.0.2
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/lib/index.js +4 -2
- package/package.json +2 -2
- package/lib/index.d.ts +0 -11
package/lib/index.js
CHANGED
@@ -83,7 +83,7 @@ var sites = [
|
|
83
83
|
];
|
84
84
|
var Config = import_koishi.Schema.object({
|
85
85
|
site: import_koishi.Schema.union(sites.map((site) => import_koishi.Schema.const(site))).default("https://18mag.net").description("如果一直搜索失败,可以更换站点再试"),
|
86
|
-
maxResults: import_koishi.Schema.number().min(1).
|
86
|
+
maxResults: import_koishi.Schema.number().min(1).default(5).description("搜索结果展示数量"),
|
87
87
|
ifMessage: import_koishi.Schema.boolean().default(false).description("是否展示影片信息(发布日期、影片信息、演员,不一定都有)")
|
88
88
|
});
|
89
89
|
function apply(ctx, config) {
|
@@ -94,7 +94,9 @@ function apply(ctx, config) {
|
|
94
94
|
const page = await ctx.puppeteer.page();
|
95
95
|
await page.goto(searchUrl, { waitUntil: "domcontentloaded" });
|
96
96
|
let links = await page.$$eval(".file-list tr a", (elements, max, site) => {
|
97
|
-
return elements.
|
97
|
+
return elements.filter((el) => {
|
98
|
+
return Array.from(el.childNodes).some((node) => node.nodeName === "B");
|
99
|
+
}).map((el) => el.getAttribute("href")).filter((href) => href).map((href) => site + href).reverse().slice(0, max);
|
98
100
|
}, config.maxResults, config.site);
|
99
101
|
if (links.length === 0) {
|
100
102
|
await page.close();
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "koishi-plugin-magnet-get-lizard",
|
3
|
-
"description": "
|
4
|
-
"version": "0.0.
|
3
|
+
"description": "获取NSFW磁链资源,比我的另一个插件[javbus-lizard](https://github.com/lizard0126/javbus-lizard)收集的快。支持搜索国产",
|
4
|
+
"version": "0.0.2",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
7
7
|
"url": "git+https://github.com/lizard0126/magnet-get-lizard.git"
|
package/lib/index.d.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
import { Context, Schema } from 'koishi';
|
2
|
-
export declare const name = "magnet-get-lizard";
|
3
|
-
export declare const inject: string[];
|
4
|
-
export declare const usage = "\n# \u26A0\uFE0F NSFW\u8B66\u544A!!!\n## \u901A\u8FC7\u5173\u952E\u8BCD\u641C\u7D22\u78C1\u529B\u94FE\u63A5\u8D44\u6E90\u3002\n\n## \u914D\u7F6E\u591A\u4E2A\u8D44\u6E90\u7AD9\u70B9\uFF0C\u82E5\u641C\u7D22\u5931\u8D25\u53EF\u66F4\u6362\u7AD9\u70B9\u3002\n\n## \u8BF7\u4F4E\u8C03\u4F7F\u7528\uFF0C\u8BF7\u52FF\u914D\u7F6E\u4E8E QQ \u6216\u5176\u4ED6\u56FD\u5185 APP \u5E73\u53F0\uFF0C\u5E26\u6765\u7684\u540E\u679C\u8BF7\u81EA\u884C\u627F\u62C5\u3002\n\n---\n\n<details>\n<summary><strong><span style=\"font-size: 1.3em; color: #2a2a2a;\">\u4F7F\u7528\u65B9\u6CD5</span></strong></summary>\n\n### \u5173\u952E\u8BCD\u641C\u7D22\u78C1\u529B\u94FE\u63A5\n#### \u793A\u4F8B\uFF1A\n<pre style=\"background-color: #f4f4f4; padding: 10px; border-radius: 4px; border: 1px solid #ddd;\">magnet sone111 // \u641C\u7D22\u5173\u952E\u8BCDsone111\u7684\u8D44\u6E90</pre>\n\n### \u652F\u6301\u914D\u7F6E\uFF1A\n- **\u641C\u7D22\u7AD9\u70B9**\uFF1A\u5982\u641C\u7D22\u5931\u8D25\u53EF\u5728\u914D\u7F6E\u4E2D\u5207\u6362\u4F7F\u7528\u7684\u8D44\u6E90\u7AD9\u3002\n- **\u8FD4\u56DE\u6570\u91CF**\uFF1A\u53EF\u8BBE\u7F6E\u6BCF\u6B21\u6700\u591A\u8FD4\u56DE\u51E0\u6761\u641C\u7D22\u7ED3\u679C\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 10 \u6761\uFF09\u3002\n- **\u662F\u5426\u663E\u793A\u5F71\u7247\u4FE1\u606F**\uFF1A\u5982\u53D1\u5E03\u65E5\u671F\u3001\u5F71\u7247\u4FE1\u606F\u3001\u6F14\u5458\u7B49\uFF0C\u542F\u7528\u540E\u4F1A\u4E00\u5E76\u663E\u793A\u3002\n - \u5F71\u7247\u4FE1\u606F\u4E0D\u5168\u9762\uFF0C\u53EF\u4EE5\u548C\u6211\u7684\u53E6\u4E00\u4E2A\u63D2\u4EF6[javbus-lizard](https://github.com/lizard0126/javbus-lizard)\u7ED3\u5408\u4F7F\u7528\u3002\n\n### \u5173\u952E\u8BCD\uFF1A\n- \u65E0\u9700\u4E25\u683C\u8F93\u5165\u756A\u53F7\uFF0C\u652F\u6301\u6A21\u7CCA\u641C\u7D22\u3002\n- \u652F\u6301\u4E2D\u6587\u641C\u7D22\uFF0C\u5982\u201C\u67D0\u67D0\u63A2\u82B1\u201D\u7B49\u3002\n\n</details>\n\n<details>\n<summary><strong><span style=\"font-size: 1.3em; color: #2a2a2a;\">\u53CD\u9988\u5EFA\u8BAE\u6216\u62A5\u544A\u95EE\u9898</span></strong></summary>\n\n<strong>\u53EF\u4EE5[\u70B9\u8FD9\u91CC](https://github.com/lizard0126/magnet-get-lizard/issues)\u521B\u5EFA\u8BAE\u9898~</strong>\n\n</details>\n\n<details>\n<summary><strong><span style=\"font-size: 1.3em; color: #2a2a2a;\">\u5982\u679C\u559C\u6B22\u6211\u7684\u63D2\u4EF6</span></strong></summary>\n\n<strong>\u53EF\u4EE5[\u8BF7\u6211\u559D\u53EF\u4E50](https://ifdian.net/a/lizard0126)\uFF0C\u6CA1\u51C6\u5C31\u6709\u52A8\u529B\u66F4\u65B0\u65B0\u529F\u80FD\u4E86~</strong>\n\n</details>\n";
|
5
|
-
export interface Config {
|
6
|
-
site: string;
|
7
|
-
maxResults?: number;
|
8
|
-
ifMessage: boolean;
|
9
|
-
}
|
10
|
-
export declare const Config: Schema<Config>;
|
11
|
-
export declare function apply(ctx: Context, config: any): void;
|