mirror of
https://github.com/shanmiteko/LotteryAutoScript.git
synced 2026-07-22 21:13:47 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2bd7b15ee | ||
|
|
b4c7a83f57 | ||
|
|
72b07a0f45 | ||
|
|
4accd2df2b | ||
|
|
d1c2c61626 | ||
|
|
6b0971170e | ||
|
|
a6410df3cf | ||
|
|
25811f20a0 | ||
|
|
778d8e5ef1 |
+36
-36
@@ -44,39 +44,39 @@ jobs:
|
||||
with:
|
||||
name: nlts-macos-x64
|
||||
path: dist/nlts-macos-x64/
|
||||
pkg_arm64:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout codes"
|
||||
uses: actions/checkout@v2
|
||||
- name: "Use Node.js"
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "16"
|
||||
- name: "Pkg this"
|
||||
run: |
|
||||
npm install
|
||||
npm run pkg_arm64
|
||||
- name: "Upload to artifact"
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: nlts-linux-arm64
|
||||
path: dist/
|
||||
pkg_armv7:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout codes"
|
||||
uses: actions/checkout@v2
|
||||
- name: "Use Node.js"
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "16"
|
||||
- name: "Pkg this"
|
||||
run: |
|
||||
npm install
|
||||
npm run pkg_armv7
|
||||
- name: "Upload to artifact"
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: nlts-linux-armv7
|
||||
path: dist/
|
||||
# pkg_arm64:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: "Checkout codes"
|
||||
# uses: actions/checkout@v2
|
||||
# - name: "Use Node.js"
|
||||
# uses: actions/setup-node@v1
|
||||
# with:
|
||||
# node-version: "16"
|
||||
# - name: "Pkg this"
|
||||
# run: |
|
||||
# npm install
|
||||
# npm run pkg_arm64
|
||||
# - name: "Upload to artifact"
|
||||
# uses: actions/upload-artifact@v2
|
||||
# with:
|
||||
# name: nlts-linux-arm64
|
||||
# path: dist/
|
||||
# pkg_armv7:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: "Checkout codes"
|
||||
# uses: actions/checkout@v2
|
||||
# - name: "Use Node.js"
|
||||
# uses: actions/setup-node@v1
|
||||
# with:
|
||||
# node-version: "16"
|
||||
# - name: "Pkg this"
|
||||
# run: |
|
||||
# npm install
|
||||
# npm run pkg_armv7
|
||||
# - name: "Upload to artifact"
|
||||
# uses: actions/upload-artifact@v2
|
||||
# with:
|
||||
# name: nlts-linux-armv7
|
||||
# path: dist/
|
||||
|
||||
+183
-55
@@ -1,9 +1,67 @@
|
||||
<!-- markdownlint-disable MD036 MD024-->
|
||||
# CHANGELOG
|
||||
|
||||
## 主要变化(2.3.2)
|
||||
|
||||
* b4c7a83 docs: 更新README
|
||||
* 72b07a0 chore: 暂时去除打包到arm
|
||||
* 4accd2d fix: 根据点赞去重(#64)
|
||||
* d1c2c61 fix: 无法打包pkg_armv7
|
||||
* 6b09711 feat: 获取和储存整理好的动态信息(#64)
|
||||
## 较上一版本变化
|
||||
|
||||
[my_config.js](my_config.js)增加
|
||||
* `APIs` - 获取抽奖信息的链接字符串
|
||||
* `set_lottery_info_url` - 上传抽奖信息的链接字符串
|
||||
|
||||
_如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更说明_
|
||||
|
||||
**Full Changelog**: https://github.com/shanmiteko/LotteryAutoScript/compare/v2.3.1...v2.3.2
|
||||
|
||||
## 主要变化(2.3.1)
|
||||
|
||||
## 问题修复
|
||||
|
||||
- 该动态不能转发分享(#60)
|
||||
- 发布的动态内容未序列化(#47)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
**替换可执行文件**
|
||||
|
||||
_如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更说明_
|
||||
|
||||
**Full Changelog**: <https://github.com/shanmiteko/LotteryAutoScript/compare/v2.3.0...v2.3.1>
|
||||
|
||||
## 主要变化(2.3.0)
|
||||
|
||||
- 私信检查所有未读消息
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
**替换可执行文件**
|
||||
|
||||
_如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更说明_
|
||||
|
||||
**Full Changelog**: <https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.9...v2.3.0>
|
||||
|
||||
## 主要变化(2.2.9)
|
||||
|
||||
- 检查动态创建时间(#57)(#58)
|
||||
- 简单整理(#56)
|
||||
|
||||
## 问题修复
|
||||
|
||||
- 非转发动态无源用户(#54)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`增加`max_create_time`
|
||||
|
||||
@@ -11,14 +69,18 @@
|
||||
|
||||
_如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更说明_
|
||||
|
||||
**Full Changelog**: https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.8...v2.2.9
|
||||
|
||||
**Full Changelog**: <https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.8...v2.2.9>
|
||||
|
||||
## 主要变化(2.2.8)
|
||||
|
||||
- 遇到过期的cookie跳过(#51)
|
||||
|
||||
## 问题修复
|
||||
|
||||
- UP关闭评论区(#52)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -26,14 +88,17 @@ _如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更
|
||||
|
||||
_如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更说明_
|
||||
|
||||
**Full Changelog**: https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.7...v2.2.8
|
||||
|
||||
**Full Changelog**: <https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.7...v2.2.8>
|
||||
|
||||
## 主要变化(2.2.7)
|
||||
|
||||
## 问题修复
|
||||
|
||||
- 未移动分区(#50)
|
||||
- 修改线路切换逻辑
|
||||
- 修改线路切换逻辑
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -41,13 +106,15 @@ _如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更
|
||||
|
||||
_如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更说明_
|
||||
|
||||
**Full Changelog**: https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.6...v2.2.7
|
||||
|
||||
**Full Changelog**: <https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.6...v2.2.7>
|
||||
|
||||
## 主要变化(2.2.6)
|
||||
|
||||
- LOG日志显示随机动态内容(#47)
|
||||
- 增加设置过滤间隔
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`增加`filter_wait`
|
||||
|
||||
@@ -55,13 +122,16 @@ _如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更
|
||||
|
||||
_如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更说明_
|
||||
|
||||
**Full Changelog**: https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.5...v2.2.6
|
||||
|
||||
**Full Changelog**: <https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.5...v2.2.6>
|
||||
|
||||
## 主要变化(2.2.5)
|
||||
|
||||
## 问题修复
|
||||
|
||||
- 因黑名单而关注失败(#45)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -70,38 +140,46 @@ _如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
**Full Changelog**: https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.4...v2.2.5
|
||||
|
||||
**Full Changelog**: <https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.4...v2.2.5>
|
||||
|
||||
## 主要变化(2.2.4)
|
||||
|
||||
- api线路切换具有记忆功能
|
||||
- 增加更多时延自定义值(#44)
|
||||
- 重构部分代码
|
||||
- 内置默认设置
|
||||
|
||||
## 问题修复
|
||||
|
||||
- 清理动态时关注列表获取失败
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`增加
|
||||
- `get_session_wait` 读取下一页私信间隔
|
||||
- `update_session_wait` 已读私信间隔
|
||||
- `get_partition_wait` 读取下一页关注列表间隔
|
||||
- `get_dynamic_detail_wait` 获取动态细节间隔
|
||||
- `random_dynamic_wait` 随机动态间隔
|
||||
- `random_dynamic_wait` 随机动态间隔
|
||||
|
||||
**替换可执行文件和更改配置文件(建议修改)**
|
||||
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
**Full Changelog**: https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.3...v2.2.4
|
||||
|
||||
**Full Changelog**: <https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.3...v2.2.4>
|
||||
|
||||
## 主要变化(2.2.3)
|
||||
|
||||
- clear_dynamic_type类型可以多选(#42)
|
||||
|
||||
## 问题修复
|
||||
|
||||
- 番剧动态无user_profile(#41)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`修改`clear_dynamic_type`
|
||||
|
||||
@@ -110,12 +188,14 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
**Full Changelog**: https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.2...v2.2.3
|
||||
|
||||
**Full Changelog**: <https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.2...v2.2.3>
|
||||
|
||||
## 主要变化(2.2.2)
|
||||
|
||||
- 随机转发热门视频(#40)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`增加`create_dy_mode` `create_dy_type`
|
||||
|
||||
@@ -124,13 +204,14 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
**Full Changelog**: https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.1...v2.2.2
|
||||
|
||||
**Full Changelog**: <https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.1...v2.2.2>
|
||||
|
||||
## 主要变化(2.2.1)
|
||||
|
||||
- 动态不存在时出错(#39)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -139,13 +220,15 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
**Full Changelog**: https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.0...v2.2.1
|
||||
|
||||
**Full Changelog**: <https://github.com/shanmiteko/LotteryAutoScript/compare/v2.2.0...v2.2.1>
|
||||
|
||||
## 主要变化(2.2.0)
|
||||
|
||||
- 修改转发验重逻辑
|
||||
- 可间隔插入随机动态(#33)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`增加create_dy_mode
|
||||
|
||||
@@ -154,10 +237,12 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
## 主要变化(2.1.8)
|
||||
|
||||
- 设置支持热更新(#29)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`文件格式更改
|
||||
- `my_config.js`文件格式更改
|
||||
|
||||
@@ -166,10 +251,12 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
## 主要变化(2.1.7)
|
||||
|
||||
- 设置支持热更新(#29)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`文件格式更改
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -178,10 +265,12 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
## 主要变化(2.1.6)
|
||||
|
||||
- 新增设置not_check_article(#25)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`新增设置not_check_article
|
||||
|
||||
@@ -190,10 +279,12 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
## 主要变化(2.1.5)
|
||||
|
||||
- 修复之前无法更新的问题
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -202,10 +293,12 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
## 主要变化(2.1.4)
|
||||
|
||||
- 黑名单处理(#22)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -214,10 +307,12 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
## 主要变化(2.1.3)
|
||||
- 错误码变更(#20)
|
||||
|
||||
- 错误码变更(#20)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -226,12 +321,14 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
## 主要变化(2.1.2)
|
||||
|
||||
- 支持arm平台运行
|
||||
- 改变账号异常应对策略
|
||||
- 修改dingtalk签名base64问题(#17)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -240,10 +337,12 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
## 主要变化(2.1.1)
|
||||
|
||||
- 获取未读私信接口变化
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -252,10 +351,12 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
## 主要变化(2.1.0)
|
||||
|
||||
- 修复两处问题
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -264,10 +365,12 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
## 主要变化(2.0.9)
|
||||
|
||||
- 账号异常自动切换线路(#14)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -276,10 +379,12 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
## 主要变化(2.0.8)
|
||||
|
||||
- 账号异常时未处理和发送通知
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -288,11 +393,13 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
## 主要变化(2.0.7)
|
||||
|
||||
- 修复一处问题
|
||||
- 日志时间UTC+8(#13)
|
||||
|
||||
## 较上一版本变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
@@ -301,11 +408,13 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
_如果之前版本小于上一版本,请查看**历次更新**说明_
|
||||
_[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
|
||||
## 主要变化
|
||||
|
||||
- 支持更新检查
|
||||
- 增加设置`update_loop_wait`
|
||||
|
||||
## 较上一版本(v2.0.5)变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`增加设置`update_loop_wait`
|
||||
|
||||
@@ -313,72 +422,91 @@ _[查看链接](https://github.com/shanmiteko/LotteryAutoScript/releases)_
|
||||
|
||||
_如果之前版本小于2.0.5,请查看历次更新说明_
|
||||
|
||||
|
||||
## 主要变化
|
||||
|
||||
- 不参与主站黑名单用户抽奖
|
||||
- my_config.js注释修改
|
||||
- 可从环境变量中读取COOKIE
|
||||
- 其他不影响功能的调整
|
||||
|
||||
## 较上一版本(v2.0.4)变化
|
||||
|
||||
- `env.js`无
|
||||
- `my_config.js`无
|
||||
|
||||
**仅需替换可执行文件**
|
||||
|
||||
|
||||
## 新特性
|
||||
|
||||
中奖通知设置可设黑名单
|
||||
|
||||
## 较上一版本(v2.0.3)变化
|
||||
|
||||
`env.js`无
|
||||
`my_config.js`无
|
||||
**仅需替换可执行文件**
|
||||
|
||||
|
||||
## 问题修复
|
||||
|
||||
- 评论失败未退出
|
||||
- 切割tag不精准
|
||||
|
||||
## 较上一版本(v2.0.2)变化
|
||||
|
||||
`env.js`无
|
||||
`my_config.js`无
|
||||
**仅需替换可执行文件**
|
||||
|
||||
edit: 替换release
|
||||
|
||||
|
||||
## 问题修复
|
||||
#9
|
||||
|
||||
# 9
|
||||
|
||||
## 较上一版本(2.0.1)变化
|
||||
|
||||
`env.js`无
|
||||
`my_config.js`无
|
||||
**仅需替换可执行文件**
|
||||
|
||||
|
||||
## 新增特性
|
||||
|
||||
增加两处自定义设置(`my_config.js`)
|
||||
|
||||
- `clear_quick_remove_attention`
|
||||
- `notice_key_words`
|
||||
|
||||
## 问题修复
|
||||
#7
|
||||
|
||||
# 7
|
||||
|
||||
## 较上一版本(2.0.0)变化
|
||||
|
||||
`env.js`无
|
||||
`my_config.js`需修改添加两处自定义设置
|
||||
除了替换可执行文件,还要修改`my_config.js`文件
|
||||
|
||||
|
||||
## 新增特性
|
||||
|
||||
打乱将转发的动态顺序,防止被人认出是抽奖号
|
||||
|
||||
## 问题修复
|
||||
|
||||
修复两处潜在bug
|
||||
|
||||
## 较上一版本(1.9.9)变化
|
||||
|
||||
`env.js`无
|
||||
`my_config.js`无
|
||||
只需替换可执行文件
|
||||
|
||||
|
||||
## 优化体验
|
||||
|
||||
清理动态时日志更详细
|
||||
以及其他细节处理
|
||||
|
||||
## 较上一版本(1.9.8)变化
|
||||
|
||||
`env.js`无
|
||||
`my_config.js`无
|
||||
只需替换可执行文件
|
||||
@@ -386,44 +514,50 @@ edit: 替换release
|
||||
edit: 1.9.9.1
|
||||
edit: 1.9.9.2
|
||||
|
||||
|
||||
## 修复Bug
|
||||
|
||||
两级解构时第一级为undefined(表现为异常退出)
|
||||
|
||||
## 较上一版本(1.9.7)变化
|
||||
|
||||
`env.js`更改注释内容
|
||||
`my_config.js`无
|
||||
只需替换可执行文件
|
||||
|
||||
## 修复Bug
|
||||
|
||||
转发专栏内的抽奖时无法获取关注
|
||||
|
||||
## 较上一版本(1.9.6)变化
|
||||
|
||||
`env.js`无
|
||||
`my_config.js`无
|
||||
只需替换可执行文件
|
||||
|
||||
|
||||
## 主要变化(1.9.6)
|
||||
|
||||
去除对unzipper的依赖
|
||||
专栏转发率达一半以上时跳过
|
||||
|
||||
## 较上一版本变更
|
||||
|
||||
`env.js`无
|
||||
`my_config.js`无
|
||||
只需替换可执行文件
|
||||
|
||||
|
||||
## 主要新增功能(1.9.5)
|
||||
|
||||
可从专栏里获取抽奖动态
|
||||
|
||||
## 较上一版本变更
|
||||
|
||||
`env.js`无变化
|
||||
`my_config.js`去掉部分设置,新增部分设置
|
||||
|
||||
## 1.9.0
|
||||
|
||||
修复Bug后的稳定版(大概
|
||||
|
||||
- 21/7/21 附加bat脚本增加对小白的友好性
|
||||
|
||||
## 1.8
|
||||
@@ -436,7 +570,6 @@ change 修复一处bug
|
||||
change 重新上传zip
|
||||
change 重新上传zip
|
||||
|
||||
|
||||
## 1.6
|
||||
|
||||
perf: 重构代码
|
||||
@@ -449,8 +582,6 @@ feat:
|
||||
- 滤除的dyid也进行存储
|
||||
fix: 修复部分bug
|
||||
|
||||
|
||||
|
||||
## 1.5
|
||||
|
||||
feat: 日志相关
|
||||
@@ -458,7 +589,7 @@ feat: 日志相关
|
||||
- 彩色输出
|
||||
- 环境变量LOTTERY_LOG_LEVEL更改日志等级
|
||||
feat: 设置相关
|
||||
- lottery_loop_wait 抽奖循环
|
||||
- lottery_loop_wait 抽奖循环
|
||||
- check_loop_wait 检奖循环
|
||||
- clear_loop_wait 清理循环
|
||||
|
||||
@@ -470,13 +601,10 @@ fix: 部分动态无法获取描述
|
||||
|
||||
feat: 新增loop_wait设置
|
||||
|
||||
|
||||
可执行文件压缩包
|
||||
|
||||
|
||||
# 命令行工具
|
||||
|
||||
可执行文件压缩包
|
||||
|
||||
|
||||
可执行文件压缩包
|
||||
可执行文件压缩包
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# AutoScript
|
||||
|
||||
- [AutoScript](#autoscript)
|
||||
- [操作步骤](#操作步骤)
|
||||
- [获取COOKIE](#获取cookie)
|
||||
@@ -13,6 +14,7 @@
|
||||
- [检测未读信息, 已读未读信息](#检测未读信息-已读未读信息)
|
||||
- [中奖推送(可选)](#中奖推送可选)
|
||||
- [设置说明](#设置说明)
|
||||
- [Awesome](#awesome)
|
||||
|
||||
[Github仓库链接](https://github.com/shanmiteko/LotteryAutoScript)
|
||||
|
||||
@@ -21,6 +23,7 @@
|
||||
[](https://github.com/shanmiteko/LotteryAutoScript/actions/workflows/npmp.yml)
|
||||
|
||||
已实现功能:
|
||||
|
||||
- 监控用户转发
|
||||
- 监控话题页面
|
||||
- 监控专栏合集
|
||||
@@ -71,7 +74,7 @@ Chrome浏览器:
|
||||
.join('; ')
|
||||
.split()
|
||||
.forEach(it => copy(it) || console.log(it))
|
||||
```
|
||||
```
|
||||
|
||||
也可以采用**其他方式获取**所需的Cookie
|
||||
|
||||
@@ -84,7 +87,9 @@ Chrome浏览器:
|
||||
### 本地运行
|
||||
|
||||
#### 可执行文件
|
||||
|
||||
1. [[下载](https://github.com/shanmiteko/LotteryAutoScript/releases)|[cnpmjs镜像下载](https://github.com.cnpmjs.org/shanmiteko/LotteryAutoScript/releases)|[Fastgit镜像下载](https://hub.fastgit.org/shanmiteko/LotteryAutoScript/releases)]压缩包并解压后
|
||||
|
||||
```
|
||||
~/nlts-linux-x64
|
||||
=> tree
|
||||
@@ -94,10 +99,12 @@ Chrome浏览器:
|
||||
├── my_config.js (自定义设置文件) (!使用前必读)
|
||||
└── README.md (说明文件)
|
||||
```
|
||||
|
||||
2. 用记事本或其他编辑器修改`env.js`和`my_config.js`文件(右键选择用记事本打开)
|
||||
3. 在`env.js`中填入`COOKIE`和推送参数
|
||||
4. 在`my_config.js`中自定义设置
|
||||
5. 在当前目录下**打开终端**运行可执行文件`lottery`(勿直接点击`lottery`)
|
||||
|
||||
```sh
|
||||
# unix-like
|
||||
## 进入脚本所在目录
|
||||
@@ -117,6 +124,7 @@ Chrome浏览器:
|
||||
## 把`./`换成`.\`或去掉
|
||||
## 已自带*.bat可直接点击
|
||||
```
|
||||
|
||||
7. 运行截图
|
||||

|
||||
|
||||
@@ -183,23 +191,27 @@ npm i && npm run clear
|
||||
脚本已内置定时运行功能
|
||||
|
||||
##### Linux
|
||||
|
||||
[linux系统配置与定时运行](./doc/linux_schedule.md)
|
||||
|
||||
</details>
|
||||
|
||||
### Docker
|
||||
|
||||
1.初始化
|
||||
|
||||
```bash
|
||||
$ curl -fsSL https://cdn.staticaly.com/gh/shanmiteko/LotteryAutoScript/main/script/docker/init.sh | sh
|
||||
curl -fsSL https://cdn.staticaly.com/gh/shanmiteko/LotteryAutoScript/main/script/docker/init.sh | sh
|
||||
```
|
||||
|
||||
进入`lottery`文件夹
|
||||
|
||||
```bash
|
||||
$ cd lottery
|
||||
cd lottery
|
||||
```
|
||||
|
||||
编辑`env.js`与`my_config.js`文件
|
||||
|
||||
- env.js 设置必要环境变量
|
||||
- my_config.js 你的设置
|
||||
|
||||
@@ -207,8 +219,9 @@ $ cd lottery
|
||||
> start,check,clear
|
||||
|
||||
例如:
|
||||
|
||||
```bash
|
||||
$ ./start.sh
|
||||
./start.sh
|
||||
```
|
||||
|
||||
2.更新
|
||||
@@ -222,26 +235,28 @@ $ ./start.sh
|
||||
进入lottery上一级目录
|
||||
|
||||
```bash
|
||||
$ docker image rm -f shanmite/lottery_auto_docker
|
||||
$ rm -rf lottery/
|
||||
docker image rm -f shanmite/lottery_auto_docker
|
||||
rm -rf lottery/
|
||||
```
|
||||
|
||||
----------------------------------------
|
||||
|
||||
## 防重复转发
|
||||
|
||||
~~存储在专栏草稿~~
|
||||
|
||||
~~脚本将转发过的动态和被过滤的动态都写入`dyids/dyid*.txt`文件中~~
|
||||
|
||||
是否点赞
|
||||
|
||||
|
||||
----------------------------------------
|
||||
|
||||
## 检测中奖
|
||||
|
||||
### 检测未读信息, 已读未读信息
|
||||
|
||||
判断依据
|
||||
|
||||
- 通过`@`信息判断
|
||||
|
||||
- 通过私信判断
|
||||
@@ -249,37 +264,45 @@ $ rm -rf lottery/
|
||||
关键词有限 可能会有**漏掉**的或**误报**
|
||||
|
||||
### 中奖推送(可选)
|
||||
|
||||
> 填写在env.js内
|
||||
|
||||
以下是支持的推送方式
|
||||
|
||||
| Name | 归属 | 属性 | 说明 |
|
||||
| :---------------: | :--------------------------------------------------------------------------------: | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `SCKEY` | 微信server酱推送(于2021/4月下线) | 非必须 | server酱的微信通知[官方文档](http://sc.ftqq.com/3.version) |
|
||||
| `SENDKEY` | 微信server酱(Turbo版)推送 | 非必须 | [获取SENDKEY](https://sct.ftqq.com/sendkey) [选择消息通道](https://sct.ftqq.com/forward) |
|
||||
| `BARK_PUSH` | [BARK推送](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865) | 非必须 | IOS用户下载BARK这个APP,填写内容是app提供的`设备码`,例如:https://api.day.app/123 ,那么此处的设备码就是`123`,再不懂看 [这个图](https://gitee.com/shanmite/LotteryAutoScript/raw/main/doc/pic/bark.jpg)(注:支持自建填完整链接即可) |
|
||||
| `BARK_SOUND` | [BARK推送](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865) | 非必须 | bark推送声音设置,例如`choo`,具体值请在`bark`-`推送铃声`-`查看所有铃声` |
|
||||
| `TG_BOT_TOKEN` | telegram推送 | 非必须 | tg推送(需设备可连接外网),`TG_BOT_TOKEN`和`TG_USER_ID`两者必需,填写自己申请[@BotFather](https://t.me/BotFather)的Token,如`10xxx4:AAFcqxxxxgER5uw` , [具体教程](doc/TG_PUSH.md) |
|
||||
| `TG_USER_ID` | telegram推送 | 非必须 | tg推送(需设备可连接外网),`TG_BOT_TOKEN`和`TG_USER_ID`两者必需,填写[@getuseridbot](https://t.me/getuseridbot)中获取到的纯数字ID, [具体教程](doc/TG_PUSH.md) |
|
||||
| `TG_PROXY_HOST` | Telegram 代理的 IP | 非必须 | 代理类型为 http。例子:http代理 http://127.0.0.1:1080 则填写 127.0.0.1 |
|
||||
| `TG_PROXY_PORT` | Telegram 代理的端口 | 非必须 | 例子:http代理 http://127.0.0.1:1080 则填写 1080 |
|
||||
| `DD_BOT_TOKEN` | 钉钉推送 | 非必须 | 钉钉推送(`DD_BOT_TOKEN`和`DD_BOT_SECRET`两者必需)[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) ,只需`https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于`=`符号后面的XXX即可 |
|
||||
| `DD_BOT_SECRET` | 钉钉推送 | 非必须 | (`DD_BOT_TOKEN`和`DD_BOT_SECRET`两者必需) ,密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的`SECXXXXXXXXXX`等字符 , 注:钉钉机器人安全设置只需勾选`加签`即可,其他选项不要勾选,再不懂看 [这个图](https://gitee.com/shanmite/LotteryAutoScript/raw/main/doc/pic/DD_bot.png) |
|
||||
| `IGOT_PUSH_KEY` | iGot推送 | 非必须 | iGot聚合推送,支持多方式推送,确保消息可达。 [参考文档](https://wahao.github.io/Bark-MP-helper ) |
|
||||
| `QQ_SKEY` | 酷推(Cool Push)推送 | 非必须 | 推送所需的Skey,登录后获取Skey [参考文档](https://cp.xuthus.cc/) |
|
||||
| `QQ_MODE` | 酷推(Cool Push)推送 | 非必须 | 推送方式(send或group或者wx,默认send) [参考文档](https://cp.xuthus.cc/) |
|
||||
| `QYWX_KEY` | 企业微信推送 | 非必须 | 密钥,企业微信推送 webhook 后面的 key [详见官方说明文档](https://work.weixin.qq.com/api/doc/90000/90136/91770) |
|
||||
| `PUSH_PLUS_TOKEN` | pushplus推送 | 非必须 | 微信扫码登录后一对一推送或一对多推送下面的token(您的Token) [官方网站](http://pushplus.hxtrip.com/) |
|
||||
| `PUSH_PLUS_USER` | pushplus推送 | 非必须 | 一对多推送的“群组编码”(一对多推送下面->您的群组(如无则新建)->群组编码)注:(1、需订阅者扫描二维码 2、如果您是创建群组所属人,也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送),只填`PUSH_PLUS_TOKEN`默认为一对一推送 |
|
||||
| `SMTP_HOST` | 电子邮件 | 非必须 | smtp服务器的主机名 如: `smtp.qq.com` |
|
||||
| `SMTP_PORT` | 电子邮件 | 非必须 | smtp服务器的端口 如: `465` |
|
||||
| `SMTP_USER` | 电子邮件 | 非必须 | 发送方的电子邮件 如: `xxxxxxxxx@qq.com` |
|
||||
| `SMTP_PASS` | 电子邮件 | 非必须 | smtp服务对应的授权码 |
|
||||
| `SMTP_TO_USER` | 电子邮件 | 非必须 | 接收方电子邮件 |
|
||||
| Name | 归属 | 属性 | 说明 |
|
||||
| :---------------: | :--------------------------------------------------------------------------------: | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `SCKEY` | 微信server酱推送(于2021/4月下线) | 非必须 | server酱的微信通知[官方文档](http://sc.ftqq.com/3.version) |
|
||||
| `SENDKEY` | 微信server酱(Turbo版)推送 | 非必须 | [获取SENDKEY](https://sct.ftqq.com/sendkey) [选择消息通道](https://sct.ftqq.com/forward) |
|
||||
| `BARK_PUSH` | [BARK推送](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865) | 非必须 | IOS用户下载BARK这个APP,填写内容是app提供的`设备码`,例如:<https://api.day.app/123> ,那么此处的设备码就是`123`,再不懂看 [这个图](https://gitee.com/shanmite/LotteryAutoScript/raw/main/doc/pic/bark.jpg)(注:支持自建填完整链接即可) |
|
||||
| `BARK_SOUND` | [BARK推送](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865) | 非必须 | bark推送声音设置,例如`choo`,具体值请在`bark`-`推送铃声`-`查看所有铃声` |
|
||||
| `TG_BOT_TOKEN` | telegram推送 | 非必须 | tg推送(需设备可连接外网),`TG_BOT_TOKEN`和`TG_USER_ID`两者必需,填写自己申请[@BotFather](https://t.me/BotFather)的Token,如`10xxx4:AAFcqxxxxgER5uw` , [具体教程](doc/TG_PUSH.md) |
|
||||
| `TG_USER_ID` | telegram推送 | 非必须 | tg推送(需设备可连接外网),`TG_BOT_TOKEN`和`TG_USER_ID`两者必需,填写[@getuseridbot](https://t.me/getuseridbot)中获取到的纯数字ID, [具体教程](doc/TG_PUSH.md) |
|
||||
| `TG_PROXY_HOST` | Telegram 代理的 IP | 非必须 | 代理类型为 http。例子:http代理 <http://127.0.0.1:1080> 则填写 127.0.0.1 |
|
||||
| `TG_PROXY_PORT` | Telegram 代理的端口 | 非必须 | 例子:http代理 <http://127.0.0.1:1080> 则填写 1080 |
|
||||
| `DD_BOT_TOKEN` | 钉钉推送 | 非必须 | 钉钉推送(`DD_BOT_TOKEN`和`DD_BOT_SECRET`两者必需)[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) ,只需`https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于`=`符号后面的XXX即可 |
|
||||
| `DD_BOT_SECRET` | 钉钉推送 | 非必须 | (`DD_BOT_TOKEN`和`DD_BOT_SECRET`两者必需) ,密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的`SECXXXXXXXXXX`等字符 , 注:钉钉机器人安全设置只需勾选`加签`即可,其他选项不要勾选,再不懂看 [这个图](https://gitee.com/shanmite/LotteryAutoScript/raw/main/doc/pic/DD_bot.png) |
|
||||
| `IGOT_PUSH_KEY` | iGot推送 | 非必须 | iGot聚合推送,支持多方式推送,确保消息可达。 [参考文档](https://wahao.github.io/Bark-MP-helper ) |
|
||||
| `QQ_SKEY` | 酷推(Cool Push)推送 | 非必须 | 推送所需的Skey,登录后获取Skey [参考文档](https://cp.xuthus.cc/) |
|
||||
| `QQ_MODE` | 酷推(Cool Push)推送 | 非必须 | 推送方式(send或group或者wx,默认send) [参考文档](https://cp.xuthus.cc/) |
|
||||
| `QYWX_KEY` | 企业微信推送 | 非必须 | 密钥,企业微信推送 webhook 后面的 key [详见官方说明文档](https://work.weixin.qq.com/api/doc/90000/90136/91770) |
|
||||
| `PUSH_PLUS_TOKEN` | pushplus推送 | 非必须 | 微信扫码登录后一对一推送或一对多推送下面的token(您的Token) [官方网站](http://pushplus.hxtrip.com/) |
|
||||
| `PUSH_PLUS_USER` | pushplus推送 | 非必须 | 一对多推送的“群组编码”(一对多推送下面->您的群组(如无则新建)->群组编码)注:(1、需订阅者扫描二维码 2、如果您是创建群组所属人,也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送),只填`PUSH_PLUS_TOKEN`默认为一对一推送 |
|
||||
| `SMTP_HOST` | 电子邮件 | 非必须 | smtp服务器的主机名 如: `smtp.qq.com` |
|
||||
| `SMTP_PORT` | 电子邮件 | 非必须 | smtp服务器的端口 如: `465` |
|
||||
| `SMTP_USER` | 电子邮件 | 非必须 | 发送方的电子邮件 如: `xxxxxxxxx@qq.com` |
|
||||
| `SMTP_PASS` | 电子邮件 | 非必须 | smtp服务对应的授权码 |
|
||||
| `SMTP_TO_USER` | 电子邮件 | 非必须 | 接收方电子邮件 |
|
||||
|
||||
----------------------------------------
|
||||
|
||||
## 设置说明
|
||||
|
||||
详见[env.example.js](./env.example.js)文件内部注释
|
||||
|
||||
详见[my_config.example.js](./my_config.example.js)文件内部注释
|
||||
|
||||
## Awesome
|
||||
相关项目
|
||||
|
||||
- [LotteryAutoScript_Station](https://github.com/spiritLHL/LotteryAutoScript_Station) - @spiritLHL
|
||||
- [sync_lottery](https://github.com/spiritLHL/sync_lottery) - @spiritLHL
|
||||
+26
-2
@@ -1,4 +1,5 @@
|
||||
const { log, hasEnv, shuffle, getRandomOne, delay, try_for_each } = require('../utils');
|
||||
const { send } = require('../net/http');
|
||||
const bili = require('../net/bili');
|
||||
const { sendNotify } = require('../helper/notify');
|
||||
const event_bus = require('../helper/event_bus');
|
||||
@@ -24,6 +25,7 @@ class Monitor extends Searcher {
|
||||
['UIDs', this.getLotteryInfoByUID.bind(this)],
|
||||
['TAGs', this.getLotteryInfoByTag.bind(this)],
|
||||
['Articles', this.getLotteryInfoByArticle.bind(this)],
|
||||
['APIs', this.getLotteryInfoByAPI.bind(this)]
|
||||
]);
|
||||
}
|
||||
/**
|
||||
@@ -172,7 +174,7 @@ class Monitor extends Searcher {
|
||||
async filterLotteryInfo() {
|
||||
const { lottery_param, LotteryInfoMap, attentionList } = this;
|
||||
/**
|
||||
* @type {import("./searcher").LotteryInfo}
|
||||
* @type {import("./searcher").LotteryInfo[]}
|
||||
*/
|
||||
let protoLotteryInfo = await LotteryInfoMap.get(lottery_param[0])(lottery_param[1]);
|
||||
|
||||
@@ -186,7 +188,7 @@ class Monitor extends Searcher {
|
||||
/** 所有抽奖信息 */
|
||||
let alllotteryinfo = [];
|
||||
const
|
||||
{ key_words, model, chatmodel, max_create_time, is_imitator, only_followed, at_users, blockword, blacklist } = config,
|
||||
{ set_lottery_info_url, key_words, model, chatmodel, max_create_time, is_imitator, only_followed, at_users, blockword, blacklist } = config,
|
||||
now_ts = Date.now() / 1000;
|
||||
|
||||
/**
|
||||
@@ -203,6 +205,28 @@ class Monitor extends Searcher {
|
||||
return true
|
||||
});
|
||||
|
||||
if (lottery_param[0] !== "APIs" && set_lottery_info_url) {
|
||||
log.info("上传抽奖信息", "开始")
|
||||
await new Promise((resolve) => {
|
||||
send({
|
||||
url: set_lottery_info_url,
|
||||
method: "POST",
|
||||
headers: {
|
||||
"content-type": "application/json"
|
||||
},
|
||||
contents: protoLotteryInfo,
|
||||
success: ({ body }) => {
|
||||
log.info("发送获取到的动态数据", body)
|
||||
resolve()
|
||||
},
|
||||
failure: err => {
|
||||
log.error("发送获取到的动态数据", err)
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/* 检查动态是否满足要求 */
|
||||
await try_for_each(protoLotteryInfo, async function ({
|
||||
lottery_info_type, is_liked,
|
||||
|
||||
+75
-10
@@ -1,6 +1,7 @@
|
||||
const utils = require('../utils');
|
||||
const bili = require('../net/bili');
|
||||
const config = require("../data/config");
|
||||
const { send } = require("../net/http");
|
||||
const { article_scan_page, not_check_article, get_dynamic_detail_wait, uid_scan_page, search_wait, tag_scan_page } = require("../data/config");
|
||||
|
||||
const { log } = utils
|
||||
|
||||
@@ -217,9 +218,7 @@ class Searcher {
|
||||
*/
|
||||
async getLotteryInfoByUID(UID) {
|
||||
log.info('获取动态', `开始获取用户${UID}的动态信息`);
|
||||
const
|
||||
{ uid_scan_page, search_wait, get_dynamic_detail_wait } = config,
|
||||
{ allModifyDynamicResArray } = await Searcher.checkAllDynamic(UID, uid_scan_page, search_wait);
|
||||
const { allModifyDynamicResArray } = await Searcher.checkAllDynamic(UID, uid_scan_page, search_wait);
|
||||
|
||||
let { length } = allModifyDynamicResArray
|
||||
|
||||
@@ -238,7 +237,7 @@ class Searcher {
|
||||
const results = await pre
|
||||
, { origin_dynamic_id } = cur;
|
||||
|
||||
log.info('获取动态', `查看源动态(${origin_dynamic_id})的细节 (${length--})`)
|
||||
log.info('获取动态', `查看源动态(${origin_dynamic_id})是否点赞 (${length--})`)
|
||||
|
||||
const card = await bili.getOneDynamicByDyid(origin_dynamic_id)
|
||||
|
||||
@@ -278,7 +277,6 @@ class Searcher {
|
||||
*/
|
||||
async getLotteryInfoByTag(tag_name) {
|
||||
const
|
||||
{ tag_scan_page, search_wait } = config,
|
||||
tag_id = await bili.getTagIDByTagName(tag_name),
|
||||
hotdy = await bili.getHotDynamicInfoByTagID(tag_id),
|
||||
modDR = modifyDynamicRes(hotdy);
|
||||
@@ -333,9 +331,7 @@ class Searcher {
|
||||
*/
|
||||
async getLotteryInfoByArticle(key_words) {
|
||||
log.info('获取动态', `开始获取含关键词${key_words}的专栏信息`);
|
||||
const
|
||||
{ article_scan_page, not_check_article, get_dynamic_detail_wait } = config,
|
||||
cvs = (await bili.searchArticlesByKeyword(key_words)).slice(0, article_scan_page);
|
||||
const cvs = (await bili.searchArticlesByKeyword(key_words)).slice(0, article_scan_page);
|
||||
|
||||
/**存储所有专栏中的dyid */
|
||||
let dyinfos = [];
|
||||
@@ -358,7 +354,7 @@ class Searcher {
|
||||
/**遍历某专栏中的dyids */
|
||||
for (const dyid of dyids_set) {
|
||||
if (dyid.length === utils.dyid_length) {
|
||||
log.info('获取动态', `查看专栏中所提及动态(${dyid})的细节 (${length--})`)
|
||||
log.info('获取动态', `查看专栏中所提及动态(${dyid})是否点赞 (${length--})`)
|
||||
|
||||
const card = await bili.getOneDynamicByDyid(dyid)
|
||||
|
||||
@@ -406,6 +402,75 @@ class Searcher {
|
||||
|
||||
return fomatdata
|
||||
}
|
||||
|
||||
/**
|
||||
* 从特定格式的api响应数据中获取抽奖信息
|
||||
* @param {string} api
|
||||
* @returns {Promise<LotteryInfo[] | null>}
|
||||
*/
|
||||
getLotteryInfoByAPI(api) {
|
||||
return new Promise((resolve) => {
|
||||
if (api) {
|
||||
const { strToJson } = utils;
|
||||
log.info('获取动态', `开始获取链接(${api})中的抽奖信息`)
|
||||
send({
|
||||
url: api,
|
||||
config: {
|
||||
redirect: true
|
||||
},
|
||||
method: 'GET',
|
||||
success: ({ body }) => {
|
||||
if (body.err_msg) {
|
||||
log.error("从API响应数据中获取抽奖信息", body.err_msg)
|
||||
resolve(null)
|
||||
} else {
|
||||
const raw_lottery_info = strToJson(body).lottery_info;
|
||||
|
||||
if (raw_lottery_info) {
|
||||
let { length } = raw_lottery_info;
|
||||
if (length) {
|
||||
const lottery_info = raw_lottery_info
|
||||
.reduce(async (pre, cur) => {
|
||||
const results = await pre
|
||||
, { dyid } = cur;
|
||||
|
||||
log.info('获取动态', `查看动态(${dyid})是否点赞 (${length--})`)
|
||||
|
||||
const card = await bili.getOneDynamicByDyid(dyid)
|
||||
|
||||
if (card) {
|
||||
await utils.delay(get_dynamic_detail_wait)
|
||||
|
||||
const { is_liked } = parseDynamicCard(card)
|
||||
|
||||
cur.is_liked = is_liked
|
||||
|
||||
return [...results, cur]
|
||||
}
|
||||
|
||||
return results
|
||||
|
||||
}, Promise.resolve([]))
|
||||
|
||||
resolve(lottery_info)
|
||||
return
|
||||
}
|
||||
}
|
||||
log.error("从API响应数据中获取抽奖信息", "非Json数据或没有lottery_info或lottery为空")
|
||||
resolve(null)
|
||||
}
|
||||
},
|
||||
failure: err => {
|
||||
log.error("从API响应数据中获取抽奖信息", err)
|
||||
resolve(null)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
log.warn('获取动态', `链接为空`)
|
||||
resolve(null)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+31
-2
@@ -16,6 +16,34 @@ const config = {
|
||||
*/
|
||||
TAGs: [],
|
||||
|
||||
/**
|
||||
* 从API接口中获取抽奖信息
|
||||
* @typedef {object} LotteryInfo
|
||||
* @property {string} lottery_info_type
|
||||
* @property {number} create_time
|
||||
* @property {boolean} is_liked
|
||||
* @property {number[]} uids `[uid,ouid]`
|
||||
* @property {string} uname
|
||||
* @property {Array<{}>} ctrl
|
||||
* @property {string} dyid
|
||||
* @property {string} rid
|
||||
* @property {string} des
|
||||
* @property {number} type
|
||||
* @property {boolean} hasOfficialLottery 是否官方
|
||||
* @typedef RespondBody
|
||||
* @property {string} err_msg 错误信息
|
||||
* @property {LotteryInfo[]} lottery_info
|
||||
* API传回数据类型 {RespondBody}
|
||||
* 获取抽奖信息的链接字符串
|
||||
*/
|
||||
APIs: [],
|
||||
|
||||
/**
|
||||
* API发送数据类型 {LotteryInfo[]}
|
||||
* 上传抽奖信息的链接字符串
|
||||
*/
|
||||
set_lottery_info_url: "",
|
||||
|
||||
/**
|
||||
* 动态中的关键词(表示须同时满足以下条件)
|
||||
* 符合js正则表达式的字符串
|
||||
@@ -229,10 +257,11 @@ const config = {
|
||||
* - 中奖通知关键词(满足一个就推送)
|
||||
* - 符合js正则表达式的字符串
|
||||
* - 若以 ~ 开头则表示为黑名单规则
|
||||
* - 优先级递增
|
||||
*/
|
||||
notice_key_words: [
|
||||
"中奖|获得|填写|写上|提供|收货地址|支付宝账号|码|大会员",
|
||||
"~有奖预约通知"
|
||||
"~预约成功|预约主题",
|
||||
"中奖|获得|填写|写上|提供|收货地址|支付宝账号|码|大会员"
|
||||
],
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,11 +28,12 @@ let global_var = {
|
||||
this.set(key_map.get(_item[0]), _item[1]);
|
||||
});
|
||||
|
||||
const { UIDs = [], TAGs = [], Articles = [] } = config;
|
||||
const { UIDs = [], TAGs = [], Articles = [], APIs = [] } = config;
|
||||
this.set('Lottery', [
|
||||
...UIDs.map(it => ['UIDs', it]),
|
||||
...TAGs.map(it => ['TAGs', it]),
|
||||
...Articles.map(it => ['Articles', it])
|
||||
...Articles.map(it => ['Articles', it]),
|
||||
...APIs.map(it => ['APIs', it])
|
||||
]);
|
||||
this.set('remoteconfig', await getRemoteConfig());
|
||||
}
|
||||
|
||||
+22
-16
@@ -372,6 +372,7 @@ const bili_client = {
|
||||
log.warn('获取一个动态的细节', `动态(${dynamic_id})不存在`);
|
||||
return;
|
||||
}
|
||||
log.info('获取一个动态的细节', `动态id(${dynamic_id})`);
|
||||
return card;
|
||||
},
|
||||
/**
|
||||
@@ -721,22 +722,27 @@ const bili_client = {
|
||||
if (len > 233) {
|
||||
msg = msg.slice(0, 233 - len)
|
||||
}
|
||||
const responseText = await post({
|
||||
url: API.DYNAMIC_REPOST_REPOST,
|
||||
config: {
|
||||
retry: false
|
||||
},
|
||||
contents: {
|
||||
uid: `${uid}`,
|
||||
dynamic_id: dyid,
|
||||
content: msg,
|
||||
ctrl,
|
||||
csrf: GlobalVar.get("csrf")
|
||||
}
|
||||
});
|
||||
if (/^{"code":0/.test(responseText)) {
|
||||
const
|
||||
responseText = await post({
|
||||
url: API.DYNAMIC_REPOST_REPOST,
|
||||
config: {
|
||||
retry: false
|
||||
},
|
||||
contents: {
|
||||
uid: `${uid}`,
|
||||
dynamic_id: dyid,
|
||||
content: msg,
|
||||
ctrl,
|
||||
csrf: GlobalVar.get("csrf")
|
||||
}
|
||||
}),
|
||||
res = strToJson(responseText);
|
||||
if (res.code === 0) {
|
||||
log.info('转发动态', '成功转发一条动态');
|
||||
return 0;
|
||||
} else if (res.code === 1101004) {
|
||||
log.warn('转发动态', '该动态不能转发分享');
|
||||
return 0;
|
||||
} else {
|
||||
log.error('转发动态', `转发动态失败\n${responseText}`);
|
||||
return 1;
|
||||
@@ -778,9 +784,9 @@ const bili_client = {
|
||||
contents,
|
||||
});
|
||||
if (/^{"code":0/.test(responseText)) {
|
||||
log.info('发布动态', `成功创建一条随机内容的动态\n${content}\n`);
|
||||
log.info('发布动态', `成功创建一条随机内容的动态\n${JSON.stringify(content)}\n`);
|
||||
} else {
|
||||
log.error('发布动态', `发布动态失败\n${content}\n${responseText}`);
|
||||
log.error('发布动态', `发布动态失败\n${JSON.stringify(content)}\n${responseText}`);
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
||||
+2
-1
@@ -69,7 +69,8 @@ function send(detail) {
|
||||
let options = {
|
||||
timeout,
|
||||
method: method.toUpperCase(),
|
||||
host: thisURL.host,
|
||||
hostname: thisURL.hostname,
|
||||
port: thisURL.port,
|
||||
path: thisURL.pathname + thisURL.search + thisURL.hash,
|
||||
headers,
|
||||
};
|
||||
|
||||
+1
-1
@@ -141,7 +141,7 @@ const utils = {
|
||||
return array;
|
||||
},
|
||||
/**
|
||||
* 关键词判断
|
||||
* 关键词判断 优先级递增
|
||||
* @param {string} text
|
||||
* @param {string[]} key_words startwith '~' 表示黑名单
|
||||
* @return {boolean}
|
||||
|
||||
+33
-2
@@ -28,6 +28,36 @@ module.exports = Object.freeze({
|
||||
'抽奖',
|
||||
],
|
||||
|
||||
/**
|
||||
* 从API接口中获取抽奖信息
|
||||
* @typedef {object} LotteryInfo
|
||||
* @property {string} lottery_info_type
|
||||
* @property {number} create_time
|
||||
* @property {boolean} is_liked
|
||||
* @property {number[]} uids `[uid,ouid]`
|
||||
* @property {string} uname
|
||||
* @property {Array<{}>} ctrl
|
||||
* @property {string} dyid
|
||||
* @property {string} rid
|
||||
* @property {string} des
|
||||
* @property {number} type
|
||||
* @property {boolean} hasOfficialLottery 是否官方
|
||||
* @typedef RespondBody
|
||||
* @property {string} err_msg 错误信息
|
||||
* @property {LotteryInfo[]} lottery_info
|
||||
* API传回数据类型 {RespondBody}
|
||||
* 获取抽奖信息的链接字符串
|
||||
* @example
|
||||
* "https://raw.fastgit.org/spiritLHL/sync_lottery/master/archive_datas/datas.json"
|
||||
*/
|
||||
APIs: [],
|
||||
|
||||
/**
|
||||
* API发送数据类型 {LotteryInfo[]}
|
||||
* 上传抽奖信息的链接字符串
|
||||
*/
|
||||
set_lottery_info_url: "",
|
||||
|
||||
/**
|
||||
* 动态中的关键词(表示须同时满足以下条件)
|
||||
* 符合js正则表达式的字符串
|
||||
@@ -241,10 +271,11 @@ module.exports = Object.freeze({
|
||||
* - 中奖通知关键词(满足一个就推送)
|
||||
* - 符合js正则表达式的字符串
|
||||
* - 若以 ~ 开头则表示为黑名单规则
|
||||
* - 优先级递增
|
||||
*/
|
||||
notice_key_words: [
|
||||
"中奖|获得|填写|写上|提供|收货地址|支付宝账号|码|大会员",
|
||||
"~有奖预约通知"
|
||||
"~预约成功|预约主题",
|
||||
"中奖|获得|填写|写上|提供|收货地址|支付宝账号|码|大会员"
|
||||
],
|
||||
|
||||
/**
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lottery-auto-script",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.2",
|
||||
"description": "自动参与B站动态抽奖",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
@@ -45,11 +45,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/shanmiteko/AutoScript#readme",
|
||||
"devDependencies": {
|
||||
"eslint": "^7.17.0",
|
||||
"pkg": "^5.2.1"
|
||||
"eslint": "^8.1.0",
|
||||
"pkg": "^5.4.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"chalk": "^4.1.1",
|
||||
"nodemailer": "^6.5.0"
|
||||
"chalk": "^4.1.2",
|
||||
"nodemailer": "^6.7.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user