mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-19 01:20:08 +08:00
[update] unify raffle api
This commit is contained in:
parent
0336f85170
commit
83692aad93
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,6 +1,17 @@
|
||||
# Release Notes
|
||||
# 本项目Log
|
||||
|
||||
## v0.0.1.190730 alpha (2019-07-30)
|
||||
|
||||
### Added
|
||||
-
|
||||
|
||||
### Changed
|
||||
- unify raffle api
|
||||
|
||||
### Fixed
|
||||
-
|
||||
|
||||
## v0.0.1.190723 alpha (2019-07-23)
|
||||
|
||||
### Added
|
||||
|
||||
@ -3,7 +3,7 @@ B 站直播实用脚本
|
||||
|
||||
## 公告
|
||||
|
||||
Currently for Personal Edition **0.0.1.190723 alpha**
|
||||
Currently for Personal Edition **0.0.1.190730 alpha**
|
||||
|
||||
## 文档
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ class UnifyRaffle extends BaseRaffle
|
||||
$payload = [
|
||||
'roomid' => $rid
|
||||
];
|
||||
$url = 'https://api.live.bilibili.com/gift/v3/smalltv/check';
|
||||
$url = 'https://api.live.bilibili.com/xlive/lottery-interface/v3/smalltv/Check';
|
||||
$raw = Curl::get($url, Sign::api($payload));
|
||||
$de_raw = json_decode($raw, true);
|
||||
|
||||
@ -91,7 +91,7 @@ class UnifyRaffle extends BaseRaffle
|
||||
'raffleId' => $winning_web['raffle_id']
|
||||
];
|
||||
// Web V3 Notice
|
||||
$url = 'https://api.live.bilibili.com/gift/v3/smalltv/notice';
|
||||
$url = 'https://api.live.bilibili.com/xlive/lottery-interface/v3/smalltv/Notice';
|
||||
// 请求 && 解码
|
||||
$raw = Curl::get($url, Sign::api($payload));
|
||||
$de_raw = json_decode($raw, true);
|
||||
@ -129,12 +129,18 @@ class UnifyRaffle extends BaseRaffle
|
||||
*/
|
||||
protected static function lottery(array $data): bool
|
||||
{
|
||||
$user_info = User::parseCookies();
|
||||
$payload = [
|
||||
'raffleId' => $data['raffle_id'],
|
||||
'roomid' => $data['room_id'],
|
||||
'type' => $data['type'],
|
||||
'csrf_token' => $user_info['token'],
|
||||
'csrf' => $user_info['token'],
|
||||
'visit_id' => null,
|
||||
];
|
||||
$url = 'https://api.live.bilibili.com/gift/v3/smalltv/join';
|
||||
$raw = Curl::get($url, Sign::api($payload));
|
||||
|
||||
$url = 'https://api.live.bilibili.com/xlive/lottery-interface/v3/smalltv/Join';
|
||||
$raw = Curl::post($url, Sign::api($payload));
|
||||
$de_raw = json_decode($raw, true);
|
||||
if (isset($de_raw['code']) && $de_raw['code']) {
|
||||
Log::notice("房间 {$data['room_id']} 编号 {$data['raffle_id']} " . static::ACTIVE_TITLE . ": {$de_raw['message']}");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user