mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-19 01:20:08 +08:00
[fix] lottery request delay
This commit is contained in:
parent
5ed2d9ff12
commit
ae84796a8c
@ -22,6 +22,8 @@ use Bhp\Plugin\Plugin;
|
|||||||
use Bhp\TimeLock\TimeLock;
|
use Bhp\TimeLock\TimeLock;
|
||||||
use Bhp\Request\Request;
|
use Bhp\Request\Request;
|
||||||
use Bhp\User\User;
|
use Bhp\User\User;
|
||||||
|
use function Amp\delay;
|
||||||
|
|
||||||
|
|
||||||
class Lottery extends BasePlugin
|
class Lottery extends BasePlugin
|
||||||
{
|
{
|
||||||
@ -174,6 +176,7 @@ class Lottery extends BasePlugin
|
|||||||
*/
|
*/
|
||||||
protected function getLotteryInfo(int $lottery_id): array
|
protected function getLotteryInfo(int $lottery_id): array
|
||||||
{
|
{
|
||||||
|
delay(3);
|
||||||
$user = User::parseCookie();
|
$user = User::parseCookie();
|
||||||
$url = 'https://api.vc.bilibili.com/lottery_svr/v1/lottery_svr/detail_by_lid';
|
$url = 'https://api.vc.bilibili.com/lottery_svr/v1/lottery_svr/detail_by_lid';
|
||||||
$payload = [
|
$payload = [
|
||||||
@ -183,7 +186,10 @@ class Lottery extends BasePlugin
|
|||||||
$response = Request::getJson(true, 'pc', $url, $payload);
|
$response = Request::getJson(true, 'pc', $url, $payload);
|
||||||
|
|
||||||
// 抽奖不存在
|
// 抽奖不存在
|
||||||
if ($response['code'] === -9999 || $response['code'] === 4000014) {
|
if ($response['code'] === -9999 || $response['code'] === 4000014 || $response['code'] === -412) {
|
||||||
|
// if ($response['code'] === -412) {
|
||||||
|
// Log::warning("抽奖:请求被拦截,暂定无效请求");
|
||||||
|
// }
|
||||||
return [
|
return [
|
||||||
'status' => -9999,
|
'status' => -9999,
|
||||||
];
|
];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user