mirror of
https://github.com/czp3009/bilibili-api.git
synced 2024-12-21 20:30:28 +08:00
当试图连接一个不存在的直播间时抛出 IllegalArgumentException
This commit is contained in:
parent
08c8b52fa1
commit
5f2f753b0f
@ -183,4 +183,7 @@ public interface LiveService {
|
||||
//佩戴头衔
|
||||
@GET("AppUser/wearTitle")
|
||||
Call<WearTitleResponseEntity> wearTitle(@Query("title") String title);
|
||||
|
||||
//侧拉抽屉 -> 直播中心 -> 瓜子商店 -> 银瓜子兑换 -> 硬币银瓜子互换 -> 兑换硬币
|
||||
//将 700 银瓜子兑换为 1 硬币, 每个用户每天只能换一次
|
||||
}
|
||||
|
@ -59,12 +59,18 @@ public class LiveClient implements Closeable {
|
||||
initEventBus();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public LiveRoomInfoEntity.LiveRoomEntity fetchRoomInfo() throws IOException {
|
||||
return bilibiliServiceProvider.getLiveService()
|
||||
LiveRoomInfoEntity.LiveRoomEntity liveRoomEntity = bilibiliServiceProvider.getLiveService()
|
||||
.getRoomInfo(showRoomId)
|
||||
.execute()
|
||||
.body()
|
||||
.getData();
|
||||
if (liveRoomEntity != null) {
|
||||
return liveRoomEntity;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Target room " + showRoomId + " not exists");
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized LiveClient connect() throws IOException {
|
||||
|
Loading…
Reference in New Issue
Block a user