[update] Version 2.5.0

This commit is contained in:
Lkeme 2025-08-23 13:13:26 +08:00
parent 7d117f3ebe
commit 0f45c34d63
12 changed files with 136 additions and 75 deletions

View File

@ -29,7 +29,7 @@
<p align=center> <p align=center>
<img src="https://img.shields.io/badge/Version-2.4.5.250218-orange.svg?longCache=true&style=for-the-badge" alt=""> <img src="https://img.shields.io/badge/Version-2.5.0.250823-orange.svg?longCache=true&style=for-the-badge" alt="">
<img src="https://img.shields.io/badge/PHP-8.1+-green.svg?longCache=true&style=for-the-badge" alt=""> <img src="https://img.shields.io/badge/PHP-8.1+-green.svg?longCache=true&style=for-the-badge" alt="">
<img src="https://img.shields.io/badge/Composer-latest-blueviolet.svg?longCache=true&style=for-the-badge" alt=""> <img src="https://img.shields.io/badge/Composer-latest-blueviolet.svg?longCache=true&style=for-the-badge" alt="">
<img src="https://img.shields.io/badge/License-mit-blue.svg?longCache=true&style=for-the-badge" alt=""> <img src="https://img.shields.io/badge/License-mit-blue.svg?longCache=true&style=for-the-badge" alt="">

View File

@ -14,9 +14,9 @@ case ${MIRRORS} in
git remote set-url origin https://github.com/lkeme/BiliHelper-personal.git git remote set-url origin https://github.com/lkeme/BiliHelper-personal.git
;; ;;
"1") "1")
# https://gitdl.cn/ # https://ghfast.top/
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-gitdl.cn(ESP|西班牙) ${Font} \n ======== \n" echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-ghfast.top(US|美国) ${Font} \n ======== \n"
git remote set-url origin https://gitdl.cn/https://github.com/lkeme/BiliHelper-personal.git git remote set-url origin https://ghfast.top/https://github.com/lkeme/BiliHelper-personal.git
;; ;;
"2") "2")
# http://gitclone.com/ # http://gitclone.com/
@ -24,19 +24,19 @@ case ${MIRRORS} in
git remote set-url origin https://gitclone.com/github.com/lkeme/BiliHelper-personal.git git remote set-url origin https://gitclone.com/github.com/lkeme/BiliHelper-personal.git
;; ;;
"3") "3")
# https://gh.api.99988866.xyz/ # https://gh-proxy.com/
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-gh.api.99988866.xyz(US|美国) ${Font} \n ======== \n" echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-gh-proxy.com(US|美国) ${Font} \n ======== \n"
git remote set-url origin https://gh.api.99988866.xyz/https://github.com/lkeme/BiliHelper-personal.git git remote set-url origin https://gh-proxy.com/https://github.com/lkeme/BiliHelper-personal.git
;; ;;
"4") "4")
# https://githubfast.com/ # https://githubfast.com/
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-githubfast.com(SG|新加坡) ${Font} \n ======== \n" echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-githubfast.com(KR|韩国) ${Font} \n ======== \n"
git remote set-url origin https://githubfast.com/lkeme/BiliHelper-personal.git git remote set-url origin https://githubfast.com/lkeme/BiliHelper-personal.git
;; ;;
"5") "5")
# https://github.moeyy.xyz/ # https://hub.gitmirror.com/
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-github.moeyy.xyz(SG|新加坡) ${Font} \n ======== \n" echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-hub.gitmirror.com(US|美国) ${Font} \n ======== \n"
git remote set-url origin https://github.moeyy.xyz/https://github.com/lkeme/BiliHelper-personal.git git remote set-url origin https://hub.gitmirror.com/https://github.com/lkeme/BiliHelper-personal.git
;; ;;
*) *)
echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-github.com(RAW|源站) ${Font} \n ======== \n" echo -e "\n ======== \n ${Info} ${GreenBG} 切换源-github.com(RAW|源站) ${Font} \n ======== \n"

View File

@ -8,6 +8,28 @@
[comment]: <> (</details>) [comment]: <> (</details>)
## v2.5.0.250823 alpha (2025-08-23)
### Added
-
### Changed
- 更新设备信息
- 更新Docker加速镜像
- 更新Github加速镜像
- 删除过期活动,保留一个活动模板
### Fixed
- 尝试修复大会员大积分签到信息错误
- 尝试修复年度大会员领取权益失败
### Remarks
-
## v2.4.5.250218 alpha (2025-02-18) ## v2.4.5.250218 alpha (2025-02-18)
### Added ### Added

