[update] Version v2.1.0.230430

This commit is contained in:
Lkeme 2023-04-30 16:51:30 +08:00
parent aa0f3d760f
commit 96db883319
8 changed files with 109 additions and 13 deletions

View File

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

View File

@ -8,6 +8,27 @@
[comment]: <> (</details>) [comment]: <> (</details>)
## v2.1.0.230430 alpha (2023-04-30)
### Added
-
### Changed
- 更新宝箱穷举范围
### Fixed
- 修复短信登录行为验证码手动识别错误
- 尝试修复(-663|鉴权失败|联系账号组)导致的各类`array offset`错误
- 修复一些日志错误
### Remarks
- 请注意配置文件有所变动,注意更新。
## v2.0.7.230324 alpha (2023-03-24) ## v2.0.7.230324 alpha (2023-03-24)
### Added ### Added

View File

@ -77,7 +77,7 @@ class LiveGoldBox extends BasePlugin
{ {
if (TimeLock::getTimes() > time() || !getEnable('live_gold_box')) return; if (TimeLock::getTimes() > time() || !getEnable('live_gold_box')) return;
// 2022-06-07 // 2022-06-07
$this->calcAidRange(945, 1200); $this->calcAidRange(1000, 1200);
// //
$lottery_list = $this->fetchLotteryList(); $lottery_list = $this->fetchLotteryList();
// //

View File

@ -265,6 +265,9 @@ class Login extends BasePlugin
// //
// $this->updateInfo('username',$this->username); // $this->updateInfo('username',$this->username);
// $this->updateInfo('password',$this->password); // $this->updateInfo('password',$this->password);
// 转换
$access_token = $this->tvConvert();
$this->updateInfo('access_token', $access_token);
} }
/** /**
@ -744,4 +747,35 @@ class Login extends BasePlugin
return implode("", array_reverse($cookies)); return implode("", array_reverse($cookies));
} }
/**
* @return string
*/
protected function tvConvert(): string
{
# Android 旧
$app_key = base64_decode(getDevice('app.bili_a.app_key'));
$app_secret = base64_decode(getDevice('app.bili_a.secret_key'));
$response = ApiQrcode::getConfrimUrl($app_key, $app_secret);
if ($response['code'] == 0 && isset($response['data']['has_login']) && $response['data']['has_login'] == 1) {
Log::info('获取tv转换确认链接成功');
} else {
failExit('获取转换确认链接失败');
}
//
$next_url = $response['data']['confirm_uri'];
$response = ApiQrcode::goConfrimUrl($next_url);
$location = $response['Location'][0];
// var_dump($location);
preg_match('/access_key=([a-f0-9]+)/', $location, $matches);
$access_key = $matches[1];
// var_dump($matches);
if (empty($access_key)) {
failExit('获取转换access_key失败');
}
Log::info('获取tv转换access_key成功');
return $access_key;
}
} }

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: "7.22.0" version: "7.27.0"
build: "7220300" build: "7270300"
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":"7.22.0","abtest":""}' statistics: '{"appId":1,"platform":3,"version":"7.27.0","abtest":""}'
bili_i: # IOS bili_i: # IOS
app_key: "MjdlYjUzZmM5MDU4ZjhjMw==" app_key: "MjdlYjUzZmM5MDU4ZjhjMw=="
secret_key: "YzJlZDUzYTc0ZWVlZmUzY2Y5OWZiZDAxZDhjOWMzNzU=" secret_key: "YzJlZDUzYTc0ZWVlZmUzY2Y5OWZiZDAxZDhjOWMzNzU="

View File

