当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
43 Star 741 Fork 101

Kokomi / Yunzai-Bot
暂停

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.puppeteerrc.cjs 895 Bytes
一键复制 编辑 原始数据 按行查看 历史
柠檬冲水 提交于 2023-06-19 01:09 . 适配pup20来兼容更多架构
const os = require("os");
const { existsSync } = require("fs");
const arch = os.arch();
let skipDownload = false;
let executablePath;
//win32 存在 Edge 优先选择
if (process.platform == "win32") {
if (
existsSync("C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe")
) {
skipDownload = true;
executablePath =
"C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe";
}
} else if (process.platform == "linux") {
//如果arm64架构跳过下载
if (arch == "arm64" || arch == "aarch64") {
skipDownload = true;
}
//不管什么架构,如果存在配置则跳过下载,且配置路径
if (existsSync("/usr/bin/chromium")) {
skipDownload = true;
executablePath = "/usr/bin/chromium";
}
}
/**
* @type {import("puppeteer").Configuration}
*/
module.exports = {
skipDownload,
executablePath,
};
NodeJS
1
https://gitee.com/yoimiya-kokomi/Yunzai-Bot.git
git@gitee.com:yoimiya-kokomi/Yunzai-Bot.git
yoimiya-kokomi
Yunzai-Bot
Yunzai-Bot
main

搜索帮助