View File

@ -201,15 +201,9 @@ $ php app.php test m:d -P VipPoint,Lottery # 多个插件
```json ```json
{ {
"registry-mirrors": [ "registry-mirrors": [
"https://0b27f0a81a00f3560fbdc00ddd2f99e0.mirror.swr.myhuaweicloud.com", "https://docker.1ms.run",
"https://dockerproxy.com", "https://docker.1panel.live",
"https://hub-mirror.c.163.com", "https://hub.rat.dev"
"https://mirror.baidubce.com",
"https://oyukeh0j.mirror.aliyuncs.com",
"https://ypzju6vq.mirror.aliyuncs.com",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn"
] ]
} }
@ -259,11 +253,11 @@ $ -e VERSION=2 # 使用 版本 V2.x.x(默认选项)
```shell script ```shell script
$ -e MIRRORS=0 # 使用 github.com(RAW|源站|默认) $ -e MIRRORS=0 # 使用 github.com(RAW|源站|默认)
$ -e MIRRORS=1 # 使用 gitdl.cn(ESP|西班牙) $ -e MIRRORS=1 # 使用 ghfast.top(US|美国)
$ -e MIRRORS=2 # 使用 gitclone.com(CN|中国) $ -e MIRRORS=2 # 使用 gitclone.com(CN|中国)
$ -e MIRRORS=3 # 使用 gh.api.99988866.xyz(US|美国) $ -e MIRRORS=3 # 使用 gh-proxy.com(US|美国)
$ -e MIRRORS=4 # 使用 githubfast.com(KR|韩国) $ -e MIRRORS=4 # 使用 githubfast.com(KR|韩国)
$ -e MIRRORS=5 # 使用 github.moeyy.xyz(HK|香港) $ -e MIRRORS=5 # 使用 hub.gitmirror.com(US|美国)
$ -e MIRRORS=custom -e CUSTOM_CLONE_URL=https://github.com/lkeme/BiliHelper-personal.git # 使用 自定义克隆地址 $ -e MIRRORS=custom -e CUSTOM_CLONE_URL=https://github.com/lkeme/BiliHelper-personal.git # 使用 自定义克隆地址
``` ```

View File

@ -33,10 +33,6 @@ trait PointInfo
$score_limit = $data['data']['task_info']['score_limit']; $score_limit = $data['data']['task_info']['score_limit'];
$score_month = $data['data']['task_info']['score_month']; $score_month = $data['data']['task_info']['score_month'];
Log::notice("大会员积分@$name: 本月已经获得 $score_month/$score_limit 大积分"); Log::notice("大会员积分@$name: 本月已经获得 $score_month/$score_limit 大积分");
//
$base_score = $data['data']['task_info']['sing_task_item']['base_score'];
$sign_count = $data['data']['task_info']['sing_task_item']['count'];
Log::notice("大会员积分@$name: 已连续签到 $sign_count 天 获取到 $base_score 个大积分");
return true; return true;
} }

View File