@ -7,10 +7,10 @@
"dev_raw_url": "https://gh.notifyplus.cf/https://github.com/lkeme/BiliHelper-personal/blob/dev/resources/version.json", "dev_raw_url": "https://gh.notifyplus.cf/https://github.com/lkeme/BiliHelper-personal/blob/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.0.7.230324", "version": "2.1.0.230430",
"des": "程序有更新,请及时线上查看更新哦~", "des": "程序有更新,请及时线上查看更新哦~",
"time": "2023年03月24日", "time": "2023年04月30日",
"ini_version": "0.0.1", "ini_version": "0.0.1",
"ini_des": "配置有更新,请及时线上查看更新哦~", "ini_des": "配置有更新,请及时线上查看更新哦~",
"ini_time": "2023年03月24日" "ini_time": "2023年04月30日"
} }

View File

@ -34,7 +34,7 @@ class ApiOauth2
'access_token' => $token, 'access_token' => $token,
]; ];
// {"ts":1234,"code":0,"data":{"mid":1234,"access_token":"1234","expires_in":7759292}} // {"ts":1234,"code":0,"data":{"mid":1234,"access_token":"1234","expires_in":7759292}}
return Request::getJson(true, 'app', $url, Sign::login($payload)); return Request::getJson(true, 'app', $url, Sign::common($payload));
} }
/** /**
@ -49,7 +49,7 @@ class ApiOauth2
'access_key' => $token, 'access_key' => $token,
]; ];
// {"code":0,"message":"0","ttl":1,"data":{"mid":"<user mid>","access_token":"<current token>","expires_in":9787360,"refresh":true}} // {"code":0,"message":"0","ttl":1,"data":{"mid":"<user mid>","access_token":"<current token>","expires_in":9787360,"refresh":true}}
return Request::getJson(true, 'app', $url, Sign::login($payload)); return Request::getJson(true, 'app', $url, Sign::common($payload));
} }
/** /**
@ -83,7 +83,7 @@ class ApiOauth2
'refresh_token' => $r_token, 'refresh_token' => $r_token,
]; ];
// {"message":"user not login","ts":1593111694,"code":-101} // {"message":"user not login","ts":1593111694,"code":-101}
return Request::postJson(true, 'app', $url, Sign::login($payload)); return Request::postJson(true, 'app', $url, Sign::common($payload));
} }
/** /**
@ -97,7 +97,7 @@ class ApiOauth2
$payload = [ $payload = [
'access_key' => $token, 'access_key' => $token,
]; ];
return Request::getJson(true, 'app', $url, Sign::login($payload)); return Request::getJson(true, 'app', $url, Sign::common($payload));
} }
/** /**
@ -124,7 +124,7 @@ class ApiOauth2
'access_key' => $token, 'access_key' => $token,
'gourl' => 'https%3A%2F%2Faccount.bilibili.com%2Faccount%2Fhome' 'gourl' => 'https%3A%2F%2Faccount.bilibili.com%2Faccount%2Fhome'
]; ];
return Request::headers('app', $url, Sign::login($payload)); return Request::headers('app', $url, Sign::common($payload));
} }
} }

View File

@ -57,4 +57,45 @@ class ApiQrcode
} }
/**
* 获取确认Url
* @param string $app_key
* @param string $app_secret
* @return array
*/
public static function getConfrimUrl(string $app_key, string $app_secret): array
{
$sign = md5('api=http://link.acg.tv/forum.php' . $app_secret);
//
$url = 'https://passport.bilibili.com/login/app/third';
$payload = [
'appkey' => $app_key,
'api' => 'http://link.acg.tv/forum.php',
'sign' => $sign
];
$headers = [
"origin" => 'https://passport.bilibili.com',
"referer" => 'https://passport.bilibili.com',
];
return Request::getJson(true, 'pc', $url, $payload, $headers);
}
/**
* 跳转确认Url
* @param string $url
* @return array
*/
public static function goConfrimUrl(string $url): array
{
// 取出url的主体部分
$query = parse_url($url)['query'];
// 取出url参数部分转为数组
parse_str($query, $payload);
$headers = [
"origin" => 'https://passport.bilibili.com',
"referer" => 'https://passport.bilibili.com',
];
return Request::headers('pc', $url, $payload, $headers);
}
} }