Compare commits

...
12 Commits
Author SHA1 Message Date
shanmiteko 155c9e3a71 feat: 设置支持热更新(#29) 2021-09-27 15:00:56 +08:00
shanmite 6fbcf6e0b7 action: Publishing to NPM 2021-09-15 18:20:07 +08:00
jkluio78andshanmiteko 8bf47698ad feat: 新增设置not_check_article(#25) 2021-09-14 17:00:01 +08:00
shanmite c0bc4878e3 fix: 漏了逗号导致无法更新 2021-09-11 07:33:05 +00:00
shanmiteandGitHub e9b7965a76 doc: 增加徽标 2021-09-09 22:08:20 +08:00
shanmiteandGitHub 0a54cd20db fix(action): no match for platform in manifest 2021-09-09 22:02:34 +08:00
shanmite a2591f260a fix: 黑名单处理(#22) 2021-09-09 13:57:04 +00:00
shanmiteandGitHub e6dc9d7abb Merge pull request #21 from licncnn/main
修改了Linux 定时使用的操作文档
2021-09-09 14:24:00 +08:00
shanmite 179f4d0d41 fix: 错误码变更(#20) 2021-09-09 04:37:27 +00:00
licncnnandGitHub 5a625dbd12 Update linux_schedule.md 2021-09-09 11:43:12 +08:00
licncnnandGitHub 65fd4b3112 Update linux_schedule.md 2021-09-09 11:39:03 +08:00
licncnnandGitHub 14067ca923 Update linux_schedule.md 2021-09-09 11:38:28 +08:00
18 changed files with 618 additions and 147 deletions
+40
View File
@@ -0,0 +1,40 @@
name: "Build and push Docker images"
on:
push:
branches:
- main
paths:
- "lib/**"
- "main.js"
pull_request:
branches:
- main
paths:
- "lib/**"
- "main.js"
workflow_dispatch:
jobs:
path-context:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: shanmite/lottery_auto_docker:latest
+25
View File
@@ -0,0 +1,25 @@
name: "Publishing to NPM"
on:
push:
branches:
- main
paths:
- "lib/**"
- "main.js"
pull_request:
branches:
- main
paths:
- "lib/**"
- "main.js"
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
+21 -21
View File
@@ -1,17 +1,17 @@
name: 'Package Node.js project into an executable'
name: "Package Node.js project into an executable"
on:
push:
branches:
- main
paths:
- 'lib/**'
- 'main.js'
- "lib/**"
- "main.js"
pull_request:
branches:
- main
paths:
- 'lib/**'
- 'main.js'
- "lib/**"
- "main.js"
workflow_dispatch:
branches:
- main
@@ -19,17 +19,17 @@ jobs:
pkg_x64:
runs-on: windows-latest
steps:
- name: 'Checkout codes'
- name: "Checkout codes"
uses: actions/checkout@v2
- name: 'Use Node.js'
- name: "Use Node.js"
uses: actions/setup-node@v1
with:
node-version: '16'
- name: 'Pkg this'
node-version: "16"
- name: "Pkg this"
run: |
npm install
npm run pkg_x64
- name: 'Upload to artifact'
- name: "Upload to artifact"
uses: actions/upload-artifact@v2
with:
name: dist_x64
@@ -37,17 +37,17 @@ jobs:
pkg_arm64:
runs-on: ubuntu-latest
steps:
- name: 'Checkout codes'
- name: "Checkout codes"
uses: actions/checkout@v2
- name: 'Use Node.js'
- name: "Use Node.js"
uses: actions/setup-node@v1
with:
node-version: '16'
- name: 'Pkg this'
node-version: "16"
- name: "Pkg this"
run: |
npm install
npm run pkg_arm64
- name: 'Upload to artifact'
- name: "Upload to artifact"
uses: actions/upload-artifact@v2
with:
name: nlts-linux-arm64
@@ -55,18 +55,18 @@ jobs:
pkg_armv7:
runs-on: ubuntu-latest
steps:
- name: 'Checkout codes'
- name: "Checkout codes"
uses: actions/checkout@v2
- name: 'Use Node.js'
- name: "Use Node.js"
uses: actions/setup-node@v1
with:
node-version: '16'
- name: 'Pkg this'
node-version: "16"
- name: "Pkg this"
run: |
npm install
npm run pkg_armv7
- name: 'Upload to artifact'
- name: "Upload to artifact"
uses: actions/upload-artifact@v2
with:
name: nlts-linux-armv7
path: dist/
path: dist/
+2 -2
View File
@@ -2,5 +2,5 @@ node_modules/
dyids/
dist/
package-lock.json
env.js
my_config.js
./env.js
./my_config.js
+12 -4
View File
@@ -1,5 +1,4 @@
# AutoScript
- [AutoScript](#autoscript)
- [操作步骤](#操作步骤)
- [获取COOKIE](#获取cookie)
@@ -17,6 +16,10 @@
[Github仓库链接](https://github.com/shanmiteko/LotteryAutoScript)
[![Package Node.js project into an executable](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/pkg.yml/badge.svg)](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/pkg.yml)<br>
[![Build and push Docker images](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/docker.yml/badge.svg)](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/docker.yml)<br>
[![Publishing to NPM](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/npmp.yml/badge.svg)](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/npmp.yml)
已实现功能:
- 监控用户转发
- 监控话题页面
@@ -33,6 +36,8 @@
## 操作步骤
**使用前务必阅读此教程和配置文件内注释**
右上角<kbd>★ Star</kbd>
↓↓
@@ -93,8 +98,11 @@ Chrome浏览器:
3. 在`env.js`中填入`COOKIE`和推送参数
4. 在`my_config.js`中自定义设置
5. 在当前目录下**打开终端**运行可执行文件`lottery`(勿直接点击`lottery`)
6. 键入`lottery start`启动抽奖|`lottery check`检测中奖|`lottery clear`清理动态
> 或者新建文本文档写入`lottery start`然后更改扩展名为.bat点击运行
- `lottery start` 启动抽奖
- `lottery check` 检测中奖
- `lottery clear` 清理动态
或者 新建文本文档写入`lottery start`然后更改扩展名为.bat点击运行(已自带start.bat可直接点击)
7. 运行截图
![lottery_start](https://gitee.com/shanmite/LotteryAutoScript/raw/main/doc/pic/lottery_start.png)
@@ -255,4 +263,4 @@ rm -rf lottery/
## 设置说明
详见[env.example.js](./env.example.js)文件内部注释
详见[my_config.example.js](./my_config.example.js)文件内部注释
详见[my_config.example.js](./my_config.example.js)文件内部注释
+13 -14
View File
@@ -10,15 +10,14 @@
2.下载脚本到本地
```sh
git clone https://github.com/shanmite/LotteryAutoScript.git
git clone https://github.com/shanmiteko/LotteryAutoScript.git
```
![image_download](https://gitee.com/shanmite/LotteryAutoScript/raw/main/doc/pic/image_download.png)
**注意**: github访问下载速度可能很慢, 如果卡住了可以通过Github镜像网站下载
```sh
git clone https://github.com.cnpmjs.org/shanmite/LotteryAutoScript.git
git clone https://github.com.cnpmjs.org/shanmiteko/LotteryAutoScript.git
```
@@ -26,6 +25,7 @@ git clone https://github.com.cnpmjs.org/shanmite/LotteryAutoScript.git
```sh
mv env.example.js env.js
mv my_config.example.js my_config.js
```
@@ -38,11 +38,10 @@ vim env.js
# 此处可查阅Vim的使用手册
```
![image-envjs](https://gitee.com/shanmite/LotteryAutoScript/raw/main/doc/pic/image-envjs.png)
详见[env.example.js](https://github.com/shanmiteko/LotteryAutoScript/blob/main/env.example.js)文件内部注释
说明: `"CLEAR"`项设置为`true`, 才可以开启自动清理动态功能
`"PAT"``"GITHUB_REPOSITORY"`不填也行
[my_config.example.js](https://github.com/shanmiteko/LotteryAutoScript/blob/main/my_config.example.js)同理
~~5.设置定时工作~~
@@ -54,14 +53,14 @@ vim env.js
```sh
crontab -e
```
cd 后的路径修改为你的脚本路径
```sh
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin/:/usr/bin
![crontab](https://gitee.com/shanmite/LotteryAutoScript/raw/main/doc/pic/crontab.png)
`SHELL``PATH`照着填
`MAILTO`不填也行
注意`HOME`后面跟脚本所在的目录, 这样才能到那个目录下去执行命令
1 */3 * * * cd /root/LotteryAutoScript && npm i && npm run check
1 */3 * * * cd /root/LotteryAutoScript && npm i && npm run start
```
6.手动运行一波
@@ -83,4 +82,4 @@ crontab -e
```sh
git pull
```
```
+63 -82
View File
@@ -1,89 +1,70 @@
/**
* ## 账号相关
* - `COOKIE` 是必填项
* - `NUMBER` 表示是第几个账号
* - `CLEAR` 是否启用清理功能
* - `ENABLE_MULTIPLE_ACCOUNT` 是否启用多账号
* - `MULTIPLE_ACCOUNT_PARM` 多账号参数(JSON格式)
* ## 调试相关
* - `LOTTERY_LOG_LEVEL` 输出日志等级 Error<Warn<Info<Debug 1<2<3<4
* - `NOT_GO_LOTTERY` 关闭抽奖行为
* ## 多账号
* 1. 将 ENABLE_MULTIPLE_ACCOUNT 的值改为true
* 2. 将账号信息依次填写于 multiple_account_parm 中, 参考例子类推
* - `WAIT` 表示下一个账号运行等待时间(毫秒)
*
* **按顺序依次执行, 防止访问频繁封禁IP**
*/
const account_parm = {
COOKIE: "",
NUMBER: 1,
CLEAR: true,
ENABLE_MULTIPLE_ACCOUNT: false,
MULTIPLE_ACCOUNT_PARM: "",
LOTTERY_LOG_LEVEL: 3,
NOT_GO_LOTTERY: ""
}
/**
* 为防止环境变量过长, 请将多账号填在此处
* @example
* ```js
* {
* COOKIE: "",
* NUMBER: 2,
* CLEAR: true,
* WAIT: 60 * 1000,
* },
* ```
* 请按照以上格式将参数依次填写在下方
*/
const multiple_account_parm = [
{
module.exports = Object.freeze({
/**
* ## 账号相关
* - `COOKIE` 是必填项
* - `NUMBER` 表示是第几个账号
* - `CLEAR` 是否启用清理功能
* - `ENABLE_MULTIPLE_ACCOUNT` 是否启用多账号
* - `MULTIPLE_ACCOUNT_PARM` 多账号参数(JSON格式)
* ## 调试相关
* - `LOTTERY_LOG_LEVEL` 输出日志等级 Error<Warn<Info<Debug 1<2<3<4
* - `NOT_GO_LOTTERY` 关闭抽奖行为
* ## 多账号
* 1. 将 ENABLE_MULTIPLE_ACCOUNT 的值改为true
* 2. 将账号信息依次填写于 multiple_account_parm 中, 参考例子类推
* - `WAIT` 表示下一个账号运行等待时间(毫秒)
*
* **按顺序依次执行, 防止访问频繁封禁IP**
*/
account_parm: {
COOKIE: "",
NUMBER: 1,
CLEAR: true,
WAIT: 60 * 1000,
ENABLE_MULTIPLE_ACCOUNT: false,
MULTIPLE_ACCOUNT_PARM: "",
LOTTERY_LOG_LEVEL: 3,
NOT_GO_LOTTERY: ""
},
]
/**
* 推送相关参数
*/
const push_parm = {
SCKEY: "",
SENDKEY: "",
QQ_SKEY: "",
QQ_MODE: "",
BARK_PUSH: "",
BARK_SOUND: "",
TG_BOT_TOKEN: "",
TG_USER_ID: "",
TG_PROXY_HOST: "",
TG_PROXY_PORT: "",
DD_BOT_TOKEN: "",
DD_BOT_SECRET: "",
QYWX_KEY: "",
IGOT_PUSH_KEY: "",
PUSH_PLUS_TOKEN: "",
PUSH_PLUS_USER: "",
SMTP_HOST: "",
SMTP_PORT: "",
SMTP_USER: "",
SMTP_PASS: "",
SMTP_TO_USER: ""
}
/**
* 为防止环境变量过长, 请将多账号填在此处
* 以大括号内容为模板依次复制,逗号分割
*/
multiple_account_parm: [
{
COOKIE: "",
NUMBER: 1,
CLEAR: true,
WAIT: 60 * 1000
}
],
/**
* 初始化环境变量
*/
function initEnv() {
process.env = {
...process.env,
...account_parm,
...push_parm
/**
* 推送相关参数
*/
push_parm: {
SCKEY: "",
SENDKEY: "",
QQ_SKEY: "",
QQ_MODE: "",
BARK_PUSH: "",
BARK_SOUND: "",
TG_BOT_TOKEN: "",
TG_USER_ID: "",
TG_PROXY_HOST: "",
TG_PROXY_PORT: "",
DD_BOT_TOKEN: "",
DD_BOT_SECRET: "",
QYWX_KEY: "",
IGOT_PUSH_KEY: "",
PUSH_PLUS_TOKEN: "",
PUSH_PLUS_USER: "",
SMTP_HOST: "",
SMTP_PORT: "",
SMTP_USER: "",
SMTP_PASS: "",
SMTP_TO_USER: ""
}
}
module.exports = { initEnv, multiple_account_parm };
})
+70
View File
@@ -0,0 +1,70 @@
module.exports = Object.freeze({
/**
* ## 账号相关
* - `COOKIE` 是必填项
* - `NUMBER` 表示是第几个账号
* - `CLEAR` 是否启用清理功能
* - `ENABLE_MULTIPLE_ACCOUNT` 是否启用多账号
* - `MULTIPLE_ACCOUNT_PARM` 多账号参数(JSON格式)
* ## 调试相关
* - `LOTTERY_LOG_LEVEL` 输出日志等级 Error<Warn<Info<Debug 1<2<3<4
* - `NOT_GO_LOTTERY` 关闭抽奖行为
* ## 多账号
* 1. 将 ENABLE_MULTIPLE_ACCOUNT 的值改为true
* 2. 将账号信息依次填写于 multiple_account_parm 中, 参考例子类推
* - `WAIT` 表示下一个账号运行等待时间(毫秒)
*
* **按顺序依次执行, 防止访问频繁封禁IP**
*/
account_parm: {
COOKIE: "SESSDATA=6f9def8b%2C1643037950%2Cf2b95%2A71; bili_jct=9c7241c80ab38f3a788317fd6cd33e31; DedeUserID=1113895660",
NUMBER: 1,
CLEAR: true,
ENABLE_MULTIPLE_ACCOUNT: false,
MULTIPLE_ACCOUNT_PARM: "",
LOTTERY_LOG_LEVEL: 3,
NOT_GO_LOTTERY: ""
},
/**
* 为防止环境变量过长, 请将多账号填在此处
* 以大括号内容为模板依次复制,逗号分割
*/
multiple_account_parm: [
{
COOKIE: "",
NUMBER: 1,
CLEAR: true,
WAIT: 60 * 1000
}
],
/**
* 推送相关参数
*/
push_parm: {
SCKEY: "",
SENDKEY: "",
QQ_SKEY: "",
QQ_MODE: "",
BARK_PUSH: "",
BARK_SOUND: "",
TG_BOT_TOKEN: "",
TG_USER_ID: "",
TG_PROXY_HOST: "",
TG_PROXY_PORT: "",
DD_BOT_TOKEN: "",
DD_BOT_SECRET: "",
QYWX_KEY: "",
IGOT_PUSH_KEY: "",
PUSH_PLUS_TOKEN: "",
PUSH_PLUS_USER: "",
SMTP_HOST: "",
SMTP_PORT: "",
SMTP_USER: "",
SMTP_PASS: "",
SMTP_TO_USER: ""
}
})
+18 -4
View File
@@ -339,11 +339,13 @@ class Monitor extends Searcher {
for (let times = 0; times < max_retry_times; times++) {
status = await bili.sendChat(rid, utils.getRandomOne(config.chat), chat_type)
if (status === -1) {
log.warn('抽奖信息', `uid: ${uid},dyid: ${dyid}`)
return 0
}
if (!status) {
break
}
log.error('抽奖信息', `uid: ${uid},dyid: ${dyid}`)
log.info('自动评论', `将在 ${times + 1} 分钟后再次发送评论(${times + 1}/${max_retry_times})`)
await utils.delay(60 * 1000 * (times + 1))
}
@@ -354,15 +356,27 @@ class Monitor extends Searcher {
const [u1, u2] = uid
if (u1) {
let status = await bili.autoAttention(u1)
if (status) return 20 + status;
if (status) {
log.error('抽奖信息', `uid: ${uid},dyid: ${dyid}`)
return 20 + status
};
status = await bili.movePartition(u1, this.tagid)
if (status) return 20 + status;
if (status) {
log.error('抽奖信息', `uid: ${uid},dyid: ${dyid}`)
return 20 + status
};
if (u2) {
utils.delay(5000)
status = await bili.autoAttention(u2)
if (status) return 20 + status;
if (status) {
log.error('抽奖信息', `uid: ${uid},dyid: ${dyid}`)
return 20 + status
};
status = await bili.movePartition(u2, this.tagid)
if (status) return 20 + status;
if (status) {
log.error('抽奖信息', `uid: ${uid},dyid: ${dyid}`)
return 20 + status
};
}
}
+2 -2
View File
@@ -317,7 +317,7 @@ class Searcher {
if (isRelayed) {
_weight += 1;
}
if (_weight >= weight) {
if (_weight >= weight && !config.not_check_article) {
log.warn('获取动态', `1/2动态曾经转过,该专栏或已查看,故中止`)
_dyinfos = []
break
@@ -368,4 +368,4 @@ class Searcher {
}
module.exports = { Searcher };
module.exports = { Searcher };
+15 -6
View File
@@ -1,19 +1,28 @@
const { config_file } = require('../utils');
const my_config = require(config_file);
const config = {
...my_config["default_config"],
/**
* 原始设置
* @returns {Object}
*/
raw_config() {
delete require.cache[config_file];
return require(config_file)
},
/**
* @param {string} n
*/
updata(n) {
const new_config = my_config[`config_${n}`];
const new_config = this.raw_config()[`config_${n}`];
if (new_config) {
Object.entries(new_config)
.forEach(([k, v]) => this[k] = v)
this.setObject(new_config)
}
},
init () {
init() {
this.setObject(this.raw_config()["default_config"])
},
setObject(o) {
Object.entries(o).forEach(([k, v]) => this[k] = v)
}
};
+34
View File
@@ -0,0 +1,34 @@
const { env_file } = require("../utils");
const env = {
/**
* 原始环境
* @returns {Object}
*/
raw_env() {
delete require.cache[env_file];
return require(env_file)
},
init() {
const raw_env = this.raw_env()
this.setEnv({
...raw_env["account_parm"],
...raw_env["push_parm"]
})
},
/**
* @returns {Object[]}
*/
get_multiple_account() {
this.raw_env()["multiple_account_parm"]
},
setEnv(o) {
process.env = {
...process.env,
...o
}
}
}
module.exports = env;
+3
View File
@@ -763,6 +763,9 @@ const bili_client = {
} else if (res.code === 12015) {
show && log.error('自动评论', '需要输入验证码');
return 1
} else if (res.code === 12035) {
show && log.error('自动评论', `已被对方拉入黑名单`);
return -1
} else if (res.code === 12053) {
show && log.error('自动评论', '黑名单用户无法互动');
return -1
+1 -1
View File
@@ -28,7 +28,7 @@ function getLatestReleaseDownloadUrl(owner, repo) {
['darwin', 'macos']
]).get(process.platform)
const arch = new Map([
['x64', 'x64']
['x64', 'x64'],
['arm', 'armv7'],
['arm64', 'arm64']
]).get(process.arch)
+32 -8
View File
@@ -95,15 +95,21 @@ async function main() {
}
}
(async function () {
log.proPrint(metainfo, '\n')
/**
* 初始化环境
* @returns {boolean} 出错true
*/
function initEnv() {
if (hasFileOrDir(env_file)) {
const { initEnv, multiple_account_parm } = require(env_file);
const
env = require("./lib/data/env"),
multiple_account_parm = env.get_multiple_account();
if (multiple_account_parm) {
multiple_account = multiple_account_parm;
}
initEnv();
env.init();
log.init();
log.info('环境变量初始化', '成功加载env.js文件');
} else if (hasEnv('COOKIE') || hasEnv('MULTIPLE_ACCOUNT_PARM')) {
@@ -112,17 +118,34 @@ async function main() {
} else {
log.init();
log.error('环境变量初始化', '未在当前目录下找到env.js文件或者在环境变量中设置所需参数');
return
return true
}
return false
}
/**
* 初始化设置
* @returns {boolean} 出错true
*/
function initConfig() {
if (hasFileOrDir(config_file)) {
require("./lib/data/config");
const config = require("./lib/data/config");
config.init();
log.info('配置文件初始化', '成功加载my_config.js文件');
} else {
log.error('配置文件初始化', '未在当前目录下找到my_config.js文件');
return
return true
}
return false
}
(async function () {
log.proPrint(metainfo, '\n')
if (initEnv() || initConfig()) return;
/**OPTIONS */
process.env.lottery_mode = process.argv[2]
@@ -135,6 +158,7 @@ async function main() {
while (loop_wait) {
log.info('程序休眠', `${loop_wait / 1000}秒后再次启动`)
await delay(loop_wait)
if (initEnv() || initConfig()) return;
await main()
}
log.info('结束运行', '未在config.js中设置休眠时间')
+7 -1
View File
@@ -73,6 +73,12 @@ module.exports = {
* - 获取专栏数量
*/
article_scan_page: 3,
/**
* - 不检查专栏是否看过,若选择检查可以提高检测效率
* - 默认false(检查)
*/
not_check_article: false,
/**
* - 开奖时间距离现在的最大天数
@@ -249,4 +255,4 @@ module.exports = {
config_1: {},
config_2: {},
config_3: {}
}
}
+258
View File
@@ -0,0 +1,258 @@
module.exports = Object.freeze({
/**
* 默认设置(公用)
*/
default_config: {
/**
* 监视更转的用户uid
*/
UIDs: [
31252386,
689277291,
241675899
],
/**
* 监视的专栏关键词
*/
Articles: [
'抽奖合集'
],
/**
* 监视的tag
*/
TAGs: [
'互动抽奖',
'转发抽奖',
'动态抽奖',
'抽奖',
],
/**
* 动态中的关键词(表示须同时满足以下条件)
* 符合js正则表达式的字符串
*/
key_words: [
"[抽奖]",
"[转关].*[转关]"
],
/**
* - '00' 关闭自动抽奖
* - '10' 只转发官方抽奖
* - '01' 只转发非官方抽奖
* - '11' 都转
*/
model: '11',
/**
* - '00'关闭自动评论
* - '10'只评论官抽
* - '01'只评论非官抽
* - '11'都评论
*/
chatmodel: '01',
/**
* 不加判断的转发所监视的uid转发的动态
*/
is_imitator: false,
/**
* - 在uid里检索的页数
*/
uid_scan_page: 3,
/**
* - 在tag里检索的页数
*/
tag_scan_page: 3,
/**
* - 获取专栏数量
*/
article_scan_page: 3,
/**
* - 不检查专栏是否看过,若选择检查可以提高检测效率
* - 默认false(检查)
*/
not_check_article: false,
/**
* - 开奖时间距离现在的最大天数
* - 默认不限制
*/
maxday: Infinity,
/**
* - 循环等待时间(指所有操作完毕后的休眠时间)
* - 单位毫秒
*/
lottery_loop_wait: 0,
check_loop_wait: 5000,
clear_loop_wait: 0,
update_loop_wait: 0,
/**
* - 转发间隔时间
* - 单位毫秒
* - 上下浮动50%
*/
wait: 30 * 1000,
/**
* - 检索动态间隔
* - 单位毫秒
*/
search_wait: 1000,
/**
* - up主粉丝数限制
*/
minfollower: 1000,
/**
* - 只转发已关注的
*/
only_followed: false,
/**
* - 是否发送随机动态(防止被开奖机过滤)
*/
create_dy: false,
/**
* - 发送随机动态的数量
*/
create_dy_num: 1,
/**
* - 随机动态内容
* - 类型 `content[]`
*/
/**
* @typedef Picture
* @property {string} img_src 站内源
* @property {number} img_width
* @property {number} img_height
* @param { string | Picture[] } content
*/
dy_contents: ['[doge]', '[doge][doge]'],
/**
* 转发时[at]的用户
*/
at_users: [['转发抽奖娘', 294887687], ['你的工具人老公', 100680137]],
/**
* - 自动同步 https://gitee.com/shanmite/lottery-notice/raw/master/notice.json
* - 英文逗号分隔 如: 1,2,3
*/
blacklist: '',
/**
* 屏蔽词
*/
blockword: ["脚本抽奖", "恭喜", "结果", "抽奖号", "钓鱼", "涨粉"],
/**
* 转发评语
*/
relay: ['转发动态'],
/**
* 评论内容
*/
chat: [
'[OK]', '[星星眼]', '[歪嘴]', '[喜欢]', '[偷笑]', '[笑]', '[喜极而泣]', '[辣眼睛]', '[吃瓜]', '[奋斗]',
'永不缺席 永不中奖 永不放弃!', '万一呢', '在', '冲吖~', '来了', '万一', '[保佑][保佑]', '从未中,从未停', '[吃瓜]', '[抠鼻][抠鼻]',
'来力', '秋梨膏', '[呲牙]', '从不缺席', '分子', '可以', '恰', '不会吧', '1', '好',
'rush', '来来来', 'ok', '冲', '凑热闹', '我要我要[打call]', '我还能中!让我中!!!', '大家都散了吧,已经抽完了,是我的', '我是天选之子', '给我中一次吧!',
'坚持不懈,迎难而上,开拓创新!', '[OK][OK]', '我来抽个奖', '中中中中中中', '[doge][doge][doge]', '我我我',
],
/**
* - 抽奖UP用户分组id(网页端点击分区后地址栏中的tagid)
* - 自动获取
*/
partition_id: 0,
/**
* 是否关注异常
*/
is_exception: false,
/**
* - 中奖通知关键词(满足一个就推送)
* - 符合js正则表达式的字符串
* - 若以 ~ 开头则表示为黑名单规则
*/
notice_key_words: [
"中奖|获得|填写|写上|提供|收货地址|支付宝账号|码|大会员",
"~有奖预约通知"
],
/**
* - 清理白名单uid或dyid
* - 英文逗号分隔 如: 1,2,3
*/
clear_white_list: '',
/**
* - 取关分区
* - 默认为: 此处存放因抽奖临时关注的up
*/
clear_partition: '',
/**
* 清理多少天之前的动态或关注
*/
clear_max_day: 30,
/**
* - 快速移除关注
* - 不加判断只去除关注
*/
clear_quick_remove_attention: false,
/**
* 是否移除动态
*/
clear_remove_dynamic: true,
/**
* 是否移除关注
*/
clear_remove_attention: true,
/**
* 清除动态延时(毫秒)
*/
clear_remove_delay: 8000,
/**
* 清除动态类型
*
* | 动态类型 | type值 |
* | :------- |:----- |
* | 无 | `0` |
* | 转发 | `1` |
* | 含图片 | `2` |
* | 无图纯文字 | `4` |
* | 视频 | `8` |
* | 活动 | `2048` |
* | 专栏 | `64` |
*/
clear_dynamic_type: 1
},
/**
* 针对某一账号的特别设置
* config_[数字] 依次类推
*/
config_1: {},
config_2: {},
config_3: {}
})
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "lottery-auto-script",
"version": "2.1.2",
"version": "2.1.7",
"description": "自动参与B站动态抽奖",
"main": "main.js",
"scripts": {
@@ -52,4 +52,4 @@
"chalk": "^4.1.1",
"nodemailer": "^6.5.0"
}
}
}