@ -17,6 +17,7 @@
use Bhp\Api\Api\Pgc\Activity\Score\ApiTask; use Bhp\Api\Api\Pgc\Activity\Score\ApiTask;
use Bhp\Api\Api\X\VipPoint\ApiTask as VipPointApiTask;
use Bhp\Log\Log; use Bhp\Log\Log;
trait SignIn trait SignIn
@ -44,13 +45,20 @@ trait SignIn
*/ */
protected function _signIn(string $name): bool protected function _signIn(string $name): bool
{ {
// {"code":xxxx,"message":"xxxxx"}
// {"code":0,"message":"success"} // {"code":0,"message":"success"}
// {"code":6007000,"message":"签到失败,请刷新重试"} 判断为重复签到
$response = ApiTask::sign(); $response = ApiTask::sign();
//
if ($response['code']) { if ($response['code']) {
Log::warning("大会员积分@{$name}: 签到失败" . json_encode($response)); if (isset($response['message']) && $response['message'] == '签到失败,请刷新重试') {
Log::warning("大会员积分@{$name}: 今日已签到,重复签到");
return true;
}
Log::warning("大会员积分@{$name}: 签到失败,错误码 {$response['code']} " . json_encode($response, JSON_UNESCAPED_UNICODE));
return false; return false;
} }
//
Log::info("大会员积分@{$name}: 签到成功");
return true; return true;
} }
@ -58,20 +66,25 @@ trait SignIn
/** /**
* 是否已经签到 * 是否已经签到
* @param array $data * @param array $data
* @param string $now * @param string $name
* @return int * @return bool
*/ */
protected function _isSignIn(array $data, string $now): int protected function _isSignIn(array $data, string $name): bool
{ {
$histories = $data['data']['task_info']['sing_task_item']['histories'] ?? []; $response = VipPointApiTask::homepageCombine();
// if ($response['code']) {
foreach ($histories as $h) { Log::warning('大会员积分: 获取签到信息失败');
// day: "2022-09-10" is_today: true score: 5 signed: true return false;
if ($h['day'] == $now && isset($h['is_today']) && $h['signed'] && $h['is_today']) {
return $h['score'];
}
} }
return 0; //
$data = $response['data'];
if ($data['task']['signed']) {
Log::info("大会员积分@{$name}: 今日已完成签到,已有积分 {$data['point_info']['point']}分,剩余 {$data['task']['task_count']} 项积分任务待完成");
return true;
}
//
Log::info("大会员积分@{$name}: 今日未完成签到,已有积分 {$data['point_info']['point']}分,剩余 {$data['task']['task_count']} 项积分任务待完成");
return false;
} }
@ -83,14 +96,7 @@ trait SignIn
*/ */
protected function isSignIn(array $data, string $name): bool protected function isSignIn(array $data, string $name): bool
{ {
$now = date("Y-m-d"); return $this->_isSignIn($data, $name);
//
if ($score = $this->_isSignIn($data, $now)) {
Log::info("大会员积分@{$name}: 今日完成签到,获得积分 {$score}分 已累计签到 {$data['data']['task_info']['sing_task_item']['count']}");
return true;
}
return false;
} }
} }

View File

