Skip to content

Commit fc41d8f

Browse files
Merge pull request #273 from alley-rs/dev
2 parents bb2ea1c + 54c2cb1 commit fc41d8f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src-tauri/src/parsers/bilibili/room_play_info_fetcher.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use serde_json::Value;
44

55
use crate::error::{LsarResult, RoomStateError};
66

7-
const BASE_URL: &str = "https://api.live.bilibili.com/xlive/web-room/v2/index/getRoomPlayInfo?protocol=0,1&format=0,1,2&codec=0,1&qn=10000&platform=web&ptype=8&dolby=5&panorama=1&room_id=";
7+
// qn 30000 是 B 站支持的最高质量,即播放器中的“杜比”选项,其他质量是 20000 的 4K,15000 的 2K,10000 的 1080P 高帧率,400 的 1080P 低帧率,再往下的质量就没必要看了。在请求时直接使用 30000 发起请求,B 站会返回可用的最高质量。
8+
const BASE_URL: &str = "https://api.live.bilibili.com/xlive/web-room/v2/index/getRoomPlayInfo?protocol=0,1&format=0,1,2&codec=0,1&qn=30000&platform=web&ptype=8&dolby=5&panorama=1&room_id=";
89

910
#[derive(Debug, Deserialize)]
1011
pub struct CDNItem {
@@ -40,7 +41,7 @@ pub struct PlayUrl {
4041

4142
#[derive(Debug, Deserialize)]
4243
pub(super) struct ResponseData {
43-
live_status: i32,
44+
live_status: i32, // 0: offline, 1: live, 2: replay
4445
pub playurl_info: PlayUrlInfo,
4546
}
4647

0 commit comments

Comments
 (0)