@bililive-tools/bilibili-recorder
Version:
bililive-tools bilibili recorder implemention
116 lines (115 loc) • 2.87 kB
TypeScript
export type LiveStatus = 0 | 1 | 2;
export declare function getRoomInit(roomIdOrShortId: number): Promise<{
room_id: number;
short_id: number;
uid: number;
live_status: LiveStatus;
live_time: number;
encrypted: boolean;
is_sp: 0 | 1;
}>;
export declare function getRoomInfo(roomIdOrShortId: number): Promise<{
room_id: number;
short_id: number;
uid: number;
attention: number;
online: number;
description: string;
title: string;
user_cover: string;
live_status: LiveStatus;
live_time: string;
pk_status: number;
}>;
export declare function getMasterInfo(userId: number): Promise<{
info: {
uname: string;
face: string;
};
exp: {
level: number;
};
follower_num: number;
medal_name: string;
}>;
export declare function getStatusInfoByUIDs<UID extends number>(userIds: UID[]): Promise<Record<UID, {
title: string;
uname: string;
face: string;
live_status: LiveStatus;
cover_from_user: string;
live_time: number;
online: number;
room_id: number;
short_id: number;
area_v2_parent_name: string;
}>>;
export declare function getRoomBaseInfo<RoomId extends number>(roomId: RoomId): Promise<Record<RoomId, {
title: string;
uname: string;
live_time: string;
live_status: LiveStatus;
cover: string;
is_encrypted: boolean;
}>>;
export declare function getPlayURL(roomId: number, opts?: {
useHLS?: boolean;
quality?: number;
qn?: string;
}): Promise<{
current_quality: number;
accept_quality: string[];
current_qn: number;
quality_description: StreamProfile[];
durl: {
url: string;
length: number;
order: number;
stream_type: number;
p2p_type: number;
}[];
}>;
export declare function getRoomPlayInfo(roomIdOrShortId: number, opts?: {
qn?: number;
cookie?: string;
onlyAudio?: boolean;
}): Promise<{
uid: number;
room_id: number;
short_id: number;
live_status: LiveStatus;
live_time: number;
playurl_info: {
conf_json: string;
playurl: {
g_qn_desc: StreamProfile[];
stream: ProtocolInfo[];
};
};
}>;
export declare function getBuvidConf(): Promise<any>;
export interface ProtocolInfo {
protocol_name: "http_stream" | "http_hls";
format: FormatInfo[];
}
export interface FormatInfo {
format_name: string | "flv" | "ts" | "fmp4";
codec: CodecInfo[];
}
export interface CodecInfo {
codec_name: string | "avc" | "hevc";
accept_qn: number[];
base_url: string;
current_qn: number;
url_info: Omit<SourceProfile, "name">[];
}
export interface StreamProfile {
desc: string;
qn: number;
}
export interface SourceProfile {
name: string;
host: string;
extra: string;
stream_ttl: number;
}