fix: 无限错误重传; chroe: 调低发知乎热榜的概率

This commit is contained in:
shanmite 2021-03-03 10:38:59 +08:00
parent e366c5bec2
commit 656b7e45e9
4 changed files with 10 additions and 3 deletions

View File

@ -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*`(简单的找规律问题)

View File

@ -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=

View File

@ -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}`);

View File

@ -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);
})