Compare commits

...
31 Commits
Author SHA1 Message Date
shanmite 364bcd1325 docs: 更新CHANGELOG 2024-04-05 10:12:55 +08:00
shanmite 469a6dc7b5 fix: add getOneDynamicByDyid v1 2024-04-05 10:10:01 +08:00
shanmite 7a8682ce76 docs: 更新CHANGELOG 2024-03-25 16:16:15 +08:00
shanmite 7b6356ac25 fix: 风控导致动态全为过时 2024-03-25 15:44:23 +08:00
shanmite d337fb235d fix: 查询动态详情的接口失效 (#349) 2024-03-25 15:15:20 +08:00
shanmite d9dba6f0ff fix: Cannot read properties of null (reading 'is_liked') 2024-03-25 10:43:38 +08:00
shanmite eafa7c7ae4 fix: Cannot read properties of null (reading 'length') (#360)
Fixed #360
2024-03-25 10:35:22 +08:00
ypw96andGitHub e2976cc9b7 docs: 文档更新cookie获取方式 (#357)
* Add files via upload

* Update README.md

新增COOKIE获取方式
2024-03-25 10:22:16 +08:00
shanmite 759a87140e docs: 更新CHANGELOG 2024-03-09 15:13:51 +08:00
shanmite f5bdd289d5 fix: update api getOneDynamicByDyid 2024-03-09 15:13:15 +08:00
ypw96andGitHub cb6fad05e4 fix: get_dynamic_detail api (#351)
* Update api.bili.js

* Update api.bili.js

* Update bili.js
2024-03-06 21:30:34 +08:00
shanmiteandGitHub 780a3a9840 fix: update get_dynamic_detail api (#350)
* Update api.bili.js

* Update bili.js

* Update bili.js
2024-03-06 19:36:18 +08:00
shanmite 92fab1774d docs: 更新CHANGELOG 2023-12-01 10:22:40 +08:00
shanmite addb9c65fe fix: ghproxy.com->mirror.ghproxy.com (#333)
Fixed #333
2023-12-01 10:21:08 +08:00
shanmite b86e756520 fix: at错位 2023-12-01 10:16:11 +08:00
shanmite f3af8dff17 docs: 更新CHANGELOG 2023-11-25 13:46:42 +08:00
shanmite 5d30178bd3 ci: docker构建 2023-11-25 11:21:31 +08:00
shanmite 0c610701cb fix: 评论并转发 (#259)
Fixed #259
2023-11-25 10:42:17 +08:00
shanmite 6dfee7efb8 fix: 出现帐号未登录错误时自动跳转下一个帐号 2023-11-25 10:20:13 +08:00
shanmite 13e847825b docs: 更新CHANGELOG 2023-09-22 09:57:36 +08:00
shanmite 6496a8f0bc fix: fs.close 2023-09-22 09:55:07 +08:00
shanmite 198a69011c docs: 更新CHANGELOG 2023-09-22 07:54:05 +08:00
shanmite e32c3c9e8b fix: 已经关注用户未转发 2023-09-22 07:51:35 +08:00
shanmite 3bd77b3114 fix: fs.close 2023-09-22 07:38:40 +08:00
shanmite 6adc42ae23 docs: 更新CHANGELOG 2023-09-09 16:45:07 +08:00
shanmite 588feba10b docs: update readme 2023-09-09 16:44:17 +08:00
shanmite 5d5858f82b fix: 无法已读未关注未读私信 2023-09-09 16:30:58 +08:00
andywang425andshanmite 1526519e86 docs: 添加gotify推送说明 2023-09-03 17:56:08 +08:00
andywang425andshanmite 69c297ecaa feat: 添加Gotify推送 2023-09-02 18:26:18 +08:00
andywang425andshanmite 201770573e feat: autoAttention API增加对重复关注的处理 2023-09-02 18:26:18 +08:00
shanmite 16c113fd87 docs: update readme 2023-09-01 14:46:59 +08:00
15 changed files with 243 additions and 112 deletions
+1 -1
View File
@@ -31,4 +31,4 @@ jobs:
with:
push: true
tags: ${{ secrets.DOCKERHUB_REPO }}
platforms: "linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/ppc64le,linux/s390x"
platforms: "linux/amd64,linux/arm64"
+55
View File
@@ -1,5 +1,60 @@
<!-- markdownlint-disable MD036 MD024-->
# CHANGELOG
## 主要变化(2.8.16)
* 469a6dc fix: add getOneDynamicByDyid v1
_如果之前版本小于上一版本,请查看[CHANGELOG](https://github.com/shanmiteko/LotteryAutoScript/blob/main/CHANGELOG.md)变更说明_
## 主要变化(2.8.15)
* 7b6356a fix: 风控导致动态全为过时
* d337fb2 fix: 查询动态详情的接口失效 (#349)
* d9dba6f fix: Cannot read properties of null (reading 'is_liked')
* eafa7c7 fix: Cannot read properties of null (reading 'length') (#360)
* e2976cc docs: 文档更新cookie获取方式 (#357)
_如果之前版本小于上一版本,请查看[CHANGELOG](https://github.com/shanmiteko/LotteryAutoScript/blob/main/CHANGELOG.md)变更说明_
## 主要变化(2.8.14)
* f5bdd28 fix: update api getOneDynamicByDyid
* cb6fad0 fix: get_dynamic_detail api (#351)
* 780a3a9 fix: update get_dynamic_detail api (#350)
_如果之前版本小于上一版本,请查看[CHANGELOG](https://github.com/shanmiteko/LotteryAutoScript/blob/main/CHANGELOG.md)变更说明_
## 主要变化(2.8.13)
* addb9c6 fix: ghproxy.com->mirror.ghproxy.com (#333)
* b86e756 fix: at错位
_如果之前版本小于上一版本,请查看[CHANGELOG](https://github.com/shanmiteko/LotteryAutoScript/blob/main/CHANGELOG.md)变更说明_
## 主要变化(2.8.12)
* 5d30178 ci: docker构建
* 0c61070 fix: 评论并转发 (#259)
* 6dfee7e fix: 出现帐号未登录错误时自动跳转下一个帐号
_如果之前版本小于上一版本,请查看[CHANGELOG](https://github.com/shanmiteko/LotteryAutoScript/blob/main/CHANGELOG.md)变更说明_
## 主要变化(2.8.11)
* 6496a8f fix: fs.close
_如果之前版本小于上一版本,请查看[CHANGELOG](https://github.com/shanmiteko/LotteryAutoScript/blob/main/CHANGELOG.md)变更说明_
## 主要变化(2.8.10)
* e32c3c9 fix: 已经关注用户未转发
* 3bd77b3 fix: fs.close
_如果之前版本小于上一版本,请查看[CHANGELOG](https://github.com/shanmiteko/LotteryAutoScript/blob/main/CHANGELOG.md)变更说明_
## 主要变化(2.8.9)
* 588feba docs: update readme
* 5d5858f fix: 无法已读未关注未读私信
* 1526519 docs: 添加gotify推送说明
* 69c297e feat: 添加Gotify推送
* 2017705 feat: autoAttention API增加对重复关注的处理
* 16c113f docs: update readme
_如果之前版本小于上一版本,请查看[CHANGELOG](https://github.com/shanmiteko/LotteryAutoScript/blob/main/CHANGELOG.md)变更说明_
## 主要变化(2.8.8)
* 54af844 fix: 专栏无法获取
+32 -1
View File
@@ -64,6 +64,35 @@
#### 手动获取
第一种
进入[B站主页](https://www.bilibili.com/)点击个人头像进入个人主页获取Cookie用于登录
Chrome浏览器:
进入个人主页后
1. `F12`打开控制台
2. F5刷新
3. 根据图中找到network/网络 搜索nav,点击找到的nav,点标头,下滑,找到COOKIE全部复制
![image](doc/pic/getCookies2.png)
注意!!!!!!!!!!!
注意!!!!!!!!!!!
注意!!!!!!!!!!!
所有网页端获取的COOKIE,每次打开网页端时,都会有概率刷新COOKIE,点击退出账号则会退出当前COOKIE。可以利用Chrome内核的浏览器创建多用户,专门用于获取COOKIE。
注意!!!!!!!!!!!
注意!!!!!!!!!!!
注意!!!!!!!!!!!
第二种
进入[B站主页](https://www.bilibili.com/)获取Cookie用于登录
Chrome浏览器:
@@ -137,7 +166,7 @@ buvid3亦可不填 使用随机生成值
```
1. 运行截图
![lottery_start](https://raw.githubusercontents.com/shanmiteko/LotteryAutoScript/main/doc/pic/lottery_start.png)
![lottery_start](https://raw.githubusercontents.com/shanmiteko/LotteryAutoScript/main/doc/pic/lottery_start.png)
#### 以源码方式运行
@@ -203,6 +232,8 @@ buvid3亦可不填 使用随机生成值
| `SMTP_USER` | 电子邮件 | 发送方的电子邮件 如: `xxxxxxxxx@qq.com` |
| `SMTP_PASS` | 电子邮件 | smtp服务对应的授权码 |
| `SMTP_TO_USER` | 电子邮件 | 接收方电子邮件 |
| `GOTIFY_URL` | gotify推送 | gotify消息推送地址(例如 http://localhost:8008/message)[官方文档](https://gotify.net/docs/) |
| `GOTIFY_APPKEY` | gotify推送 | 一个gotify application的token[官方文档](https://gotify.net/docs/) |
----------------------------------------
Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

+1 -1
View File
@@ -1,7 +1,7 @@
1.初始化
```bash
curl -fsSL https://cdn.staticaly.com/gh/shanmiteko/LotteryAutoScript/main/script/docker/init.sh | sudo sh
curl -fsSL https://ghproxy.com/https://raw.githubusercontent.com/shanmiteko/LotteryAutoScript/main/script/docker/init.sh | sudo bash
```
进入`lottery`文件夹
+7 -5
View File
@@ -12,12 +12,12 @@ module.exports = Object.freeze({
* ## 调试相关
* - `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: {
@@ -37,7 +37,7 @@ module.exports = Object.freeze({
/**
* 为防止环境变量过长, 请将多账号填在此处
* 以 **大括号内容** 为模板依次复制(包含大括号),逗号分割
*
*
* ```txt
* [
* {
@@ -92,6 +92,8 @@ module.exports = Object.freeze({
SMTP_PORT: "",
SMTP_USER: "",
SMTP_PASS: "",
SMTP_TO_USER: ""
SMTP_TO_USER: "",
GOTIFY_URL: "",
GOTIFY_APPKEY: ""
}
})
})
+1 -2
View File
@@ -84,12 +84,11 @@ async function isMe(num) {
}
if (follow_unread) {
log.info('中奖检测', '<-- 正在检查已关注者的私信')
await check(1)
}
if (unfollow_unread) {
log.info('中奖检测', '<-- 正在检查未关注者的私信')
await check(2)
}
await check("1")
log.info('中奖检测', '--> OK');
}
if (desp) {
+19 -4
View File
@@ -56,6 +56,9 @@ class Monitor extends Searcher {
case 1001:
event_bus.emit('Turn_off_the_Monitor', '评论失败')
break;
case 1010:
event_bus.emit('Turn_off_the_Monitor', '已掉号')
break;
case 1004:
event_bus.emit('Turn_off_the_Monitor', '需要输入验证码')
break
@@ -194,7 +197,6 @@ class Monitor extends Searcher {
case 1007:
case 1008:
case 1009:
case 1010:
case 1011:
case 2002:
case 2003:
@@ -217,6 +219,7 @@ class Monitor extends Searcher {
is_outof_maxfollow = 2005
break;
case 1001:
case 1010:
case 1004:
case 2001:
case 3001:
@@ -367,7 +370,7 @@ class Monitor extends Searcher {
}
/* 超过指定时间退出 */
if (now_ts - create_time > max_create_time * 86400) {
if (create_time && now_ts - create_time > max_create_time * 86400) {
log.info("筛选动态", `过时动态(https://t.bilibili.com/${dyid})`)
return false
}
@@ -593,6 +596,10 @@ class Monitor extends Searcher {
.replace(
new RegExp(copy_chat[0], 'g'),
global_var.get("myUNAME") || '')
} else {
if (is_repost_then_chat) {
chat = chat + relay_chat
}
}
status = await retryfn(
@@ -600,7 +607,7 @@ class Monitor extends Searcher {
[4],
() => bili.sendChatWithOcr(
rid,
is_repost_then_chat ? relay_chat.split('//')[0] : chat,
chat,
chat_type
)
)
@@ -624,6 +631,10 @@ class Monitor extends Searcher {
if (uid.length) {
await try_for_each(uid, async (u) => {
status = await bili.autoAttention(u)
if (status === 6) {
status = 0;
return false
}
if (status) {
log.warn("抽奖信息", `dyid: ${dyid}, uid: ${u}`)
return true
@@ -664,7 +675,11 @@ class Monitor extends Searcher {
status = await retryfn(
5,
[3, 4],
() => bili.autoRelay(global_var.get("myUID"), dyid, relay_chat, ctrl)
() => bili.autoRelay(
global_var.get("myUID"),
dyid,
relay_chat,
ctrl)
)
if (status) {
+4 -4
View File
@@ -63,11 +63,11 @@ function parseDynamicCard(dynamic_detail_card) {
/**临时储存单个动态中的信息 */
let obj = {};
const { desc, card, extension, extend_json = "{}", display = {} } = dynamic_detail_card
, { is_liked = 1, user_profile = {} } = desc
, { is_liked = 1, user_profile = {} } = desc || {}
, { info = {} } = user_profile
, cardToJson = strToJson(card)
, extendjsonToJson = strToJson(extend_json)
, { add_on_card_info = [] } = display
, { add_on_card_info = [] } = display || {}
, { item } = cardToJson;
const dy_type2chat_type = new Map([[1, 17], [2, 11], [4, 17], [8, 1], [64, 12]]);
/* 转发者的UID */
@@ -192,14 +192,14 @@ function parseDynamicCard(dynamic_detail_card) {
function modifyDynamicRes(res) {
const
{ data, code } = utils.strToJson(res),
{ cards = [], has_more, offset } = data || {};
{ cards, has_more, offset } = data || {};
if (code !== 0) {
log.error('处理动态数据', '获取动态数据出错,可能是访问太频繁 \n' + res);
return null;
}
if (!cards.length) {
if (cards == null || !cards || !cards.lengh) {
log.warn('处理动态数据', '未找到任何动态信息')
}
+53 -2
View File
@@ -80,6 +80,13 @@ let SMTP_USER = '';
let SMTP_PASS = '';
let SMTP_TO_USER = '';
// ====================================Gotify======================================
// 官方文档:https://gotify.net/docs/pushmsg
// 此处填你的Gotify消息推送地址(例如:http://localhost/message
let GOTIFY_URL = '';
// 此处填你想推送的Application的Token(不包含推送时额外添加的前缀 Bearer )
let GOTIFY_APPKEY = '';
//==========================云端环境变量的判断与接收=========================
if (process.env.SCKEY) {
SCKEY = process.env.SCKEY;
@@ -190,6 +197,13 @@ if (process.env.SMTP_TO_USER) {
SMTP_TO_USER = process.env.SMTP_TO_USER;
}
if (process.env.GOTIFY_URL) {
GOTIFY_URL = process.env.GOTIFY_URL;
if (process.env.GOTIFY_APPKEY) {
GOTIFY_APPKEY = process.env.GOTIFY_APPKEY
}
}
//==========================云端环境变量的判断与接收=========================
async function sendNotify(text, desp, params = {}) {
@@ -223,7 +237,9 @@ async function sendNotify(text, desp, params = {}) {
// Qmsg
qmsg(text, desp),
//电子邮件
email(text, desp)
email(text, desp),
// Gotify
gotifyNotify(text, desp)
])
}
@@ -820,6 +836,41 @@ function pushPlusNotify(text, desp) {
})
}
function gotifyNotify(text, desp) {
return new Promise(resolve => {
if (GOTIFY_APPKEY) {
send({
method: 'POST',
url: GOTIFY_URL,
contents: {
title: text,
message: desp,
},
config: {
retry: false
},
headers: {
accept: 'application/json, text/plain, */*',
'content-type': 'application/json',
'authorization': 'Bearer ' + GOTIFY_APPKEY
},
success: () => {
// HTTP 响应码 200 就说明成功了
log.info('发送通知', 'Gotify 发送通知消息成功')
resolve();
},
failure: err => {
log.error('发送通知', 'Gotify 发送通知调用API失败!!' + err)
resolve();
}
})
} else {
log.debug('发送通知', '您未提供Gotify推送所需的GOTIFY_APPKEY,取消Gotify推送消息通知');
resolve()
}
})
}
async function qmsg(text, desp) {
return new Promise(resolve => {
if (QMSG_KEY) {
@@ -889,4 +940,4 @@ async function email(text, desp) {
}
}
module.exports = { sendNotify }
module.exports = { sendNotify }
+2 -7
View File
@@ -5,12 +5,7 @@ module.exports = Object.freeze({
DYNAMIC_REPOST_SHARE: 'https://api.vc.bilibili.com/dynamic_repost/v1/dynamic_repost/share',
DYNAMIC_SVR_CREATE_DRAW: 'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/create_draw',
DYNAMIC_SVR_CREATE: 'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/create',
DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V2: 'https://api.vc.bilibili.com/dynamic_svr/v2/dynamic_svr/get_dynamic_detail',
DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V3: 'https://api.vc.bilibili.com/dynamic_svr/v3/dynamic_svr/get_dynamic_detail',
DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V4: 'https://api.vc.bilibili.com/dynamic_svr/v4/dynamic_svr/get_dynamic_detail',
DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V5: 'https://api.vc.bilibili.com/dynamic_svr/v5/dynamic_svr/get_dynamic_detail',
DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V6: 'https://api.vc.bilibili.com/dynamic_svr/v6/dynamic_svr/get_dynamic_detail',
DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V7: 'https://api.vc.bilibili.com/dynamic_svr/v7/dynamic_svr/get_dynamic_detail',
DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V: 'https://api.vc.bilibili.com/dynamic_svr/v{{v}}/dynamic_svr/get_dynamic_detail',
DYNAMIC_SVR_RM_DYNAMIC: 'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/rm_dynamic',
DYNAMIC_SVR_SPACE_HISTORY: 'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history',
FEED_GET_ATTENTION_LIST: 'https://api.vc.bilibili.com/feed/v1/feed/get_attention_list',
@@ -43,4 +38,4 @@ module.exports = Object.freeze({
WEB_INTERFACE_CARD: 'https://api.bilibili.com/x/web-interface/card',
WEB_INTERFACE_NAV_STAT: "https://api.bilibili.com/x/web-interface/nav/stat",
WEB_INTERFACE_SEARCH_TYPE: 'https://api.bilibili.com/x/web-interface/search/type',
})
})
+63 -82
View File
@@ -259,11 +259,11 @@ const bili_client = {
* @property {number} sender_uid
* @property {number} talker_id
* @property {number} msg_seqno
*
*
* @typedef SessionInfo
* @property {number} has_more
* @property {SessionData[]} data
*
*
* @param {number} session_type 1 已关注 2 未关注 3 应援团
* @param {string} [ts_16]
* @returns {Promise<SessionInfo>}
@@ -397,7 +397,7 @@ const bili_client = {
}
},
/**
* @param {string} short_id
* @param {string} short_id
* @returns {Promise<string>}
*/
async shortDynamicIdToDyid(short_id) {
@@ -412,67 +412,45 @@ const bili_client = {
return dyid
})
},
_getOneDynamicByDyid: new Line('获取一个动态的细节', [
(dynamic_id) => get({
url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V2,
config: { retry: false },
query: {
dynamic_id
}
}),
(dynamic_id) => get({
url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V3,
config: { retry: false },
query: {
dynamic_id
}
}),
(dynamic_id) => get({
url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V4,
config: { retry: false },
query: {
dynamic_id
}
}),
(dynamic_id) => get({
url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V5,
config: { retry: false },
query: {
dynamic_id
}
}),
(dynamic_id) => get({
url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V6,
config: { retry: false },
query: {
dynamic_id
}
}),
(dynamic_id) => get({
url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V7,
config: { retry: false },
query: {
dynamic_id
}
}),
], responseText => {
const
res = strToJson(responseText),
{ code, data } = res,
{ card } = data || {};
switch (code) {
case 0:
if (card) {
return [false, card, `ok`];
} else {
return [false, undefined, `动态不存在`];
_getOneDynamicByDyid: new Line(
'获取一个动态的细节',
[
(dynamic_id) => get({
url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V.replace('{{v}}', 1),
config: { retry: false },
query: {
dynamic_id
}
case 500207:
return [false, undefined, `该动态为包月充电专属可以给UP主充电后观看`];
default:
return [true, undefined, `获取动态数据出错:\n${responseText}`]
}
}),
}),
...Array(10)
.fill(
(dynamic_id) => get({
url: API.DYNAMIC_SVR_GET_DYNAMIC_DETAIL_V.replace('{{v}}', Math.floor(Math.random() * 10 ** 10)),
config: { retry: false },
query: {
dynamic_id
}
})
)
]
, responseText => {
const
res = strToJson(responseText),
{ code, data } = res,
{ card } = data || {};
switch (code) {
case 0:
if (card) {
return [false, card, `ok`];
} else {
return [false, undefined, `动态不存在`];
}
case 500207:
return [false, undefined, `该动态为包月充电专属可以给UP主充电后观看`];
default:
return [true, undefined, `获取动态数据出错:\n${responseText}`]
}
}),
/**
* 获取一个动态的细节
* @param {string} dynamic_id
@@ -737,6 +715,8 @@ const bili_client = {
return [false, 4, '账号异常']
case 22009:
return [false, 5, '关注已达上限']
case 22014:
return [false, 6, '已经关注用户,无法重复关注']
default:
return [true, 1, `未知错误\n${responseText}`]
}
@@ -748,12 +728,13 @@ const bili_client = {
* @param {Number} uid
* 被关注者的UID
* @returns {Promise<number>}
* - 成功 0
* - 未知错误 1
* - 您已被对方拉入黑名单 2
* - 黑名单用户无法关注 3
* - 账号异常 4
* - 关注已达上限 5
* - 成功 0
* - 未知错误 1
* - 您已被对方拉入黑名单 2
* - 黑名单用户无法关注 3
* - 账号异常 4
* - 关注已达上限 5
* - 已经关注用户 6
*/
autoAttention(uid) {
return this._autoAttention.run(uid)
@@ -763,8 +744,8 @@ const bili_client = {
* @param {number} uid
* @param {number} tagid 关注分区的ID
* @returns {Promise<number>}
* - 成功 0
* - 失败 1
* - 成功 0
* - 失败 1
*/
async movePartition(uid, tagid) {
const responseText = await post({
@@ -816,7 +797,7 @@ const bili_client = {
* 动态自动点赞
* @param {string} dyid
* @returns {Promise<number>}
* - 成功 0
* - 成功 0
* - 未知错误 1
* - 点赞异常 2
* - 点赞频繁 3
@@ -865,11 +846,11 @@ const bili_client = {
* @param {string} [msg]
* 动态的ID
* @returns {Promise<number>}
* - 成功 0
* - 未知错误 1
* - 该动态不能转发分享 2
* - 请求数据发生错误,请刷新或稍后重试 3
* - 操作太频繁了,请稍后重试 4
* - 成功 0
* - 未知错误 1
* - 该动态不能转发分享 2
* - 请求数据发生错误,请刷新或稍后重试 3
* - 操作太频繁了,请稍后重试 4
*/
async autoRelay(uid, dyid, msg = '转发动态', ctrl = '[]') {
const len = msg.length;
@@ -912,7 +893,7 @@ const bili_client = {
/**
* 预约抽奖
* @param {string} reserve_id
* @returns
* @returns
*/
async reserve_lottery(reserve_id) {
const
@@ -1238,9 +1219,9 @@ const bili_client = {
}
},
/**
* 检查分区
* 不存在指定分区时创建
* 获取到tagid添加为对象的属性
* 检查分区
* 不存在指定分区时创建
* 获取到tagid添加为对象的属性
* @param {string} [name]
* @returns {Promise<number>}
*/
@@ -1332,4 +1313,4 @@ const bili_client = {
};
module.exports = bili_client
module.exports = bili_client
+1 -1
View File
@@ -68,7 +68,7 @@ async function update(isDdownload) {
if (download_url.length) {
if (isDdownload) {
await try_for_each(download_url.entries(), async ([i, url]) => {
let proxy_url = "https://ghproxy.com/";
let proxy_url = "https://mirror.ghproxy.com/";
proxy_url += url
log.warn('自动下载', `切换代理${proxy_url}`)
await download(proxy_url, `latest_version${i}.zip`)
+3 -1
View File
@@ -44,7 +44,8 @@ const utils = {
try {
const obj = JSON.parse(str);
return typeof obj === 'object' ? obj : false
} catch (_) {
} catch (e) {
utils.log.error("json解析", e + "\n" + params)
return false;
}
} else {
@@ -383,6 +384,7 @@ const utils = {
rejects(err)
} else {
fs.write(fd, buffer, 0, buffer.length, 0, err => {
fs.close(fd)
if (err) {
rejects(err)
} else {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "lottery-auto-script",
"version": "2.8.8",
"version": "2.8.16",
"description": "自动参与B站动态抽奖",
"main": "main.js",
"scripts": {