Skip to content
Merged

7.3.2 #641

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

## [7.3.2] - 2026-7-13

### 新增

- 直播任务【点赞】新增每日点赞数量上限 5000(因为每天能完成任务的有效点赞数量为 5000 次)

## [7.3.1] - 2026-6-25

### 新增
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bilibili-live-tasks-helper",
"private": true,
"version": "7.3.1",
"version": "7.3.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
92 changes: 47 additions & 45 deletions src/assets/css/element-dark-css-vars.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,54 @@
html[lab-style*='dark'] {
color-scheme: dark;

--lightningcss-light: ;
--lightningcss-dark: initial;
--el-color-primary: #409eff;
--el-color-primary-light-3: rgb(51 117 185);
--el-color-primary-light-5: rgb(42 89 138);
--el-color-primary-light-7: rgb(33 61 91);
--el-color-primary-light-8: rgb(29 48 67);
--el-color-primary-light-9: rgb(24 34 43);
--el-color-primary-dark-2: rgb(102 177 255);
--el-color-primary-light-3: #3375b9;
--el-color-primary-light-5: #2a598a;
--el-color-primary-light-7: #213d5b;
--el-color-primary-light-8: #1d3043;
--el-color-primary-light-9: #18222b;
--el-color-primary-dark-2: #66b1ff;
--el-color-success: #67c23a;
--el-color-success-light-3: rgb(78 142 47);
--el-color-success-light-5: rgb(62 107 39);
--el-color-success-light-7: rgb(45 72 31);
--el-color-success-light-8: rgb(37 55 28);
--el-color-success-light-9: rgb(28 37 24);
--el-color-success-dark-2: rgb(133 206 97);
--el-color-success-light-3: #4e8e2f;
--el-color-success-light-5: #3e6b27;
--el-color-success-light-7: #2d481f;
--el-color-success-light-8: #25371c;
--el-color-success-light-9: #1c2518;
--el-color-success-dark-2: #85ce61;
--el-color-warning: #e6a23c;
--el-color-warning-light-3: rgb(167 119 48);
--el-color-warning-light-5: rgb(125 91 40);
--el-color-warning-light-7: rgb(83 63 32);
--el-color-warning-light-8: rgb(62 48 28);
--el-color-warning-light-9: rgb(41 34 24);
--el-color-warning-dark-2: rgb(235 181 99);
--el-color-warning-light-3: #a77730;
--el-color-warning-light-5: #7d5b28;
--el-color-warning-light-7: #533f20;
--el-color-warning-light-8: #3e301c;
--el-color-warning-light-9: #292218;
--el-color-warning-dark-2: #ebb563;
--el-color-danger: #f56c6c;
--el-color-danger-light-3: rgb(178 82 82);
--el-color-danger-light-5: rgb(133 64 64);
--el-color-danger-light-7: rgb(88 46 46);
--el-color-danger-light-8: rgb(65 38 38);
--el-color-danger-light-9: rgb(42 29 29);
--el-color-danger-dark-2: rgb(247 137 137);
--el-color-danger-light-3: #b25252;
--el-color-danger-light-5: #854040;
--el-color-danger-light-7: #582e2e;
--el-color-danger-light-8: #412626;
--el-color-danger-light-9: #2a1d1d;
--el-color-danger-dark-2: #f78989;
--el-color-error: #f56c6c;
--el-color-error-light-3: rgb(178 82 82);
--el-color-error-light-5: rgb(133 64 64);
--el-color-error-light-7: rgb(88 46 46);
--el-color-error-light-8: rgb(65 38 38);
--el-color-error-light-9: rgb(42 29 29);
--el-color-error-dark-2: rgb(247 137 137);
--el-color-error-light-3: #b25252;
--el-color-error-light-5: #854040;
--el-color-error-light-7: #582e2e;
--el-color-error-light-8: #412626;
--el-color-error-light-9: #2a1d1d;
--el-color-error-dark-2: #f78989;
--el-color-info: #909399;
--el-color-info-light-3: rgb(107 109 113);
--el-color-info-light-5: rgb(82 84 87);
--el-color-info-light-7: rgb(57 58 60);
--el-color-info-light-8: rgb(45 45 47);
--el-color-info-light-9: rgb(32 33 33);
--el-color-info-dark-2: rgb(166 169 173);
--el-box-shadow: 0px 12px 32px 4px rgb(0 0 0 / 36%), 0px 8px 20px rgb(0 0 0 / 72%);
--el-box-shadow-light: 0px 0px 12px rgb(0 0 0 / 72%);
--el-box-shadow-lighter: 0px 0px 6px rgb(0 0 0 / 72%);
--el-box-shadow-dark:
0px 16px 48px 16px rgb(0 0 0 / 72%), 0px 12px 32px #000, 0px 8px 16px -8px #000;
--el-color-info-light-3: #6b6d71;
--el-color-info-light-5: #525457;
--el-color-info-light-7: #393a3c;
--el-color-info-light-8: #2d2d2f;
--el-color-info-light-9: #202121;
--el-color-info-dark-2: #a6a9ad;
--el-box-shadow: 0px 12px 32px 4px #0000005c, 0px 8px 20px #000000b8;
--el-box-shadow-light: 0px 0px 12px #000000b8;
--el-box-shadow-lighter: 0px 0px 6px #000000b8;
--el-box-shadow-dark: 0px 16px 48px 16px #000000b8, 0px 12px 32px #000, 0px 8px 16px -8px #000;
--el-bg-color-page: #0a0a0a;
--el-bg-color: #141414;
--el-bg-color-overlay: #1d1e1f;
Expand All @@ -70,17 +71,18 @@ html[lab-style*='dark'] {
--el-fill-color-light: #262727;
--el-fill-color-lighter: #1d1d1d;
--el-fill-color-extra-light: #191919;
--el-fill-color-blank: transparent;
--el-mask-color: rgb(0 0 0 / 80%);
--el-mask-color-extra-light: rgb(0 0 0 / 30%);
--el-fill-color-blank: #141414;
--el-mask-color: #000c;
--el-mask-color-extra-light: #0000004d;
}

html[lab-style*='dark'] .el-button {
--el-button-disabled-text-color: rgb(255 255 255 / 50%);
--el-button-disabled-text-color: #ffffff80;
}

html[lab-style*='dark'] .el-card {
--el-card-bg-color: var(--el-bg-color-overlay);
--el-fill-color-blank: var(--el-card-bg-color);
}

html[lab-style*='dark'] .el-empty {
Expand Down
1 change: 0 additions & 1 deletion src/library/bili-api/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Live, LiveTrace, Main } from './response'
interface Requests {
live: Request
liveTrace: Request
passport: Request
main: Request
raw: Request
}
Expand Down
1 change: 0 additions & 1 deletion src/library/bili-api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import _ from 'lodash'
const request: Requests = {
live: new Request('https://api.live.bilibili.com', 'https://live.bilibili.com'),
liveTrace: new Request('https://live-trace.bilibili.com', 'https://live.bilibili.com'),
passport: new Request('https://passport.bilibili.com', 'https://passport.bilibili.com'),
main: new Request('https://api.bilibili.com', 'https://www.bilibili.com'),
raw: new Request(),
}
Expand Down
17 changes: 13 additions & 4 deletions src/library/help-info/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const helpInfo: HelpInfo = {
h('li', '点赞、发弹幕和观看直播任务都会等点亮熄灭勋章任务完成后再执行。'),
h(
'li',
'熄灭的勋章被点亮后,通过完成任务获得的亲密度会被储蓄,且储蓄量存在上限(根据目前观察上限是100)。需要投喂一个粉丝灯牌才能领取这些亲密度。脚本会在控制台日志中提示储蓄的亲密度量以及是否达到上限。',
'熄灭的勋章被点亮后,通过完成任务获得的亲密度会被储蓄,且储蓄量存在上限(根据观察上限是100)。需要投喂一个粉丝灯牌才能领取这些亲密度。脚本会在控制台日志中提示储蓄的亲密度量以及是否达到上限。',
),
]),
]),
Expand All @@ -131,7 +131,7 @@ const helpInfo: HelpInfo = {
h('p', [
h(
'div',
'一轮指通过完成任务获得 +1 亲密度所需的最小操作量。具体值脚本会在运行过程中实时获取。根据观察目前每轮的操作量如下:',
'一轮指通过完成任务获得 +1 亲密度所需的最小操作量。具体值脚本会在运行过程中实时获取。根据观察每轮的操作量如下:',
),
h('ul', [
h('li', '点赞:30 次'),
Expand All @@ -153,7 +153,16 @@ const helpInfo: HelpInfo = {
message: () =>
h('p', [
h('div', '为已点亮的粉丝勋章完成粉丝团升级任务中的点赞任务。'),
h('div', '只有主播开播时点赞才会计入任务进度。'),
h('ul', [
h(
'li',
'只有在主播开播时点赞才会计入任务进度,因此脚本默认只给正在直播的主播点赞。',
),
h(
'li',
'根据观察每个账号一天最多进行 5000 次有效点赞(能完成任务的点赞),达到点赞上限后点赞任务视为完成。',
),
]),
]),
},
likeWaitUntilLiving: {
Expand Down Expand Up @@ -264,7 +273,7 @@ const helpInfo: HelpInfo = {
h('div', '禁用直播流的P2P上传/下载'),
h(
'div',
'B站使用WebRTC技术把许多浏览器点对点(P2P)地连接起来,实现视频流和音频流的传输。这样做是为了减轻B站服务器的压力,但是会占用你一定的上行带宽(大约几百kb每秒)。如果你不想被占用上行带宽,可以开启该功能。若开启后发现观看直播时有明显卡顿,请关闭。',
'B站使用WebRTC技术把许多浏览器点对点(P2P)地连接起来,实现视频流和音频流的传输。这样做是为了减轻B站服务器的压力,但是会占用你一定的上行带宽(大约几百KB每秒)。如果你不想被占用上行带宽,可以开启该功能。若开启后发现观看直播时有明显卡顿,请关闭。',
),
]),
},
Expand Down
11 changes: 7 additions & 4 deletions src/library/request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ class Request {
/** 请求 URL 的前缀 */
private readonly url_prefix: string
/**
* 请求 Header 中 Origin 的值,为了方便同时也是 Referer 的值
* 请求 Header 中 Origin 的值
*
* 会在末尾添加 `/` 作为 Referer 的值
*/
private readonly origin: string

Expand Down Expand Up @@ -35,7 +37,7 @@ class Request {
responseType: 'json',
headers: {
Accept: 'application/json, text/plain, */*',
Referer: this.origin,
Referer: this.origin + '/',
Origin: this.origin,
'Sec-Fetch-Site': 'same-site',
},
Expand Down Expand Up @@ -69,7 +71,7 @@ class Request {
): Promise<T> {
const headers: Record<string, string> = {
Accept: 'application/json, text/plain, */*',
Referer: this.origin,
Referer: this.origin + '/',
Origin: this.origin,
'Sec-Fetch-Site': 'same-site',
'Content-Type': 'application/x-www-form-urlencoded',
Expand All @@ -78,7 +80,8 @@ class Request {
if (_.isNil(data)) {
data = ''
} else if (data instanceof FormData) {
// 如果要提交表单,删除 Content-Type 让浏览器自动生成
// data 为 FormData 时以 multipart/form-data 形式提交,
// 删除手动设置的 Content-Type,交由底层 XHR 根据 FormData 自动生成带 boundary 的请求头
delete headers['Content-Type']
} else if (typeof data === 'string') {
// data 类型为 string,不做处理
Expand Down
2 changes: 2 additions & 0 deletions src/library/storage/defaultValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ const defaultValues: DefaultValues = {
waitUntilLiving: false,
isWhiteList: false,
roomidList: [],
_lastSuccessLikeTime: 0,
_todayLikeCount: 0,
_lastCompleteTime: 0,
},
danmu: {
Expand Down
6 changes: 3 additions & 3 deletions src/modules/dailyTasks/liveTasks/medalTasks/MedalModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ class MedalModule extends BaseModule {
for (let i = 0; i < roomids.length; i++) {
if (MedalModule.shouldStopForCrossDay()) {
this.logger.log('即将或刚刚发生跨天,不再等待剩余直播间,提早结束本轮任务')
return { stop: true }
return { stop: true, markUncompleted: true }
}

const roomid = roomids[i]
Expand Down Expand Up @@ -572,8 +572,8 @@ class MedalModule extends BaseModule {
)
const action = await runOne(medal)

if (action === 'stop') {
return { stop: true }
if (action === 'stop' || action === 'stopAndMarkUncompleted') {
return { stop: true, markUncompleted: action === 'stopAndMarkUncompleted' }
} else if (action === 'markUncompleted') {
markUncompleted = true
}
Expand Down
38 changes: 17 additions & 21 deletions src/modules/dailyTasks/liveTasks/medalTasks/danmuTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class DanmuTask extends MedalModule {
): Promise<AfterExecutionAction | Exclude<AfterExecutionAction, 'requeue'>> {
if (MedalModule.shouldStopForCrossDay()) {
this.logger.log('即将或刚刚发生跨天,提早结束本轮发弹幕任务')
return 'stop'
return 'stopAndMarkUncompleted'
}

const room_id = medal.room_info.room_id
Expand Down Expand Up @@ -150,7 +150,7 @@ class DanmuTask extends MedalModule {
for (let j = 0; j < remaining; j++) {
if (MedalModule.shouldStopForCrossDay()) {
this.logger.log('即将或刚刚发生跨天,提早结束本轮发弹幕任务')
return 'stop'
return 'stopAndMarkUncompleted'
}

const danmuText = this.config.danmuList[danmuIndexRef.value++ % this.config.danmuList.length]
Expand All @@ -170,13 +170,13 @@ class DanmuTask extends MedalModule {
}

if (hasSuccessfulDanmu) {
return (await this.confirmTaskCompletedAfterUpdate(
const taskCompleted = await this.confirmTaskCompletedAfterUpdate(
medal,
'sendDanmu',
this.config.useTargetRounds ? target : undefined,
))
? null
: 'markUncompleted'
)

return taskCompleted ? null : 'markUncompleted'
}

// 所有发弹幕尝试均失败,估计是有什么异常状况,跳过
Expand All @@ -197,8 +197,8 @@ class DanmuTask extends MedalModule {

for (let i = 0; i < medals.length; i++) {
const action = await this.executeDanmuTask(medals[i], danmuIndexRef)
if (action === 'stop') {
return { stop: true }
if (action === 'stop' || action === 'stopAndMarkUncompleted') {
return { stop: true, markUncompleted: action === 'stopAndMarkUncompleted' }
} else if (action === 'requeue') {
requeueRoomids.push(medals[i].room_info.room_id)
} else if (action === 'markUncompleted') {
Expand Down Expand Up @@ -238,29 +238,25 @@ class DanmuTask extends MedalModule {
danmuIndexRef,
)

if (stop) {
if (markUncompleted) {
allCompleted = false
} else {
if (markUncompleted) {
allCompleted = false
}
if (requeueRoomids) {
pendingRoomids.push(...requeueRoomids)
}

}
if (requeueRoomids) {
pendingRoomids.push(...requeueRoomids)
}
if (!stop) {
while (pendingRoomids.length > 0) {
const { stop, markUncompleted, requeueRoomids } = await this.runWaitingRound(
pendingRoomids,
(liveStatus) => liveStatus !== 1,
(medal) => this.executeDanmuTask(medal, danmuIndexRef, true),
)
if (stop) {
allCompleted = false
break
}
if (markUncompleted) {
allCompleted = false
}
if (stop) {
break
}

pendingRoomids = requeueRoomids!

Expand Down
Loading