diff --git a/README.md b/README.md index 28fdc36..d0129bf 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,11 @@ steps: run: | npm install npm start + - name: 'Upload dyid to artifact' + uses: actions/upload-artifact@v2 + with: + name: dyid.txt + path: lib/dyid.txt ``` 此时`Secrets`里就可以添加更多的`COOKIE*`(简单的找规律问题) diff --git a/env.example.bat b/env.example.bat index 4ba8454..dcad5cc 100644 --- a/env.example.bat +++ b/env.example.bat @@ -6,11 +6,11 @@ @REM 使用时先将本文件名改成env.bat @REM 填入相应的值 @REM 需注意 % 要转义为 %% -@REM npm install +@REM npm install 安装依赖 @REM npm run test_start 启动脚本 @REM npm run test_check 检查是否中奖(只查看两个小时内的奖) @REM npm run test_clear 清空动态和关注 -@REM 运行成功后在lib文件夹下会生成一个GlobalVar.json文件 +@REM 运行成功后在lib文件夹下会生成一个GlobalVar.json文件和dyid.txt文件 @REM 换参数时须先将GlobalVar.json文件删除 @REM 如果要运行多账号只能复制本项目并依次独立运行 set COOKIE= diff --git a/lib/HttpRequest.js b/lib/HttpRequest.js index 5cc8691..deb2dfd 100644 --- a/lib/HttpRequest.js +++ b/lib/HttpRequest.js @@ -107,6 +107,7 @@ function HttpRequest(detail) { if (retry && retry_times--) { console.log(`[不期待响应]原因:${err.message} 尝试重新请求中...`); await delay(wait); + detail.config.retry_times = retry_times; HttpRequest(detail); } else { failure(`[响应错误]${err.message} 响应数据:\n${protodata}`) @@ -125,6 +126,7 @@ function HttpRequest(detail) { if (retry && retry_times--) { console.log(`[请求失败]原因:${err.message} 尝试重新连接中...`); await delay(wait); + detail.config.retry_times = retry_times; HttpRequest(detail); } else { failure(`[请求失败]: ${err.message}`); diff --git a/lib/lottery-in-nodejs.js b/lib/lottery-in-nodejs.js index febba37..cae681f 100644 --- a/lib/lottery-in-nodejs.js +++ b/lib/lottery-in-nodejs.js @@ -66,7 +66,7 @@ function start() { function createRandomDynamic() { Public.prototype.checkAllDynamic(GlobalVar.myUID, 1).then(Dynamic => { if (Dynamic.allModifyDynamicResArray[0].type === 1) { - if (Date.now() % 2) { + if (Date.now() % 11) { Base.getHiToKoTo().then(sentence => { BiliAPI.createDynamic(sentence); })