{"_id":"@chuanhezi/koishi-plugin-pixiv-repaired","_rev":"4-3eec172c35478e4673e207258983dc73","name":"@chuanhezi/koishi-plugin-pixiv-repaired","dist-tags":{"latest":"0.3.3"},"versions":{"0.3.0":{"name":"@chuanhezi/koishi-plugin-pixiv-repaired","version":"0.3.0","keywords":["chatbot","koishi","plugin","pixiv","setu","r18"],"license":"MIT","_id":"@chuanhezi/koishi-plugin-pixiv-repaired@0.3.0","maintainers":[{"name":"chuanhezi","email":"854546341@qq.com"}],"homepage":"https://github.com/chuanhezi/koishi-plugin-pixiv-repaired","bugs":{"url":"https://github.com/chuanhezi/koishi-plugin-pixiv-repaired/issues"},"dist":{"shasum":"30cc5f73ae2136704f3c35c2e1016957b8de80fc","tarball":"https://registry.npmjs.org/@chuanhezi/koishi-plugin-pixiv-repaired/-/koishi-plugin-pixiv-repaired-0.3.0.tgz","fileCount":17,"integrity":"sha512-6L8BNoD4wbpQzyXhgxDUuRfhkqIMsM39hvo2iYt9chnUgnS/72X7ykc4Avi0CH2XUtw2qcvU9pL2ju4PHn4FGg==","signatures":[{"sig":"MEQCIHe+bqOFsItyLRTymJs6CXFDjNkZuhJBMUSc8pF1iYUUAiAOWgJ+bgmdMfj1OKEUBa3OExJmV1lAaHdWf6YIfSHpjg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31572},"main":"lib/index.js","gitHead":"c6b2e5fa6d938ff8d601f6e1fed881db95d64806","typings":"lib/index.d.ts","_npmUser":{"name":"chuanhezi","email":"854546341@qq.com"},"repository":{"url":"git+https://github.com/chuanhezi/koishi-plugin-pixiv-repaired.git","type":"git"},"_npmVersion":"11.13.0","description":"pixiv插件增强版：支持随机涩图/R18涩图、discovery页面、浏览器代理下载图片","directories":{},"_nodeVersion":"24.16.0","dependencies":{"axios":"^1.7.7","@satorijs/element":"^3.1.7"},"_hasShrinkwrap":false,"peerDependencies":{"koishi":"^4.18.7","koishi-plugin-puppeteer":"^3.9.0"},"_npmOperationalInternal":{"tmp":"tmp/koishi-plugin-pixiv-repaired_0.3.0_1780835036772_0.939244878498317","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@chuanhezi/koishi-plugin-pixiv-repaired","version":"0.3.1","keywords":["chatbot","koishi","plugin","pixiv","setu","r18","涩图","pixiv-discovery"],"author":{"name":"chuanhezi"},"license":"MIT","_id":"@chuanhezi/koishi-plugin-pixiv-repaired@0.3.1","maintainers":[{"name":"chuanhezi","email":"854546341@qq.com"}],"contributors":[{"url":"https://github.com/QuanhuZeYu/koishi-plugin-pixiv","name":"QuanhuZeYu"}],"homepage":"https://github.com/chuanhezi/koishi-plugin-pixiv-repaired","bugs":{"url":"https://github.com/chuanhezi/koishi-plugin-pixiv-repaired/issues"},"dist":{"shasum":"5eee0a05fe3c1c178132fad7545a826cdb0bc284","tarball":"https://registry.npmjs.org/@chuanhezi/koishi-plugin-pixiv-repaired/-/koishi-plugin-pixiv-repaired-0.3.1.tgz","fileCount":17,"integrity":"sha512-cjrAL+xlg5UgrXgORe+alRkPrbkV6xNSsl95DSPwaX0d+rMYk9y2nO+86ukVvl4Z1zzzcSFATgM2Q8nKLtGlPQ==","signatures":[{"sig":"MEYCIQDpnGTfNzmeRFnmXtonUN96eOKaPxf3sJaIJ63ZafslgAIhAIhLHZj4swtWbvp0J2NO5hY+BKHbrMtQ5hVWDxdhzP+T","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36500},"main":"lib/index.js","pnpm":{"overrides":{}},"koishi":{"locales":["zh"],"service":{"required":["puppeteer"]},"description":{"en":"Enhanced Pixiv image plugin — random illustrations & R18 illustrations from Pixiv Discovery page, downloads images via browser proxy, no manual cookie required.","zh":"Pixiv 图片插件增强版 —— 支持随机涩图 & R18 涩图，从 Pixiv Discovery 页面随机获取推荐作品，通过浏览器代理下载图片，无需手动获取 Cookie。"}},"engines":{"node":">=16.0.0"},"gitHead":"731381ba83b380394171222c3513847155cab852","scripts":{"dev":"tsc --watch","build":"tsc","clean":"rm -rf lib","prepublishOnly":"npm run build"},"typings":"lib/index.d.ts","_npmUser":{"name":"chuanhezi","email":"854546341@qq.com"},"repository":{"url":"git+https://github.com/chuanhezi/koishi-plugin-pixiv-repaired.git","type":"git"},"_npmVersion":"11.13.0","description":"pixiv插件增强版：支持随机涩图/R18涩图、discovery页面随机推荐、浏览器代理下载图片，无需Cookie即可使用","directories":{},"_nodeVersion":"24.16.0","dependencies":{"axios":"^1.7.7","@satorijs/element":"^3.1.7"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"koishi":"^4.18.7","typescript":"^5.0.0","@types/node":"^20.0.0","koishi-plugin-puppeteer":"^3.9.0"},"peerDependencies":{"koishi":"^4.18.7","koishi-plugin-puppeteer":"^3.9.0"},"peerDependenciesMeta":{"koishi":{"optional":false},"koishi-plugin-puppeteer":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/koishi-plugin-pixiv-repaired_0.3.1_1780836836271_0.17485830150434567","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@chuanhezi/koishi-plugin-pixiv-repaired","version":"0.3.2","keywords":["chatbot","koishi","plugin","pixiv","setu","r18","涩图","pixiv-discovery"],"author":{"name":"chuanhezi"},"license":"MIT","_id":"@chuanhezi/koishi-plugin-pixiv-repaired@0.3.2","maintainers":[{"name":"chuanhezi","email":"854546341@qq.com"}],"contributors":[{"url":"https://github.com/QuanhuZeYu/koishi-plugin-pixiv","name":"QuanhuZeYu"}],"homepage":"https://github.com/chuanhezi/koishi-plugin-pixiv-repaired","bugs":{"url":"https://github.com/chuanhezi/koishi-plugin-pixiv-repaired/issues"},"dist":{"shasum":"048fc270c6596ec7aaf95f428a863cc7340144ad","tarball":"https://registry.npmjs.org/@chuanhezi/koishi-plugin-pixiv-repaired/-/koishi-plugin-pixiv-repaired-0.3.2.tgz","fileCount":17,"integrity":"sha512-eTdhq8b+F61cQwcsqLVY6EKrgqBof7uE+aBJpDOfyfOdNqJ4171zVi7BQMKssdmFUFE3F/0FFbJwgbSdbQc3uA==","signatures":[{"sig":"MEYCIQDNdpn/Tv4VaXnrnW5/I6+z4nngNaKfIo2dVLALIAH6iAIhAO3+YpO2w4/EwKhil1OXWbCleCTrd2sLjdii/+giQyjt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44918},"main":"lib/index.js","pnpm":{"overrides":{}},"koishi":{"locales":["zh"],"service":{"required":["puppeteer"]},"description":{"en":"Enhanced Pixiv image plugin — random illustrations & R18 illustrations from Pixiv Discovery page, downloads images via browser proxy, no manual cookie required.","zh":"Pixiv 图片插件增强版 —— 支持随机涩图 & R18 涩图，从 Pixiv Discovery 页面随机获取推荐作品，通过浏览器代理下载图片，无需手动获取 Cookie。"}},"source":"lib/index.js","engines":{"node":">=16.0.0"},"gitHead":"c8bca0786a588c7a05f0dd34bf929ce4d27114c5","scripts":{"test":"node --test test/*.test.js","build":"npm run check && npm test","check":"node --check lib/index.js","prepublishOnly":"npm run build"},"typings":"lib/index.d.ts","_npmUser":{"name":"chuanhezi","email":"854546341@qq.com"},"repository":{"url":"git+https://github.com/chuanhezi/koishi-plugin-pixiv-repaired.git","type":"git"},"_npmVersion":"11.13.0","description":"pixiv插件增强版：支持随机涩图/R18涩图、discovery页面随机推荐、浏览器代理下载图片，无需Cookie即可使用","directories":{},"_nodeVersion":"24.16.0","dependencies":{"axios":"^1.7.7","@satorijs/element":"^3.1.7"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"koishi":"^4.18.7","koishi-plugin-puppeteer":"^3.9.0"},"peerDependencies":{"koishi":"^4.18.7","koishi-plugin-puppeteer":"^3.9.0"},"peerDependenciesMeta":{"koishi":{"optional":false},"koishi-plugin-puppeteer":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/koishi-plugin-pixiv-repaired_0.3.2_1785144539965_0.077590134995837","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"name":"@chuanhezi/koishi-plugin-pixiv-repaired","description":"pixiv插件增强版：支持随机涩图/R18涩图、discovery页面随机推荐、浏览器代理下载图片，无需Cookie即可使用","version":"0.3.3","main":"lib/index.js","typings":"lib/index.d.ts","source":"lib/index.js","author":{"name":"chuanhezi"},"contributors":[{"name":"QuanhuZeYu","url":"https://github.com/QuanhuZeYu/koishi-plugin-pixiv"}],"homepage":"https://github.com/chuanhezi/koishi-plugin-pixiv-repaired","repository":{"type":"git","url":"git+https://github.com/chuanhezi/koishi-plugin-pixiv-repaired.git"},"license":"MIT","keywords":["chatbot","koishi","plugin","pixiv","setu","r18","涩图","pixiv-discovery"],"engines":{"node":">=16.0.0"},"koishi":{"description":{"zh":"Pixiv 图片插件增强版 —— 支持随机涩图 & R18 涩图，从 Pixiv Discovery 页面随机获取推荐作品，通过浏览器代理下载图片，无需手动获取 Cookie。","en":"Enhanced Pixiv image plugin — random illustrations & R18 illustrations from Pixiv Discovery page, downloads images via browser proxy, no manual cookie required."},"service":{"required":["puppeteer"]},"locales":["zh"]},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"scripts":{"check":"node --check lib/index.js","test":"node --test test/*.test.js","build":"npm run check && npm test","prepublishOnly":"npm run build"},"dependencies":{"axios":"^1.7.7","@satorijs/element":"^3.1.7"},"peerDependencies":{"koishi":"^4.18.7","koishi-plugin-puppeteer":"^3.9.0"},"peerDependenciesMeta":{"koishi":{"optional":false},"koishi-plugin-puppeteer":{"optional":false}},"devDependencies":{"koishi":"^4.18.7","koishi-plugin-puppeteer":"^3.9.0"},"pnpm":{"overrides":{}},"gitHead":"ec6fa6b4ed1097320bad7f76b4f67a84237804ca","_id":"@chuanhezi/koishi-plugin-pixiv-repaired@0.3.3","bugs":{"url":"https://github.com/chuanhezi/koishi-plugin-pixiv-repaired/issues"},"_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-4/iG6A5V/O1Ec36xmJ97GK+g+RhAqe/KaMDbVrC9gtu1Pf/DawgmSbe7f4yFF0yfo5XLSBtTNR7maMdKUFMKLg==","shasum":"7caa0683f33d17918e54459408ab6c55ea625102","tarball":"https://registry.npmjs.org/@chuanhezi/koishi-plugin-pixiv-repaired/-/koishi-plugin-pixiv-repaired-0.3.3.tgz","fileCount":17,"unpackedSize":47177,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBTGjMKbAFYo3q2rc2B3a1UpPBzrkI3ams656qhUSV3uAiAw8xkP2rpXUlHzh9u/koUhA7qDa5jvf/p0frfVgj1dFg=="}]},"_npmUser":{"name":"chuanhezi","email":"854546341@qq.com"},"directories":{},"maintainers":[{"name":"chuanhezi","email":"854546341@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/koishi-plugin-pixiv-repaired_0.3.3_1786182877255_0.3194929821013137"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-07T12:23:56.582Z","modified":"2026-08-08T09:54:37.569Z","0.3.0":"2026-06-07T12:23:56.906Z","0.3.1":"2026-06-07T12:53:56.437Z","0.3.2":"2026-07-27T09:29:00.098Z","0.3.3":"2026-08-08T09:54:37.420Z"},"bugs":{"url":"https://github.com/chuanhezi/koishi-plugin-pixiv-repaired/issues"},"author":{"name":"chuanhezi"},"license":"MIT","homepage":"https://github.com/chuanhezi/koishi-plugin-pixiv-repaired","keywords":["chatbot","koishi","plugin","pixiv","setu","r18","涩图","pixiv-discovery"],"repository":{"type":"git","url":"git+https://github.com/chuanhezi/koishi-plugin-pixiv-repaired.git"},"description":"pixiv插件增强版：支持随机涩图/R18涩图、discovery页面随机推荐、浏览器代理下载图片，无需Cookie即可使用","contributors":[{"name":"QuanhuZeYu","url":"https://github.com/QuanhuZeYu/koishi-plugin-pixiv"}],"maintainers":[{"name":"chuanhezi","email":"854546341@qq.com"}],"readme":"# @chuanhezi/koishi-plugin-pixiv-repaired\n\n[![npm](https://img.shields.io/npm/v/@chuanhezi/koishi-plugin-pixiv-repaired?style=flat-square)](https://www.npmjs.com/package/@chuanhezi/koishi-plugin-pixiv-repaired)\n\n> 基于 [@quanhuzeyu/koishi-plugin-pixiv](https://github.com/QuanhuZeYu/koishi-plugin-pixiv) v0.2.7（MIT License）修复增强版\n\nPixiv 图片插件增强版 —— 从 Pixiv Discovery 页面随机获取推荐作品，支持普通涩图和 R18 涩图，通过浏览器代理下载图片，**无需手动获取 Cookie**。\n\n## 特性\n\n- ✅ 无需手动配置 Cookie，基于浏览器已登录会话\n- ✅ 支持 Pixiv Discovery 推荐作品随机获取\n- ✅ 支持从 R18 Discovery 页面随机获取推荐作品（需开启 Pixiv R18 设置）\n- ✅ 图片通过浏览器网络栈下载，解决 `i.pximg.net` 直连超时问题\n- ✅ 自动展开「查看全部」按钮，获取多图作品的全部图片\n- ✅ 返回作品详细信息：标题、作者、标签、喜欢数、收藏数、浏览数\n- ✅ 使用插件专用页面，关闭插件或登录开关时自动清理\n\n## 依赖说明\n\n| 包名 | 类型 | 说明 |\n|------|------|------|\n| `koishi` (^4.18.7) | peerDependency | Koishi 机器人框架核心 |\n| `koishi-plugin-puppeteer` (^3.9.0) | peerDependency | 浏览器自动化服务，**必须启用** |\n| `axios` (^1.7.7) | dependency | HTTP 请求库（预检等辅助请求） |\n| `@satorijs/element` (^3.1.7) | dependency | Koishi 消息元素 JSX 运行时 |\n\n## 安装\n\n```bash\n# npm\nnpm install @chuanhezi/koishi-plugin-pixiv-repaired\n\n# 或通过 Koishi 插件市场搜索安装\n```\n\n## 配置\n\n### 前置步骤：Puppeteer 配置\n\n在 Koishi 插件市场安装并启用 `koishi-plugin-puppeteer`，然后在 puppeteer 插件设置中添加以下 args：\n\n| 参数 | 说明 |\n|------|------|\n| `--user-data-dir=/path/to/custom-profile-dir` | 持久化浏览器数据目录，用于保存 Pixiv 登录状态 |\n| `--proxy-server=127.0.0.1:<端口>` | 代理服务器（Pixiv 需要访问国外网络） |\n| `--no-sandbox` | 禁用沙箱（Linux 服务器必需） |\n\n> **强烈建议关闭 puppeteer 的无头模式。** 插件运行时会打开多个页面，无头模式下无法直观查看浏览器状态，可能不知不觉消耗大量内存。\n\n### 插件配置项\n\n#### 基本设置\n\n| 配置项 | 类型 | 默认值 | 说明 |\n|--------|------|--------|------|\n| `ensureLogin` | boolean | `false` | **登录状态开关。** 先在浏览器中打开 pixiv.net 并登录你的账号，登录成功后开启此开关。 |\n| `等待NAV超时时间` | number | `15000` | 页面加载与导航的超时时间（毫秒），范围 3000 ~ 60000。 |\n\n#### 高级设置（HTML 选择器）\n\n> ⚠️ 以下为 Pixiv 页面 DOM 元素选择器配置。Pixiv 页面结构变化时需同步更新。\n\n| 配置项 | 说明 |\n|--------|------|\n| `HTMLSelector.推荐作品URLs选择器` | Discovery 推荐页面的 JS 代码片段，提取作品缩略图 URL |\n| `HTMLSelector.R18排行URLs选择器` | R18 Discovery 页面的 JS 代码片段，提取推荐作品缩略图 URL |\n| `HTMLSelector.主图像查看全部按钮选择点击` | 点击「查看全部」按钮的 JS 代码，展开多图作品的全部图片 |\n| `HTMLSelector.主图像URLs选择器` | 作品详情页中原图 URL 的 JS 提取代码 |\n\n## 可用指令\n\n| 指令 | 说明 |\n|------|------|\n| `随机涩图` | 从 Pixiv Discovery 推荐作品中随机获取一张图片 |\n| `随机R18涩图` | 从 Pixiv R18 Discovery 页面随机获取推荐作品（需先在 Pixiv 设置中开启 R18 显示） |\n\n## 工作原理\n\n```\n用户发送指令 → 浏览器导航到 Pixiv Discovery 页面\n             → 等待页面图片加载\n             → 随机选取一个作品缩略图并点击\n             → 进入作品详情页，提取作品信息\n             → 点击「查看全部」展开所有图片\n             → 通过浏览器页面下载原图\n             → 将图片 + 作品信息发送到聊天窗口\n```\n\n本插件直接操作 Pixiv 网站（不使用反代站点），通过 puppeteer 控制浏览器自动完成整个流程。\n\n插件不会接管用户手动打开的空白页或 Pixiv 标签页。运行时会创建并复用一个专用页面，配置重载时重新认领该页面，关闭插件或关闭 `ensureLogin` 后自动移除请求监听器并关闭页面。\n\n## 开发与验证\n\n当前项目以 `lib/index.js` 作为唯一运行源码和 npm 入口，不需要额外生成构建产物。类型声明位于 `lib/index.d.ts`，修改公共配置或导出时应同步维护。\n\n```bash\nnpm run check\nnpm test\nnpm run build\n```\n\n`build` 会依次执行入口语法检查和不依赖真实 Pixiv 网络的回归测试。\n\n## 更新日志\n\n### v0.3.0\n\n- 重构：使用纯 JS 重写插件\n- 指令更新为 `随机涩图` / `随机R18涩图`\n- 完善 npm 配置项和依赖说明\n- 优化 Koishi 配置页面展示\n\n### v0.2.5\n\n- 修复大量逻辑错误\n- 新增获取作品信息功能\n- 修改插件引导文案\n\n### v0.1.23\n\n- 修复大量逻辑错误\n- 修复配置文件中 undefined 的错误\n\n### v0.1.19\n\n- 更新刷新逻辑，减少不必要的刷新频率\n\n### v0.1.14\n\n- 修复页面刷新逻辑\n- 网络较差时使用 try 循环重试\n\n### v0.1.12\n\n- 抽离选择器逻辑到配置文件\n\n### v0.1.11\n\n- 修改作品获取逻辑，提高图像获取成功率和速度\n\n### v0.1.4\n\n- 修复 puppeteer 重载时无法获取页面的问题\n- 支持重载 puppeteer 后保持正常运行\n\n### v0.1.3\n\n- 尝试支持无头模式运行\n- 初始化页面逻辑改为遍历当前浏览器所有页面\n\n## License\n\nMIT © [chuanhezi](https://github.com/chuanhezi)\n\n原始项目 [@quanhuzeyu/koishi-plugin-pixiv](https://github.com/QuanhuZeYu/koishi-plugin-pixiv) 同样基于 MIT License。\n","readmeFilename":"readme.md"}