Skip to content

Commit b03939b

Browse files
committed
修复未登录时哔哩哔哩分类打开失败 #630
1 parent c6bb485 commit b03939b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

simple_live_core/example/simple_live_core_example.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'dart:io';
22

33
import 'package:dio/dio.dart';
4+
import 'package:simple_live_core/simple_live_core.dart';
45
import 'package:simple_live_core/src/model/tars/get_cdn_token_req.dart';
56
import 'package:simple_live_core/src/model/tars/get_cdn_token_resp.dart';
67
import 'package:tars_dart/tars/net/base_tars_http.dart';
@@ -9,7 +10,7 @@ import 'package:tars_dart/tars/tup/uni_packet.dart';
910
void main() async {
1011
// CoreLog.enableLog = true;
1112
// CoreLog.requestLogType = RequestLogType.short;
12-
// LiveSite site = BiliBiliSite();
13+
LiveSite site = BiliBiliSite();
1314
// var danmaku = site.getDanmaku();
1415
// danmaku.onMessage = (event) {
1516
// if (event.type == LiveMessageType.chat) {
@@ -27,7 +28,8 @@ void main() async {
2728

2829
// //var search = await site.searchRooms("东方");
2930

30-
// //var categores = await site.getCategores();
31+
var categores = await site.getCategores();
32+
var rooms = await site.getCategoryRooms(categores.first.children.first);
3133
// //print(categores.length);
3234
// var detail = await site.getRoomDetail(roomId: '7734200');
3335
// // var playQualites = await site.getPlayQualites(detail: detail);
@@ -42,7 +44,7 @@ void main() async {
4244
// danmaku.start(detail.danmakuData);
4345

4446
// await Future.wait({});
45-
sendReq();
47+
//sendReq();
4648
}
4749

4850
void testHuyaReq() async {

simple_live_core/lib/src/bilibili_site.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class BiliBiliSite implements LiveSite {
3737
? {
3838
"user-agent": kDefaultUserAgent,
3939
"referer": kDefaultReferer,
40+
"cookie": 'buvid3=infoc;',
4041
}
4142
: {
4243
"cookie": cookie,

0 commit comments

Comments
 (0)