@cloud411716/fancy-webnovel 0.1.78 → 0.1.80
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 +4 -1
- package/plugins/fancy-scan/scripts/scan-output-format.md +1 -1
- package/plugins/fancy-scan/scripts/scraper-registry.md +12 -12
- package/plugins/fancy-scan/scripts/scrapers/cdp-utils.cjs +11 -186
- package/plugins/fancy-scan/scripts/scrapers/node_modules/.package-lock.json +0 -20
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/LICENSE +0 -202
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/NOTICE +0 -5
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/README.md +0 -3
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/ThirdPartyNotices.txt +0 -13
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/install_media_pack.ps1 +0 -5
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +0 -33
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +0 -42
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +0 -13
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +0 -24
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +0 -42
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +0 -12
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +0 -24
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +0 -48
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +0 -11
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +0 -23
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +0 -48
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +0 -11
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +0 -23
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +0 -48
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +0 -11
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +0 -24
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/browsers.json +0 -75
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/cli.js +0 -21
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/index.d.ts +0 -17
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/index.js +0 -17
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/index.mjs +0 -28
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/bootstrap.js +0 -88
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/coreBundle.js +0 -74830
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/entry/cliDaemon.js +0 -5
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/entry/dashboardApp.js +0 -3
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/entry/mcp.js +0 -10
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/entry/oopBrowserDownload.js +0 -3
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/package.js +0 -50
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/server/electron/loader.js +0 -118
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/serverRegistry.js +0 -7347
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +0 -354
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/channelSessions.js +0 -141
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/cli.js +0 -6
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/help.json +0 -708
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/minimist.js +0 -128
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/output.js +0 -343
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/program.js +0 -404
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/registry.js +0 -176
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/cli-client/session.js +0 -258
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/dashboard/appIcon.png +0 -0
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/SKILL.md +0 -420
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/element-attributes.md +0 -23
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/playwright-tests.md +0 -39
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/request-mocking.md +0 -87
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/running-code.md +0 -241
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/session-management.md +0 -225
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/storage-state.md +0 -275
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/test-generation.md +0 -433
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/tracing.md +0 -139
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/video-recording.md +0 -143
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/SKILL.md +0 -143
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +0 -144
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/migration.md +0 -85
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/react.md +0 -67
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/vue.md +0 -75
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/skills/playwright-trace/SKILL.md +0 -171
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/utils/extension.js +0 -101
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/tools/utils/socketConnection.js +0 -108
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/utilsBundle.js +0 -90764
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +0 -2179
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/index-CyWAfh-p.js +0 -11
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/index-DhC616m4.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/index.html +0 -29
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/dashboard/playwright-logo.svg +0 -24
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/htmlReport/index.html +0 -16
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/htmlReport/report.css +0 -2
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/htmlReport/report.js +0 -32
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-CwYYHbcZ.js +0 -32
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/assets/index-DYjdXIbE.js +0 -129
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/assets/index-l_lX622x.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/index.html +0 -29
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +0 -9
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-rXmQmLUY.js +0 -32
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-B-dXF5JN.js +0 -181
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-BuZfJS5v.js +0 -7
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.BLFoOugd.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/index.B_TqY17P.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/index.KZ4wOW1K.js +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/index.html +0 -44
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +0 -16
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +0 -9
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +0 -10
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +0 -4
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/uiMode.C7UW1sC9.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Dzuouizj.js +0 -5
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +0 -18
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +0 -1
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/webp_codec.LICENSE +0 -173
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/webp_codec.wasm +0 -0
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/lib/xdg-open +0 -1267
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/package.json +0 -34
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/types/protocol.d.ts +0 -24842
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/types/structs.d.ts +0 -52
- package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/types/types.d.ts +0 -26188
- package/plugins/fancy-scan/scripts/scrapers/package.json +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud411716/fancy-webnovel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.80",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
"cordis.patch.yml",
|
|
14
14
|
"plugins/"
|
|
15
15
|
],
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"playwright-core": "^1.40.0"
|
|
18
|
+
},
|
|
16
19
|
"peerDependencies": {
|
|
17
20
|
"@deepseek-ai/dsh-llm": "^0.1.1-rc.2"
|
|
18
21
|
},
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
**故障排查(书名全是 `bookId:xxx` / `(标题待解析)`)**:
|
|
95
95
|
- 看文件头 `数据质量`:标 `[标题解析异常]` 说明详情页解码失败率高。
|
|
96
96
|
- 多为详情页结构变动或被登录/验证页拦截。在已登录的 Chrome 里手动打开任一 `https://fanqienovel.com/page/{bookId}` 确认页面正常、非验证页。
|
|
97
|
-
- 控制台若报 `
|
|
97
|
+
- 控制台若报 ` playwright-core 无法启动浏览器`,说明系统缺少 Chrome/Edge 或浏览器路径不对,用 `--login-wait` 等待手动登录后重试。
|
|
98
98
|
|
|
99
99
|
---
|
|
100
100
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## 环境要求
|
|
16
16
|
|
|
17
17
|
> ⚠️ **所有 scraper 现在使用 playwright-core 自己管理浏览器,不再依赖 agent-browser 和 Chrome CDP 端口。**
|
|
18
18
|
> 每个 scraper 独立 launch/close 浏览器进程,采集完成后自动关闭。
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
|
|
33
33
|
| 篇幅 | Scraper | 采集模式 | 示例命令 |
|
|
34
34
|
|------|---------|---------|---------|
|
|
35
|
-
| 长篇 | fanqie-rank-scraper.
|
|
35
|
+
| 长篇 | fanqie-rank-scraper.cjs | playwright-native | `node fanqie-rank-scraper.cjs --channel all --type all --outdir {out}` |
|
|
36
36
|
|
|
37
37
|
### 晋江(jinjiang)
|
|
38
38
|
|
|
39
39
|
| 篇幅 | Scraper | 采集模式 | 示例命令 |
|
|
40
40
|
|------|---------|---------|---------|
|
|
41
|
-
| 长篇 | jjwxc-rank-scraper.
|
|
41
|
+
| 长篇 | jjwxc-rank-scraper.cjs | playwright-native | `node jjwxc-rank-scraper.cjs --type 12 --outdir {out}` |
|
|
42
42
|
|
|
43
43
|
### 知乎(zhihu)
|
|
44
44
|
|
|
45
45
|
| 篇幅 | Scraper | 采集模式 | 示例命令 |
|
|
46
46
|
|------|---------|---------|---------|
|
|
47
|
-
| 长篇 | zhihu-rank-scraper.
|
|
48
|
-
| 短篇 | zhihu-rank-scraper.
|
|
47
|
+
| 长篇 | zhihu-rank-scraper.cjs | playwright-native | `node zhihu-rank-scraper.cjs --length long --outdir {out}` |
|
|
48
|
+
| 短篇 | zhihu-rank-scraper.cjs | playwright-native | `node zhihu-rank-scraper.cjs --length short --outdir {out}` |
|
|
49
49
|
|
|
50
50
|
入口 URL:`https://www.zhihu.com/fiore/h5/vip-web`
|
|
51
51
|
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
|
|
59
59
|
| 篇幅 | Scraper | 采集模式 | 示例命令 |
|
|
60
60
|
|------|---------|---------|---------|
|
|
61
|
-
| 长篇 | qimao-rank-scraper.
|
|
62
|
-
| 短篇 | qimao-rank-scraper.
|
|
61
|
+
| 长篇 | qimao-rank-scraper.cjs | playwright-native | `node qimao-rank-scraper.cjs --type hot --period day --outdir {out}` |
|
|
62
|
+
| 短篇 | qimao-rank-scraper.cjs | playwright-native | `node qimao-rank-scraper.cjs --type hot --period day --gender f --outdir {out}` |
|
|
63
63
|
|
|
64
64
|
---
|
|
65
65
|
|
|
@@ -82,12 +82,12 @@ fancy-scan/
|
|
|
82
82
|
├── run-scan.py ← Python 编排层
|
|
83
83
|
├── scraper-registry.md ← 本文件
|
|
84
84
|
├── scan-output-format.md
|
|
85
|
-
├── cdp-utils.
|
|
85
|
+
├── cdp-utils.cjs
|
|
86
86
|
├── qidian-rank-scraper.js
|
|
87
|
-
├── fanqie-rank-scraper.
|
|
88
|
-
├── jjwxc-rank-scraper.
|
|
89
|
-
├── zhihu-rank-scraper.
|
|
90
|
-
└── qimao-rank-scraper.
|
|
87
|
+
├── fanqie-rank-scraper.cjs
|
|
88
|
+
├── jjwxc-rank-scraper.cjs
|
|
89
|
+
├── zhihu-rank-scraper.cjs
|
|
90
|
+
└── qimao-rank-scraper.cjs
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
> ⚠️ 如果 `{SKILL_DIR}/references/` 下没有某个 scraper,run-scan.py 回退到"内置知识"模式,输出占位符报告并标注 `[内置知识-未采集]`。
|
|
@@ -2,188 +2,23 @@
|
|
|
2
2
|
* 工具函数 — 各平台采集脚本的公共依赖
|
|
3
3
|
*
|
|
4
4
|
* 提供:
|
|
5
|
-
* getArg()
|
|
5
|
+
* getArg() — 命令行参数解析
|
|
6
6
|
* localDateStamp() — 本地日期戳(YYYYMMDD)
|
|
7
|
-
* runCli()
|
|
8
|
-
* sleep() — 同步阻塞等待(Atomics.wait)
|
|
9
|
-
*
|
|
10
|
-
* 注意:cdp-utils 不再依赖 agent-browser/CDP 端口。浏览器生命周期由各 scraper 自己管理。
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const { execFileSync } = require("child_process");
|
|
14
|
-
const fs = require("fs");
|
|
15
|
-
const path = require("path");
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* On Windows `agent-browser` is an npm shim (agent-browser.cmd/.ps1) that
|
|
19
|
-
* forwards to the real target — the native agent-browser-win32-*.exe or a
|
|
20
|
-
* bundled Node CLI. Node refuses to execFile the `.cmd` without a shell
|
|
21
|
-
* (CVE-2024-27980), and routing the argv array through a shell mangles it: the
|
|
22
|
-
* `.cmd`'s `%*` is re-tokenized by cmd.exe (splitting on spaces, breaking on
|
|
23
|
-
* & | ^), and calling the shim by bare name from powershell.exe collapses the
|
|
24
|
-
* whole array into a single space-joined argument. The exact locus differs by
|
|
25
|
-
* runtime, so instead of hardening any one shell path we bypass shells entirely:
|
|
26
|
-
* read the `.cmd` shim, recover the real program plus its fixed leading args,
|
|
27
|
-
* and execFile that target directly with the argv array — verbatim, no shell.
|
|
7
|
+
* runCli() — CLI 入口包装(含进程超时和信号处理)
|
|
28
8
|
*/
|
|
29
|
-
function resolveWindowsAgentBrowser(argv) {
|
|
30
|
-
const dirs = String(process.env.PATH || "").split(path.delimiter);
|
|
31
|
-
let cmdPath = null;
|
|
32
|
-
for (const dir of dirs) {
|
|
33
|
-
if (!dir) continue;
|
|
34
|
-
const candidate = path.join(dir, "agent-browser.cmd");
|
|
35
|
-
if (fs.existsSync(candidate)) {
|
|
36
|
-
cmdPath = candidate;
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (!cmdPath) return { file: "agent-browser", args: argv };
|
|
41
|
-
const dir = path.dirname(cmdPath);
|
|
42
|
-
const forwardLine =
|
|
43
|
-
fs
|
|
44
|
-
.readFileSync(cmdPath, "utf8")
|
|
45
|
-
.split(/\r?\n/)
|
|
46
|
-
.find((line) => line.includes("%*")) || "";
|
|
47
|
-
const tokens = [...forwardLine.matchAll(/"([^"]*)"/g)]
|
|
48
|
-
.map((m) => m[1])
|
|
49
|
-
.map((t) =>
|
|
50
|
-
t
|
|
51
|
-
.replace(/%~dp0/gi, () => dir + path.sep)
|
|
52
|
-
.replace(/%dp0%/gi, () => dir + path.sep)
|
|
53
|
-
);
|
|
54
|
-
const jsIndex = tokens.findIndex((t) => /\.[cm]?js$/i.test(t));
|
|
55
|
-
if (jsIndex >= 0) {
|
|
56
|
-
return { file: process.execPath, args: [...tokens.slice(jsIndex), ...argv] };
|
|
57
|
-
}
|
|
58
|
-
if (tokens.length > 0) {
|
|
59
|
-
return { file: tokens[0], args: [...tokens.slice(1), ...argv] };
|
|
60
|
-
}
|
|
61
|
-
return { file: "agent-browser", args: argv };
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Build a shell-free invocation. POSIX runs the native `agent-browser` binary
|
|
66
|
-
* directly; Windows resolves the npm `.cmd` shim to that native target so the
|
|
67
|
-
* argument array is passed verbatim, never routed through cmd.exe/PowerShell.
|
|
68
|
-
*/
|
|
69
|
-
function buildAgentBrowserInvocation(port, args, platform = process.platform) {
|
|
70
|
-
const argv = ["--cdp", String(port), ...args.map(String)];
|
|
71
|
-
if (platform !== "win32") {
|
|
72
|
-
return { file: "agent-browser", args: argv };
|
|
73
|
-
}
|
|
74
|
-
return resolveWindowsAgentBrowser(argv);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// ---------------------------------------------------------------------------
|
|
78
|
-
// agent-browser 工具函数
|
|
79
|
-
// ---------------------------------------------------------------------------
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* 调用 agent-browser CLI
|
|
83
|
-
* @param {number} port - CDP 端口
|
|
84
|
-
* @param {...string} args - agent-browser 参数
|
|
85
|
-
* @returns {string} stdout(trim 后)
|
|
86
|
-
*/
|
|
87
|
-
function ab(port, ...args) {
|
|
88
|
-
const invocation = buildAgentBrowserInvocation(port, args);
|
|
89
|
-
try {
|
|
90
|
-
return execFileSync(
|
|
91
|
-
invocation.file,
|
|
92
|
-
invocation.args,
|
|
93
|
-
{
|
|
94
|
-
encoding: "utf-8",
|
|
95
|
-
timeout: 20000,
|
|
96
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
97
|
-
windowsHide: true,
|
|
98
|
-
}
|
|
99
|
-
).trim();
|
|
100
|
-
} catch (error) {
|
|
101
|
-
const stderr = error && error.stderr ? String(error.stderr).trim() : "";
|
|
102
|
-
const stdout = error && error.stdout ? String(error.stdout).trim() : "";
|
|
103
|
-
const detail = stderr || stdout || (error && error.message) || "unknown error";
|
|
104
|
-
throw new Error(`agent-browser failed: ${detail}`, { cause: error });
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/** 等待 ms 毫秒(跨平台,不依赖系统 sleep 命令) */
|
|
109
|
-
function sleep(ms) {
|
|
110
|
-
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function parseJSONResult(raw) {
|
|
114
|
-
if (!raw || raw === "ERR") {
|
|
115
|
-
throw new Error("agent-browser returned no JSON result");
|
|
116
|
-
}
|
|
117
|
-
try {
|
|
118
|
-
let parsed = JSON.parse(raw);
|
|
119
|
-
if (typeof parsed === "string") {
|
|
120
|
-
try { parsed = JSON.parse(parsed); } catch {}
|
|
121
|
-
}
|
|
122
|
-
return parsed;
|
|
123
|
-
} catch (error) {
|
|
124
|
-
throw new Error(`agent-browser returned invalid JSON: ${String(raw).slice(0, 160)}`, {
|
|
125
|
-
cause: error,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* 在浏览器内执行 JS,并解析 JSON 返回值。
|
|
132
|
-
* 一律走 base64(-b):正文提取用的 JS 常含引号、反斜杠等,作为命令行参数时在 Windows 上
|
|
133
|
-
* 无法逐字透传(.cmd 的 %* 与 PowerShell 都会二次解析)。base64 让参数只含 [A-Za-z0-9+/=],
|
|
134
|
-
* 和各采集脚本已在用的 evalJSONBase64 走同一条安全通道。
|
|
135
|
-
*/
|
|
136
|
-
function evalJSON(port, js) {
|
|
137
|
-
return evalJSONBase64(port, js);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* 通过 agent-browser 的 base64 参数执行复杂 JS,避免命令行转义和参数边界问题。
|
|
142
|
-
*/
|
|
143
|
-
function evalJSONBase64(port, js) {
|
|
144
|
-
const encoded = Buffer.from(String(js), "utf8").toString("base64");
|
|
145
|
-
return parseJSONResult(ab(port, "eval", "-b", encoded));
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* 安全地将值插入浏览器 eval 字符串。
|
|
150
|
-
* 使用 JSON.stringify 确保值不会因特殊字符(引号、反斜杠等)破坏 eval 字符串。
|
|
151
|
-
* @param {*} val - 要插入的值
|
|
152
|
-
* @returns {string} JSON 字符串表示(含引号)
|
|
153
|
-
*/
|
|
154
|
-
function safeStr(val) {
|
|
155
|
-
return JSON.stringify(String(val));
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* 滚动页面加载更多内容
|
|
160
|
-
* @param {number} port - CDP 端口
|
|
161
|
-
* @param {number} times - 滚动次数
|
|
162
|
-
* @param {number} [interval=1000] - 每次滚动间隔(ms)
|
|
163
|
-
*/
|
|
164
|
-
function scrollLoad(port, times, interval = 1000) {
|
|
165
|
-
for (let i = 0; i < times; i++) {
|
|
166
|
-
ab(port, "eval", "window.scrollBy(0, window.innerHeight)");
|
|
167
|
-
sleep(interval);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
9
|
|
|
171
10
|
/** 解析 --xxx 参数 */
|
|
172
11
|
function getArg(args, name) {
|
|
173
12
|
const i = args.indexOf(name);
|
|
174
13
|
if (i >= 0) return i + 1 < args.length ? args[i + 1] : null;
|
|
175
14
|
const prefix = `${name}=`;
|
|
176
|
-
const inline = args.find(
|
|
15
|
+
const inline = args.find(arg => String(arg).startsWith(prefix));
|
|
177
16
|
return inline === undefined ? null : String(inline).slice(prefix.length);
|
|
178
17
|
}
|
|
179
18
|
|
|
180
19
|
/**
|
|
181
|
-
* 输出文件名用的日期戳(YYYYMMDD
|
|
20
|
+
* 输出文件名用的日期戳(YYYYMMDD),一律取本地日历日。
|
|
182
21
|
* 不能用 new Date().toISOString().slice(0,10):那是 UTC 日期,比 UTC+8 晚 8 小时。
|
|
183
|
-
* 文件名是各采集脚本唯一的去重键(一个榜单一天一份),北京时间 00:00-08:00 之间的采集
|
|
184
|
-
* 会退回「昨天」的文件名,静默覆盖前一晚采到的同名报告,且这份数据被标成前一天。
|
|
185
|
-
* @param {Date} [date] - 默认当前时间
|
|
186
|
-
* @returns {string} YYYYMMDD
|
|
187
22
|
*/
|
|
188
23
|
function localDateStamp(date) {
|
|
189
24
|
const d = date instanceof Date ? date : new Date();
|
|
@@ -194,14 +29,15 @@ function localDateStamp(date) {
|
|
|
194
29
|
}
|
|
195
30
|
|
|
196
31
|
/**
|
|
197
|
-
* Run a scraper entrypoint
|
|
198
|
-
*
|
|
199
|
-
*
|
|
32
|
+
* Run a scraper entrypoint 并将结果转换为机器可读的退出码。
|
|
33
|
+
* 返回值支持:
|
|
34
|
+
* 整数 — 直接作为 written 计数
|
|
35
|
+
* 对象 — { planned, written, failed, partial, partialReasons }
|
|
200
36
|
*/
|
|
201
37
|
function runCli(main, label) {
|
|
202
38
|
Promise.resolve()
|
|
203
39
|
.then(main)
|
|
204
|
-
.then(
|
|
40
|
+
.then(result => {
|
|
205
41
|
const outcome = Number.isInteger(result)
|
|
206
42
|
? { planned: result, written: result, failed: 0, partial: false, partialReasons: [] }
|
|
207
43
|
: result;
|
|
@@ -223,22 +59,11 @@ function runCli(main, label) {
|
|
|
223
59
|
process.exitCode = 2;
|
|
224
60
|
}
|
|
225
61
|
})
|
|
226
|
-
.catch(
|
|
62
|
+
.catch(error => {
|
|
227
63
|
const message = error && error.message ? error.message : String(error);
|
|
228
64
|
console.error(`${label} failed: ${message}`);
|
|
229
65
|
process.exitCode = 1;
|
|
230
66
|
});
|
|
231
67
|
}
|
|
232
68
|
|
|
233
|
-
module.exports = {
|
|
234
|
-
ab,
|
|
235
|
-
sleep,
|
|
236
|
-
evalJSON,
|
|
237
|
-
evalJSONBase64,
|
|
238
|
-
buildAgentBrowserInvocation,
|
|
239
|
-
safeStr,
|
|
240
|
-
scrollLoad,
|
|
241
|
-
getArg,
|
|
242
|
-
localDateStamp,
|
|
243
|
-
runCli,
|
|
244
|
-
};
|
|
69
|
+
module.exports = { getArg, localDateStamp, runCli };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "fancy-scan-scrapers",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"lockfileVersion": 3,
|
|
5
|
-
"requires": true,
|
|
6
|
-
"packages": {
|
|
7
|
-
"node_modules/playwright-core": {
|
|
8
|
-
"version": "1.62.1",
|
|
9
|
-
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.62.1.tgz",
|
|
10
|
-
"integrity": "sha512-wPYSwEBJY9GHraISXqyqtx0na0LpO3XEX7jNDhntbex7tzUS7kLnZsOlFruFJB4Hi/rhDMjXGqHewDZ68nYZVw==",
|
|
11
|
-
"license": "Apache-2.0",
|
|
12
|
-
"bin": {
|
|
13
|
-
"playwright-core": "cli.js"
|
|
14
|
-
},
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=20"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Portions Copyright (c) Microsoft Corporation.
|
|
190
|
-
Portions Copyright 2017 Google Inc.
|
|
191
|
-
|
|
192
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
-
you may not use this file except in compliance with the License.
|
|
194
|
-
You may obtain a copy of the License at
|
|
195
|
-
|
|
196
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
-
|
|
198
|
-
Unless required by applicable law or agreed to in writing, software
|
|
199
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
-
See the License for the specific language governing permissions and
|
|
202
|
-
limitations under the License.
|
package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/ThirdPartyNotices.txt
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
microsoft/playwright-core
|
|
2
|
-
|
|
3
|
-
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
|
|
4
|
-
|
|
5
|
-
This package bundles third-party software inside individual files under
|
|
6
|
-
`lib/`. Each bundled output has a sidecar `<bundle>.js.LICENSE` file next
|
|
7
|
-
to it listing every npm package whose source was inlined into that
|
|
8
|
-
bundle, together with the full license text for each.
|
|
9
|
-
|
|
10
|
-
For example:
|
|
11
|
-
- lib/utilsBundle.js.LICENSE
|
|
12
|
-
|
|
13
|
-
This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
|
package/plugins/fancy-scan/scripts/scrapers/node_modules/playwright-core/bin/install_webkit_wsl.ps1
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
$ErrorActionPreference = 'Stop'
|
|
2
|
-
|
|
3
|
-
# This script sets up a WSL distribution that will be used to run WebKit.
|
|
4
|
-
|
|
5
|
-
$Distribution = "playwright"
|
|
6
|
-
$Username = "pwuser"
|
|
7
|
-
|
|
8
|
-
$distributions = (wsl --list --quiet) -split "\r?\n"
|
|
9
|
-
if ($distributions -contains $Distribution) {
|
|
10
|
-
Write-Host "WSL distribution '$Distribution' already exists. Skipping installation."
|
|
11
|
-
} else {
|
|
12
|
-
Write-Host "Installing new WSL distribution '$Distribution'..."
|
|
13
|
-
$VhdSize = "10GB"
|
|
14
|
-
wsl --install -d Ubuntu-24.04 --name $Distribution --no-launch --vhd-size $VhdSize
|
|
15
|
-
wsl -d $Distribution -u root adduser --gecos GECOS --disabled-password $Username
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
$pwshDirname = (Resolve-Path -Path $PSScriptRoot).Path;
|
|
19
|
-
$playwrightCoreRoot = Resolve-Path (Join-Path $pwshDirname "..")
|
|
20
|
-
|
|
21
|
-
$initScript = @"
|
|
22
|
-
if [ ! -f "/home/$Username/node/bin/node" ]; then
|
|
23
|
-
mkdir -p /home/$Username/node
|
|
24
|
-
curl -fsSL https://nodejs.org/dist/v22.17.0/node-v22.17.0-linux-x64.tar.xz -o /home/$Username/node/node-v22.17.0-linux-x64.tar.xz
|
|
25
|
-
tar -xJf /home/$Username/node/node-v22.17.0-linux-x64.tar.xz -C /home/$Username/node --strip-components=1
|
|
26
|
-
sudo -u $Username echo 'export PATH=/home/$Username/node/bin:\`$PATH' >> /home/$Username/.profile
|
|
27
|
-
fi
|
|
28
|
-
/home/$Username/node/bin/node cli.js install-deps webkit
|
|
29
|
-
sudo -u $Username PLAYWRIGHT_SKIP_BROWSER_GC=1 /home/$Username/node/bin/node cli.js install webkit
|
|
30
|
-
"@ -replace "\r\n", "`n"
|
|
31
|
-
|
|
32
|
-
wsl -d $Distribution --cd $playwrightCoreRoot -u root -- bash -c "$initScript"
|
|
33
|
-
Write-Host "Done!"
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -e
|
|
3
|
-
set -x
|
|
4
|
-
|
|
5
|
-
if [[ $(arch) == "aarch64" ]]; then
|
|
6
|
-
echo "ERROR: not supported on Linux Arm64"
|
|
7
|
-
exit 1
|
|
8
|
-
fi
|
|
9
|
-
|
|
10
|
-
if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
|
|
11
|
-
if [[ ! -f "/etc/os-release" ]]; then
|
|
12
|
-
echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
|
|
13
|
-
exit 1
|
|
14
|
-
fi
|
|
15
|
-
|
|
16
|
-
ID=$(bash -c 'source /etc/os-release && echo $ID')
|
|
17
|
-
if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
|
|
18
|
-
echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
|
|
19
|
-
exit 1
|
|
20
|
-
fi
|
|
21
|
-
fi
|
|
22
|
-
|
|
23
|
-
# 1. make sure to remove old beta if any.
|
|
24
|
-
if dpkg --get-selections | grep -q "^google-chrome-beta[[:space:]]*install$" >/dev/null; then
|
|
25
|
-
apt-get remove -y google-chrome-beta
|
|
26
|
-
fi
|
|
27
|
-
|
|
28
|
-
# 2. Update apt lists (needed to install curl and chrome dependencies)
|
|
29
|
-
apt-get update
|
|
30
|
-
|
|
31
|
-
# 3. Install curl to download chrome
|
|
32
|
-
if ! command -v curl >/dev/null; then
|
|
33
|
-
apt-get install -y curl
|
|
34
|
-
fi
|
|
35
|
-
|
|
36
|
-
# 4. download chrome beta from dl.google.com and install it.
|
|
37
|
-
cd /tmp
|
|
38
|
-
curl -L -O https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb
|
|
39
|
-
apt-get install -y ./google-chrome-beta_current_amd64.deb
|
|
40
|
-
rm -rf ./google-chrome-beta_current_amd64.deb
|
|
41
|
-
cd -
|
|
42
|
-
google-chrome-beta --version
|