[update] Login

This commit is contained in:
Lkeme 2021-07-06 16:25:46 +08:00
parent fd670bbe3e
commit 8f25c37912
5 changed files with 15 additions and 7 deletions

View File

@ -11,6 +11,10 @@ password = ""
[login.mode]
mode = 1
; 国家代码|mode=2触发|例大陆86 澳大利亚61
[login.country]
country_code = 86
; 校验|mode=2触发|校验国内手机号|国外手机号关闭校验
[login.check]
phone = true

View File

@ -243,7 +243,7 @@ class Curl
'Connection' => 'keep-alive',
// 'Content-Type' => 'application/x-www-form-urlencoded',
// 'User-Agent' => 'Mozilla/5.0 BiliDroid/5.51.1 (bbcallen@gmail.com)',
'User-Agent' => 'Mozilla/5.0 BiliDroid/6.30.0 (bbcallen@gmail.com) os/android model/MuMu mobi_app/android build/6300400 channel/bili innerVer/6300400 osVer/7.1.2 network/2',
'User-Agent' => 'Mozilla/5.0 BiliDroid/6.31.0 (bbcallen@gmail.com) os/android model/MuMu mobi_app/android build/6310200 channel/bili innerVer/6310200 osVer/7.1.2 network/2',
// 'Referer' => 'https://live.bilibili.com/',
];
$pc_headers = [

View File

@ -311,9 +311,9 @@ class Login
{
$url = 'https://passport.bilibili.com//x/passport-login/sms/send';
$payload = [
'cid' => '86',
'cid' => getConf('country_code', 'login.country') ,
'tel' => $phone,
'statistics' => '{"appId":1,"platform":3,"version":"6.3.0","abtest":""}',
'statistics' => '{"appId":1,"platform":3,"version":"6.31.0","abtest":""}',
];
$raw = Curl::post('app', $url, Sign::login($payload));
$de_raw = json_decode($raw, true);

View File

@ -151,7 +151,7 @@ class MainSite
$de_raw = json_decode($raw, true);
// echo "getRandomAid " . count($de_raw['data']['archives']) . PHP_EOL;
// $aid = array_rand($de_raw['data']['archives'])['aid'];
} while (count($de_raw['data']['archives']) == 0);
} while (count((array)$de_raw['data']['archives']) == 0);
$aid = $de_raw['data']['archives'][0]['aid'];
return (string)$aid;
}
@ -243,7 +243,11 @@ class MainSite
$raw = Curl::get('other', $url, $payload);
$de_raw = json_decode($raw, true);
if ($de_raw['code'] == 0) {
$temps = array_rand($de_raw['data']['archives'], $num);
if ($num == 1) {
$temps = [array_rand($de_raw['data']['archives'], $num)];
} else {
$temps = array_rand($de_raw['data']['archives'], $num);
}
foreach ($temps as $temp) {
array_push($aids, $de_raw['data']['archives'][$temp]['aid']);
}

View File

@ -55,7 +55,7 @@ class Sign
'access_key' => getConf('access_token', 'login.auth'),
'actionKey' => 'appkey',
'appkey' => $appkey,
'build' => 6300400,
'build' => 6310200,
'channel' => 'bili',
'device' => 'phone',
'mobi_app' => 'android',
@ -84,7 +84,7 @@ class Sign
'access_key' => getConf('access_token', 'login.auth'),
'actionKey' => 'appkey',
'appkey' => $appkey,
'build' => 6300400,
'build' => 6310200,
'device' => 'phone',
'mobi_app' => 'android',
'platform' => 'android',