diff --git a/docs/img/proxy/20240506152231.jpg b/docs/img/proxy/20240506152231.jpg new file mode 100644 index 00000000..d371c5a2 Binary files /dev/null and b/docs/img/proxy/20240506152231.jpg differ diff --git a/docs/img/proxy/20240506152439.jpg b/docs/img/proxy/20240506152439.jpg new file mode 100644 index 00000000..96fd14aa Binary files /dev/null and b/docs/img/proxy/20240506152439.jpg differ diff --git a/docs/img/proxy/20240506153328.jpg b/docs/img/proxy/20240506153328.jpg new file mode 100644 index 00000000..8e8a56c9 Binary files /dev/null and b/docs/img/proxy/20240506153328.jpg differ diff --git a/docs/img/proxy/20240506153438.jpg b/docs/img/proxy/20240506153438.jpg new file mode 100644 index 00000000..40cf4fca Binary files /dev/null and b/docs/img/proxy/20240506153438.jpg differ diff --git a/docs/img/proxy/20240506161632.jpg b/docs/img/proxy/20240506161632.jpg new file mode 100644 index 00000000..c32f8c55 Binary files /dev/null and b/docs/img/proxy/20240506161632.jpg differ diff --git a/docs/img/proxy/20240506162432.jpg b/docs/img/proxy/20240506162432.jpg new file mode 100644 index 00000000..783a2d13 Binary files /dev/null and b/docs/img/proxy/20240506162432.jpg differ diff --git a/docs/img/proxy/20240506162827.jpg b/docs/img/proxy/20240506162827.jpg new file mode 100644 index 00000000..2387c41b Binary files /dev/null and b/docs/img/proxy/20240506162827.jpg differ diff --git a/docs/img/proxy/20240506164443.jpg b/docs/img/proxy/20240506164443.jpg new file mode 100644 index 00000000..665b5569 Binary files /dev/null and b/docs/img/proxy/20240506164443.jpg differ diff --git a/docs/imgProxy.md b/docs/imgProxy.md index 5aeb949f..d5a9a0e9 100644 --- a/docs/imgProxy.md +++ b/docs/imgProxy.md @@ -75,8 +75,8 @@ addEventListener('fetch', event => { ![image](/img/proxy/197007874-ea036065-a833-4f97-b98b-29b8784132a7.png) - ### 测试 + * 这是Pixiv上的一条原图链接 https://i.pximg.net/img-original/img/2019/03/06/00/40/39/73532572_p0.jpg * 使用刚才配置的代理域名替换掉 `i.pximg.net` 得到链接 https://pixiv.gardencavy.site/img-original/img/2019/03/06/00/40/39/73532572_p0.jpg @@ -90,4 +90,94 @@ addEventListener('fetch', event => { ![image](/img/proxy/465829cd-f7d2-4d3a-a941-f8e820a9c5c4.png) -* 或者手动修改配置文件`Config目录`-->`Pixiv.yml`-->`OriginUrlProxy`,修改完毕后重启插件 \ No newline at end of file +* 或者手动修改配置文件`Config目录`-->`Pixiv.yml`-->`OriginUrlProxy`,修改完毕后重启插件 + +### **进阶** + +* 搭建一个手动点击后才开始加载图片的页面,降低域名被标记为红链的概率 + +![image](/img/proxy/20240506152231.jpg) + +![image](/img/proxy/20240506152439.jpg) + +![image](/img/proxy/20240506153328.jpg) + +![image](/img/proxy/20240506153438.jpg) + +![image](/img/proxy/20240506161632.jpg) + + +**index.js** +```js +import template from './template.html'; +export default { + async fetch(request, env) { + let url = request.url.replace('preview.gardencavy.site','pixiv.gardencavy.site'); + const body = template.replace('$URL',url); + return new Response(body, { + headers: { 'Content-Type': 'text/html' } + }); + } +}; +``` + +**template.html** +```html + + + + + + PixivPreview + + + + +
+ 点击加载
+
+ + + + +``` + +* 将Worker和域名绑定 + +![image](/img/proxy/20240506162432.jpg) + +![image](/img/proxy/20240506162827.jpg) + +* 最后和上面一样替换图片地址中的域名,测试一下这个Worker + +- https://preview.gardencavy.site/img-original/img/2019/03/06/00/40/39/73532572_p0.jpg + +- 如图所示,如果点击粉色区域图片能正常加载就代表搭建成功了 + +- 到目前为止就创建好两个代理了,**pixiv.gardencavy.site**(通过连接能直接返回图片),**preview.gardencavy.site**(手动点击后加载图片,防止tx侦测) + +- 最后需要做的是将新搭建的代理域名重新设置到后台中 + +![image](/img/proxy/20240506164443.jpg) + diff --git a/docs/install.md b/docs/install.md index b3893f55..c00b2020 100644 --- a/docs/install.md +++ b/docs/install.md @@ -1,57 +1,27 @@ -!> 注:本插件在依赖于机器人支持库下运行,所以你必须先运行 [Mirai](https://github.com/mamoe/mirai) 或 [GoCQHttp](https://github.com/Mrs4s/go-cqhttp),然后再同时运行本插件 +!> 注:本插件依赖于协议库下运行,所以你必须先运行机器人协议库,然后再同时运行本插件,由于协议库产生的任何问题都与作者本人无关 -?> 修改配置文件时,推荐你使用 [vscode](https://code.visualstudio.com) 或者 [nodepad++](https://github.com/notepad-plus-plus/notepad-plus-plus/releases) 等编辑器代替系统默认记事本,避免出现编码错误或者符号错漏等一系列问题 +?> 修改配置文件时,推荐你使用 [nodepad--](https://gitee.com/cxasm/notepad--/releases) 等编辑器代替系统默认记事本,避免出现编码错误或者符号错漏等一系列问题 ?> 不推荐你将文件解压到非英文目录和路径下,避免出现不必要的错误和问题 ## 安装数据库 数据库为Mysql,需要自行安装,推荐安装 [v8.0.31](https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-community-8.0.31.0.msi) 及以上,新手可以百度[mysql8.0免安装教程](https://www.baidu.com/s?wd=mysql8.0%E5%85%8D%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE%E6%95%99%E7%A8%8B) -## 安装机器人库 -在下面两个机器人库中选择一个安装,你可以两个都安装,但是同一时间只能运行其中一个,**推荐安装Mirai** +## 安装协议库 +在下面机器人协议库中选择一个安装,你可以全部都安装,但是同一时间只能运行其中一个 -- **安装Mirai(二选一):**参照 [mirai-console-loader](https://github.com/iTXTech/mirai-console-loader) 文档安装,参考 [mirai-api-http](https://github.com/project-mirai/mirai-api-http) 文档配置`mirai-api-http`插件,参考 [登录方案](https://mirai.mamoe.net/topic/223/%E6%97%A0%E6%B3%95%E7%99%BB%E5%BD%95%E7%9A%84%E4%B8%B4%E6%97%B6%E5%A4%84%E7%90%86%E6%96%B9%E6%A1%88) 登录Bot +- **安装LLOneBot(推荐):**参照 [LLOneBot](https://llonebot.github.io/zh-CN/guide/getting-started) 文档安装 -- **安装GoCQ(二选一):**参照 [go-cqhttp 帮助中心](https://docs.go-cqhttp.org/guide/quick_start.html#%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B) 进行安装,并配置bot账号密码。如果你需要使用私聊相关功能,记得把配置 `allow-temp-session` 设置为true +- ~~安装Mirai(不推荐):参照 [mirai-console-loader](https://github.com/iTXTech/mirai-console-loader) 文档安装,参考 [mirai-api-http](https://github.com/project-mirai/mirai-api-http) 文档配置`mirai-api-http`插件,参考 [登录方案](https://mirai.mamoe.net/topic/223/%E6%97%A0%E6%B3%95%E7%99%BB%E5%BD%95%E7%9A%84%E4%B8%B4%E6%97%B6%E5%A4%84%E7%90%86%E6%96%B9%E6%A1%88) 登录Bot~~ - -## 运行机器人库 - -Mirai正常启动结果如下 - -```bash -2023-08-05 22:54:25 I/UnidbgFetchQsign: Bot(123456789) initialize complete -2023-08-05 22:54:25 I/Bot.123456789: Saved account secrets to local cache for fast login. -2023-08-05 22:54:26 I/Bot.123456789: Login successful. -2023-08-05 22:54:26 V/Bot.123456789: Event: BotOnlineEvent(bot=Bot(123456789)) -2023-08-05 22:54:26 I/Bot.123456789: Bot login successful. -2023-08-05 22:54:26 V/Bot.123456789: Event: net.mamoe.mirai.console.events.AutoLoginEvent$Success@738a39cc -2023-08-05 22:54:26 I/main: mirai-console started successfully. -``` - -GoCQ正常启动结果如下 - -```bash -[2023-08-05 22:52:10] [INFO]: 登录成功 欢迎使用: 学园长 -[2023-08-05 22:52:10] [INFO]: 开始加载好友列表... -[2023-08-05 22:52:10] [INFO]: 共加载 3 个好友. -[2023-08-05 22:52:10] [INFO]: 开始加载群列表... -[2023-08-05 22:52:10] [INFO]: 收到服务器地址更新通知, 将在下一次重连时应用. -[2023-08-05 22:52:11] [INFO]: 共加载 3 个群. -[2023-08-05 22:52:11] [INFO]: 资源初始化完成, 开始处理信息. -[2023-08-05 22:52:11] [INFO]: アトリは、高性能ですから! -[2023-08-05 22:52:11] [INFO]: CQ WebSocket 服务器已启动: [::]:8100 -[2023-08-05 22:52:11] [INFO]: 正在检查更新. -[2023-08-05 22:52:11] [INFO]: 检查更新完成. 当前已运行最新版本. -[2023-08-05 22:52:11] [INFO]: 开始诊断网络情况 -[2023-08-05 22:52:13] [INFO]: 网络诊断完成. 未发现问题 -``` +- ~~安装GoCQ(不推荐):参照 [go-cqhttp 帮助中心](https://docs.go-cqhttp.org/guide/quick_start.html#%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B) 进行安装,并配置bot账号密码。如果你需要使用私聊相关功能,记得把配置 `allow-temp-session` 设置为true~~ ## 下载插件 从 [Releases](https://github.com/GardenHamster/Theresa3rd-Bot/releases) 中下载最新版本的`Theresa3rd-Bot.zip`压缩包,然后解压到某个英文 目录/路径 下,并不需要放到mcl目录下 -## 连接机器人库 +## 配置连接 修改根目录下的配置文件`appsettings.Production.json`,使本插件可以连接上相应的机器人库 + ```json { "Mirai": { //Mirai相关配置 @@ -60,9 +30,9 @@ GoCQ正常启动结果如下 "authKey": "theresa3rd", //mirai-api-http中配置的verifyKey "botQQ": "123456789" //mcl中登录的QQ号 }, - "GoCqHttp": { //GoCq相关配置 - "host": "127.0.0.1", //GoCq主机ip - "port": "8100" //GoCq中配置的port + "GoCqHttp": { //GoCq或LLOneBot相关配置 + "host": "127.0.0.1", //GoCq或LLOneBot主机ip + "port": "8100" //GoCq或LLOneBot中配置的port,LLOneBot默认是3001,其他OneBot协议库同理 }, "Database": { //Mysql数据库链接,确保能连上数据库以后,然后改成自己的 "ConnectionString": "Data Source=127.0.0.1;port=3306;Initial Catalog=theresa_bot;uid=root;pwd=123456;CharSet=utf8mb4;SslMode=None;" @@ -71,7 +41,7 @@ GoCQ正常启动结果如下 ``` ## Linux下部署 -1. 安装 ASP.NET Core 8.0 运行环境 +1. 安装 **NET Core 8.0** 运行时 ?> 这里以 CentOS7 为例,其他Linux版本请参考 [微软官方文档](https://learn.microsoft.com/zh-cn/dotnet/core/install/linux) @@ -95,7 +65,7 @@ yum update ca-certificates -y cd TheresaBot.MiraiHttpApi.dll所在目录 ``` -4. 后台运行dll,这里的端口为**前端页面端口**,可以随意填,但是不要使用 mirai-http-api 或 go-cqhttp 的端口 +4. 后台运行dll,这里的端口为 **前端页面端口**,可以随意填,**但是不要使用协议库的通信端口** - 使用Mirai @@ -103,19 +73,18 @@ cd TheresaBot.MiraiHttpApi.dll所在目录 nohup dotnet TheresaBot.MiraiHttpApi.dll --launch-profile Production --urls http://0.0.0.0:8088 ``` -- 使用GoCQ +- 使用GoCQ 或 LLOneBot ```bash nohup dotnet TheresaBot.GoCqHttp.dll --launch-profile Production --urls http://0.0.0.0:8088 ``` - ## Windows下部署 -1. 下载并安装 [ASP.NET Core Runtime 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0),推荐下载页面中的 [Hosting Bundle](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-8.0.0-windows-hosting-bundle-installer) +1. 下载并安装 [NET Core Runtime 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0),推荐下载页面中的 [Hosting Bundle](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-8.0.4-windows-hosting-bundle-installer) 2. 启动 powershell 并将路径切换到`TheresaBot.MiraiHttpApi.dll`所在目录下 -3. 运行dll,这里的端口为前端页面端口,可以随意填,但是不要使用 mirai-http-api 或 go-cqhttp 的端口 +3. 运行dll,这里的端口为 **前端页面端口**,可以随意填,**但是不要使用协议库的通信端口** - 使用Mirai @@ -123,7 +92,7 @@ nohup dotnet TheresaBot.GoCqHttp.dll --launch-profile Production --urls http://0 dotnet TheresaBot.MiraiHttpApi.dll --launch-profile Production --urls http://0.0.0.0:8088 ``` -- 使用GoCQ +- 使用GoCQ 或 LLOneBot ```powershell dotnet TheresaBot.GoCqHttp.dll --launch-profile Production --urls http://0.0.0.0:8088 @@ -140,7 +109,7 @@ dotnet TheresaBot.MiraiHttpApi.dll --launch-profile Production --urls http://0.0 pause ``` -- 使用GoCQ +- 使用GoCQ 或 LLOneBot ```powershell $host.ui.RawUI.WindowTitle="Theresa-Bot-GoCQHttp-8088" @@ -193,29 +162,29 @@ info: Microsoft.Hosting.Lifetime[0] ``` ## 配置Bot -- 访问插件启动后列出的后台地址,比如上面列出的地址:http://127.0.0.1:8088 +- 访问插件启动后列出的后台地址,比如:上面列出的地址:http://127.0.0.1:8088 -- 根据自己的需要修改配置,配置保存后将会立即生效 +- 根据自己的需要修改配置,通过后台修改配置的方式不需要重启插件 -- 你也可以手动修改[插件目录/Config]目录下的配置文件,但是这种方式修改后需要手动重启插件 +- 你也可以手动修改【插件目录/Config】下的配置文件,但是这种方式修改后需要手动重启插件 ## 开启VPN -Pixiv需要一个可以访问外网的环境,你需要自行购买机场。 +Pixiv 需要一个可以访问外网的网络环境,你需要自行购买机场节点。 -建议`Clash`等代理客户端选择`Rule`代理模式,节点选择`JP`节点。 +建议 `Clash` 等代理客户端选择 `Rule` 代理模式,节点选择 `JP` 节点。 -如果你的主机/服务器不在大陆范围内,可以不使用VPN,你也可以使用香港云服务器。 +如果你的【主机/服务器】不在大陆范围内,可以不使用VPN,你也可以使用港区或境外服务器。 ![image](/img/install/2023-05-08-02-31-47-624.jpg) -从v0.4.0版本开始加入了免代理,通过修改SNI的方式访问pixiv,然后通过pixiv.re代理下载图片。 +从v0.4.0版本开始加入了免代理,通过修改SNI的方式访问pixiv,然后通过配置文件中的图片代理下载图片。 你可以在配置中开启该功能,但不建议在有梯子的情况下启用它。 -最后在你运行这个插件的机器上登录[https://www.pixiv.net](https://www.pixiv.net),确保机器可以正常访问Pixiv +最后在你运行这个插件的机器上登录 [https://www.pixiv.net](https://www.pixiv.net),确保机器可以正常访问Pixiv ## 配置 cookie -- 如果想要正常使用pixiv相关功能,你需要为插件配置PixivCookie +- 如果想要正常使用pixiv相关功能,你需要为插件配置 Cookie - 参考 [cookie指令](cookie.md?id=pixiv-cookie) 配置pixiv cookie (主要) @@ -223,7 +192,7 @@ Pixiv需要一个可以访问外网的环境,你需要自行购买机场。 ## 更新版本的步骤 -1. 关掉正在运行的powershell脚本 +1. 关掉正在运行的 Powershell脚本 2. 替换掉除了以下以外的目录/文件 * `Config` @@ -232,6 +201,8 @@ Pixiv需要一个可以访问外网的环境,你需要自行购买机场。 3. 重启插件 +4. 如果新版本中有标注更新步骤,请根据发布说明升级版本,或者重新部署 + ## pixiv图片代理 * 配置文件中的默认代理`https://i.pixiv.re`被tx标记为危险链接,发送这类红链容易导致Bot被冻结/封号 diff --git a/docs/introduction.md b/docs/introduction.md index 8192e049..f7572f04 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -40,22 +40,6 @@ Github 仓库:https://github.com/GardenHamster/Theresa3rd-Bot MiraiForum:https://mirai.mamoe.net/topic/1364 -### 关于Mirai -![image](/img/introduction/20230323181856.jpg) - -Mirai 社区:https://mirai.mamoe.net - -Mirai 仓库:https://github.com/mamoe/mirai - -Mirai 登录方案:https://mirai.mamoe.net/topic/223 - -### 关于Go-CQHttp -![image](/img/introduction/20230805213410.jpg) - -GoCQ 仓库:https://github.com/Mrs4s/go-cqhttp - -GoCQ 文档:https://docs.go-cqhttp.org - ### 关于提问 **提问前请至少完整阅读一遍文档,文档范围内的问题不予解答,感谢配合** @@ -65,9 +49,9 @@ GoCQ 文档:https://docs.go-cqhttp.org ### 最后 -如果你也是一位正在打扫甲板,而且会空中劈叉的睿智清洁工,欢迎加入到我的官服舰团 `德丽莎3rd` +~~如果你也是一位正在打扫甲板,而且会空中劈叉的睿智清洁工,欢迎加入到我的官服舰团`德丽莎3rd`~~。别加了,团长已经爆金币了 -舰团群只聊游戏不聊开发,插件问题请移步到隔壁Bug反馈群 `284196625` +插件问题请移步到隔壁Bug反馈群 `284196625` ### **德丽莎世界第一可爱**