@ -23,6 +23,7 @@ use Bhp\Plugin\Plugin;
use Bhp\TimeLock\TimeLock; use Bhp\TimeLock\TimeLock;
use Bhp\User\User; use Bhp\User\User;
use Bhp\Util\Exceptions\NoLoginException; use Bhp\Util\Exceptions\NoLoginException;
use function Amp\delay;
class VipPrivilege extends BasePlugin class VipPrivilege extends BasePlugin
{ {
@ -81,6 +82,19 @@ class VipPrivilege extends BasePlugin
17 => '大会员专享游戏优惠券(游戏优惠券)', 17 => '大会员专享游戏优惠券(游戏优惠券)',
]; ];
/**
* @var array|string[]
*/
protected array $privilege_blacklists = [
18 => '淘宝账号查询异常,请退出重试',
20 => '饿了么领取活动已经过期~',
21 => '超大会员身份状态异常',
24 => '请求错误', // 未知
25 => '请求错误', // 未知
26 => '请求错误', // 正式大会员专属票务优惠券-229减18
27 => '请求错误', // 正式漫展-大会员专属票务优惠券169减10
];
/** /**
* @param Plugin $plugin * @param Plugin $plugin
*/ */
@ -117,24 +131,38 @@ class VipPrivilege extends BasePlugin
// 如果为年度大会员 // 如果为年度大会员
if (!User::isYearVip('大会员权益')) return; if (!User::isYearVip('大会员权益')) return;
// //
$privilege_list = $this->myVipPrivilege(); $privilege_list = $this->filterCanReceive($this->myVipPrivilege());
Log::info('大会员权益: 可领取权益数 ' . count($privilege_list));
// //
foreach ($privilege_list as $privilege) { foreach ($privilege_list as $privilege) {
// 是否领取状态 // 随机延迟 5-10秒
if ($privilege['state'] != 0) { delay(mt_rand(5, 10));
continue; // 特殊类型 9 每日10经验 需要观看视频
} if ($privilege['type'] == 9) {
// 特殊类型
if ($privilege['type'] != 9) {
// 领取奖励
$this->myVipPrivilegeReceive($privilege['type']);
} else {
// 领取额外经验 // 领取额外经验
$this->myVipExtraExp(); $this->myVipExtraExp();
continue;
} }
// 领取奖励
$this->myVipPrivilegeReceive($privilege['type']);
} }
} }
/**
* 过滤可领取的权益
* @param array $privilege_list
* @return array
*/
protected function filterCanReceive(array $privilege_list): array
{
// 是否领取状态 0未兑换 | 1已兑换 | 2未完成若需要完成
// 黑名单
return array_filter($privilege_list, function ($privilege) {
return $privilege['state'] == 0 && !array_key_exists($privilege['type'], $this->privilege_blacklists);
});
}
/** /**
* 大会员额外经验 * 大会员额外经验
* @return void * @return void
@ -144,7 +172,9 @@ class VipPrivilege extends BasePlugin
$response = ApiExperience::add(); $response = ApiExperience::add();
// //
if (!$response['code']) { if (!$response['code']) {
Log::info("大会员额外经验: 领取额外经验成功"); Log::notice("大会员额外经验: 领取额外经验成功");
} else if ($response['code'] == 69198) {
Log::info("大会员额外经验: 用户经验已经领取");
} else { } else {
Log::warning("大会员额外经验: 领取额外经验失败 {$response['code']} -> {$response['message']}"); Log::warning("大会员额外经验: 领取额外经验失败 {$response['code']} -> {$response['message']}");
} }
@ -177,6 +207,7 @@ class VipPrivilege extends BasePlugin
protected function myVipPrivilegeReceive(int $type): void protected function myVipPrivilegeReceive(int $type): void
{ {
// {"code":0,"message":"0","ttl":1} // {"code":0,"message":"0","ttl":1}
// {"code":73319,"message":"73319","ttl":1}
// {-101: "账号未登录", -111: "csrf 校验失败", -400: "请求错误", 69800: "网络繁忙 请稍后重试", 69801: "你已领取过该权益"} // {-101: "账号未登录", -111: "csrf 校验失败", -400: "请求错误", 69800: "网络繁忙 请稍后重试", 69801: "你已领取过该权益"}
$response = ApiPrivilege::receive($type); $response = ApiPrivilege::receive($type);
// 判断type是否在$this->privilege // 判断type是否在$this->privilege
@ -190,10 +221,13 @@ class VipPrivilege extends BasePlugin
case -101: case -101:
throw new NoLoginException($response['message']); throw new NoLoginException($response['message']);
case 0: case 0:
Log::notice("大会员权益: 领取权益 {$this->privilege[$type]} 成功"); Log::notice("大会员权益: 领取权益[$type]成功");
break;
case 73319:
Log::warning("大会员权益: 领取权益[$type]失败,暂时未到可领取时间");
break; break;
default: default:
Log::warning("大会员权益: 领取权益 {$this->privilege[$type]} 失败 {$response['code']} -> {$response['message']}"); Log::warning("大会员权益: 领取权益[$type]失败, {$response['code']} -> {$response['message']}");
break; break;
} }
} }

View File

@ -3,8 +3,8 @@ device_version: 0.0.1
app: app:
bili_a: # Android bili_a: # Android
package: "tv.danmaku.bili" package: "tv.danmaku.bili"
version: "8.51.0" version: "8.59.0"
build: "8510500" build: "8590200"
channel: "bili" channel: "bili"
device: "phone" device: "phone"
mobi_app: "android" mobi_app: "android"
@ -15,7 +15,7 @@ app:
secret_key: "NTYwYzUyY2NkMjg4ZmVkMDQ1ODU5ZWQxOGJmZmQ5NzM" secret_key: "NTYwYzUyY2NkMjg4ZmVkMDQ1ODU5ZWQxOGJmZmQ5NzM"
app_key_n: "NzgzYmJiNzI2NDQ1MWQ4Mg==" app_key_n: "NzgzYmJiNzI2NDQ1MWQ4Mg=="
secret_key_n: "MjY1MzU4M2M4ODczZGVhMjY4YWI5Mzg2OTE4YjFkNjU=" secret_key_n: "MjY1MzU4M2M4ODczZGVhMjY4YWI5Mzg2OTE4YjFkNjU="
statistics: '{"appId":1,"platform":3,"version":"8.51.0","abtest":""}' statistics: '{"appId":1,"platform":3,"version":"8.59.0","abtest":""}'
bili_i: # IOS bili_i: # IOS
app_key: "MjdlYjUzZmM5MDU4ZjhjMw==" app_key: "MjdlYjUzZmM5MDU4ZjhjMw=="
secret_key: "YzJlZDUzYTc0ZWVlZmUzY2Y5OWZiZDAxZDhjOWMzNzU=" secret_key: "YzJlZDUzYTc0ZWVlZmUzY2Y5OWZiZDAxZDhjOWMzNzU="
@ -30,6 +30,6 @@ platform:
model: "MuMu" model: "MuMu"
network: "2" # 1 流量 2 WIFI network: "2" # 1 流量 2 WIFI
headers: headers:
other_ua: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" other_ua: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"
pc_ua: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0" pc_ua: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0"
app_ua: "Mozilla/5.0 BiliDroid/${app.bili_a.version} (bbcallen@gmail.com) os/${platform.system.os} model/${device.model} mobi_app/${app.bili_a.mobi_app}build/${app.bili_a.build} channel/${app.bili_a.channel} innerVer/${app.bili_a.build}osVer/${platform.system.os_ver} network/${platform.system.network}" app_ua: "Mozilla/5.0 BiliDroid/${app.bili_a.version} (bbcallen@gmail.com) os/${platform.system.os} model/${device.model} mobi_app/${app.bili_a.mobi_app}build/${app.bili_a.build} channel/${app.bili_a.channel} innerVer/${app.bili_a.build}osVer/${platform.system.os_ver} network/${platform.system.network}"

View File

@ -2,12 +2,6 @@
"code": 200, "code": 200,
"remarks": "有需要可以自己添加或者提pr", "remarks": "有需要可以自己添加或者提pr",
"data": [ "data": [
{
"sid": "newLottery_c66923dc-8d33-11ef-ab09-e8b47005dab5",
"title": "1年1度抄级坦白局",
"url": "https://www.bilibili.com/blackboard/activity-938uLTfAXW.html",
"update_time": "2024-10-27 19:22:55"
},
{ {
"sid": "newLottery_b2745c0e-8621-11ef-ab09-e8b47005dab5", "sid": "newLottery_b2745c0e-8621-11ef-ab09-e8b47005dab5",
"title": "海露 你做个人吧", "title": "海露 你做个人吧",

View File

@ -8,7 +8,7 @@
"dev_raw_url": "https://raw.githubusercontent.com/lkeme/BiliHelper-personal/dev/resources/version.json", "dev_raw_url": "https://raw.githubusercontent.com/lkeme/BiliHelper-personal/dev/resources/version.json",
"master_purge_url": "https://cdn.staticaly.com/gh/lkeme/BiliHelper-personal/master/resources/version.json", "master_purge_url": "https://cdn.staticaly.com/gh/lkeme/BiliHelper-personal/master/resources/version.json",
"dev_purge_url": "https://cdn.staticaly.com/gh/lkeme/BiliHelper-personal/dev/resources/version.json", "dev_purge_url": "https://cdn.staticaly.com/gh/lkeme/BiliHelper-personal/dev/resources/version.json",
"version": "2.4.5.250218", "version": "2.5.0.250823",
"update_time": "2025-02-18", "update_time": "2025-08-23",
"update_description": "程序有更新,请及时线上查看更新哦~" "update_description": "程序有更新,请及时线上查看更新哦~"
} }

View File

@ -43,6 +43,7 @@ class ApiTask
// //
$payload = [ $payload = [
'disable_rcmd' => '0', 'disable_rcmd' => '0',
'buvid' => Request::getBuvid(),
'csrf' => $user['csrf'], 'csrf' => $user['csrf'],
'statistics' => getDevice('app.bili_a.statistics'), 'statistics' => getDevice('app.bili_a.statistics'),
]; ];

View File

@ -30,7 +30,8 @@ class ApiTask
]; ];
/** /**
* 用户信息 * 任务界面信息
* https://big.bilibili.com/mobile/bigPoint/task
* @return array * @return array
*/ */
public static function combine(): array public static function combine(): array
@ -40,4 +41,17 @@ class ApiTask
$headers = array_merge([], self::$headers); $headers = array_merge([], self::$headers);
return Request::getJson(true, 'app', $url, Sign::common($payload), $headers); return Request::getJson(true, 'app', $url, Sign::common($payload), $headers);
} }
/**
* 主页界面信息
* https://big.bilibili.com/mobile/bigPoint
* @return array
*/
public static function homepageCombine(): array
{
$url = 'https://api.bilibili.com/x/vip_point/homepage/combine';
$payload = [];
$headers = array_merge([], self::$headers);
return Request::getJson(true, 'app', $url, Sign::common($payload), $headers);
}
} }