mirror of
https://github.com/lanyeeee/bilibili-video-downloader.git
synced 2026-05-06 20:02:57 +08:00
feat: 后端支持获取番剧视频信息
This commit is contained in:
@@ -15,6 +15,7 @@ use tauri::{
|
||||
use crate::{
|
||||
extensions::AppHandleExt,
|
||||
types::{
|
||||
bangumi_info::BangumiInfo, get_bangumi_info_params::GetBangumiInfoParams,
|
||||
get_normal_info_params::GetNormalInfoParams, normal_info::NormalInfo,
|
||||
qrcode_data::QrcodeData, qrcode_status::QrcodeStatus, user_info::UserInfo,
|
||||
},
|
||||
@@ -178,6 +179,48 @@ impl BiliClient {
|
||||
Ok(normal_info)
|
||||
}
|
||||
|
||||
pub async fn get_bangumi_info(
|
||||
&self,
|
||||
params: GetBangumiInfoParams,
|
||||
) -> anyhow::Result<BangumiInfo> {
|
||||
use GetBangumiInfoParams::{EpId, SeasonId};
|
||||
let params = match params {
|
||||
EpId(ep_id) => json!({"ep_id": ep_id}),
|
||||
SeasonId(season_id) => json!({"season_id": season_id}),
|
||||
};
|
||||
// 发送获取番剧视频信息的请求
|
||||
let request = self
|
||||
.api_client
|
||||
.read()
|
||||
.get("https://api.bilibili.com/pgc/view/web/season")
|
||||
.query(¶ms)
|
||||
.header("cookie", self.get_cookie());
|
||||
let http_resp = request.send().await?;
|
||||
// 检查http响应状态码
|
||||
let status = http_resp.status();
|
||||
let body = http_resp.text().await?;
|
||||
if status != StatusCode::OK {
|
||||
return Err(anyhow!("预料之外的状态码({status}): {body}"));
|
||||
}
|
||||
// 尝试将body解析为BiliResp
|
||||
let bili_resp: BiliResp =
|
||||
serde_json::from_str(&body).context(format!("将body解析为BiliResp失败: {body}"))?;
|
||||
// 检查BiliResp的code字段
|
||||
if bili_resp.code != 0 {
|
||||
return Err(anyhow!("预料之外的code: {bili_resp:?}"));
|
||||
}
|
||||
// 检查BiliResp的data是否存在
|
||||
let Some(data) = bili_resp.data else {
|
||||
return Err(anyhow!("BiliResp中不存在data字段: {bili_resp:?}"));
|
||||
};
|
||||
// 尝试将data解析为BangumiInfo
|
||||
let data_str = data.to_string();
|
||||
let bangumi_info: BangumiInfo = serde_json::from_str(&data_str)
|
||||
.context(format!("将data解析为BangumiInfo失败: {data_str}"))?;
|
||||
|
||||
Ok(bangumi_info)
|
||||
}
|
||||
|
||||
fn get_cookie(&self) -> String {
|
||||
let sessdata = self.app.get_config().read().sessdata.clone();
|
||||
format!("SESSDATA={sessdata}")
|
||||
|
||||
@@ -7,8 +7,7 @@ use crate::{
|
||||
extensions::AppHandleExt,
|
||||
logger,
|
||||
types::{
|
||||
get_normal_info_params::GetNormalInfoParams, normal_info::NormalInfo,
|
||||
qrcode_data::QrcodeData, qrcode_status::QrcodeStatus, user_info::UserInfo,
|
||||
bangumi_info::BangumiInfo, get_bangumi_info_params::GetBangumiInfoParams, get_normal_info_params::GetNormalInfoParams, normal_info::NormalInfo, qrcode_data::QrcodeData, qrcode_status::QrcodeStatus, user_info::UserInfo
|
||||
},
|
||||
};
|
||||
|
||||
@@ -108,3 +107,17 @@ pub async fn get_normal_info(
|
||||
.map_err(|err| CommandError::from("获取普通视频信息失败", err))?;
|
||||
Ok(normal_info)
|
||||
}
|
||||
|
||||
#[tauri::command(async)]
|
||||
#[specta::specta]
|
||||
pub async fn get_bangumi_info(
|
||||
app: AppHandle,
|
||||
params: GetBangumiInfoParams,
|
||||
) -> CommandResult<BangumiInfo> {
|
||||
let bili_client = app.get_bili_client();
|
||||
let bangumi_info = bili_client
|
||||
.get_bangumi_info(params)
|
||||
.await
|
||||
.map_err(|err| CommandError::from("获取番剧视频信息失败", err))?;
|
||||
Ok(bangumi_info)
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ pub fn run() {
|
||||
get_qrcode_status,
|
||||
get_user_info,
|
||||
get_normal_info,
|
||||
get_bangumi_info,
|
||||
])
|
||||
.events(tauri_specta::collect_events![LogEvent]);
|
||||
|
||||
|
||||
354
src-tauri/src/types/bangumi_info.rs
Normal file
354
src-tauri/src/types/bangumi_info.rs
Normal file
@@ -0,0 +1,354 @@
|
||||
use anyhow::{anyhow, Context};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use specta::Type;
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct BangumiInfo {
|
||||
pub activity: Activity,
|
||||
pub actors: String,
|
||||
pub alias: String,
|
||||
pub areas: Vec<Area>,
|
||||
pub bkg_cover: String,
|
||||
pub cover: String,
|
||||
pub delivery_fragment_video: bool,
|
||||
pub enable_vt: bool,
|
||||
pub episodes: Vec<EpInBangumi>,
|
||||
pub evaluate: String,
|
||||
pub hide_ep_vv_vt_dm: i64,
|
||||
pub icon_font: IconFont,
|
||||
pub jp_title: String,
|
||||
pub link: String,
|
||||
pub media_id: i64,
|
||||
pub mode: i64,
|
||||
pub new_ep: NewEp,
|
||||
pub payment: Option<PaymentInBangumi>,
|
||||
pub play_strategy: Option<PlayStrategy>,
|
||||
pub positive: Positive,
|
||||
pub publish: Publish,
|
||||
pub rating: Option<Rating>,
|
||||
pub record: String,
|
||||
pub rights: RightsInBangumi,
|
||||
pub season_id: i64,
|
||||
pub season_title: String,
|
||||
pub seasons: Vec<Season>,
|
||||
pub section: Option<Vec<SectionInBangumi>>,
|
||||
pub series: Series,
|
||||
pub share_copy: String,
|
||||
pub share_sub_title: String,
|
||||
pub share_url: String,
|
||||
pub show: Show,
|
||||
pub show_season_type: i64,
|
||||
pub square_cover: String,
|
||||
pub staff: String,
|
||||
pub stat: StatInBangumi,
|
||||
pub status: i64,
|
||||
pub styles: Vec<String>,
|
||||
pub subtitle: String,
|
||||
pub title: String,
|
||||
pub total: i64,
|
||||
#[serde(rename = "type")]
|
||||
pub type_field: i64,
|
||||
pub up_info: Option<UpInfoInBangumi>,
|
||||
pub user_status: UserStatusInBangumi,
|
||||
}
|
||||
|
||||
impl BangumiInfo {
|
||||
#[allow(clippy::cast_possible_wrap)]
|
||||
pub fn get_episode_with_order(&self, ep_id: i64) -> anyhow::Result<(&EpInBangumi, i64)> {
|
||||
let episode_with_order = self
|
||||
.episodes
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(i, ep)| (ep, i as i64 + 1))
|
||||
.find(|(ep, _)| ep.id == ep_id);
|
||||
|
||||
let episode_with_order = if let Some(episode_with_order) = episode_with_order {
|
||||
// 如果在正片中找到了对应的ep_id
|
||||
episode_with_order
|
||||
} else {
|
||||
// 如果在正片中没有找到对应的ep_id,则在section中查找
|
||||
let Some(sections) = &self.section else {
|
||||
return Err(anyhow!("找不到对应的ep_id为`{ep_id}`的番剧"));
|
||||
};
|
||||
let section_index = sections
|
||||
.iter()
|
||||
.position(|s| s.episodes.iter().any(|e| e.id == ep_id))
|
||||
.context(format!("找不到含有ep_id为`{ep_id}`的ep的section"))?;
|
||||
sections[section_index]
|
||||
.episodes
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(i, e)| (e, i as i64 + 1))
|
||||
.find(|(e, _)| e.id == ep_id)
|
||||
.context(format!("在section中找不到ep_id为`{ep_id}`的ep"))?
|
||||
};
|
||||
|
||||
Ok(episode_with_order)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct Activity {
|
||||
pub head_bg_url: String,
|
||||
pub id: i64,
|
||||
pub title: String,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct Area {
|
||||
pub id: i64,
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
#[allow(clippy::struct_field_names)]
|
||||
pub struct EpInBangumi {
|
||||
pub aid: i64,
|
||||
pub badge: String,
|
||||
pub badge_info: BadgeInfo,
|
||||
pub badge_type: Option<i64>,
|
||||
pub bvid: Option<String>,
|
||||
pub cid: i64,
|
||||
pub cover: String,
|
||||
pub dimension: Option<DimensionInBangumi>,
|
||||
pub duration: Option<u64>,
|
||||
pub enable_vt: bool,
|
||||
pub ep_id: i64,
|
||||
pub from: Option<String>,
|
||||
pub id: i64,
|
||||
pub is_view_hide: bool,
|
||||
pub link: String,
|
||||
pub link_type: Option<String>,
|
||||
pub long_title: Option<String>,
|
||||
pub pub_time: i64,
|
||||
pub pv: i64,
|
||||
pub release_date: Option<String>,
|
||||
pub rights: Option<RightsInBangumiEp>,
|
||||
pub section_type: i64,
|
||||
pub share_copy: Option<String>,
|
||||
pub share_url: Option<String>,
|
||||
pub short_link: Option<String>,
|
||||
#[serde(rename = "showDrmLoginDialog")]
|
||||
pub show_drm_login_dialog: bool,
|
||||
pub show_title: Option<String>,
|
||||
pub skip: Option<Skip>,
|
||||
pub status: i64,
|
||||
pub subtitle: Option<String>,
|
||||
pub title: String,
|
||||
pub vid: Option<String>,
|
||||
pub icon_font: Option<IconFont>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct BadgeInfo {
|
||||
pub bg_color: String,
|
||||
pub bg_color_night: String,
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct DimensionInBangumi {
|
||||
pub height: i64,
|
||||
pub rotate: i64,
|
||||
pub width: i64,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct RightsInBangumiEp {
|
||||
pub allow_dm: i64,
|
||||
pub allow_download: i64,
|
||||
pub area_limit: i64,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct Skip {
|
||||
pub ed: Ed,
|
||||
pub op: Op,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct Ed {
|
||||
pub end: i64,
|
||||
pub start: i64,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct Op {
|
||||
pub end: i64,
|
||||
pub start: i64,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct IconFont {
|
||||
pub name: String,
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct NewEp {
|
||||
pub desc: String,
|
||||
pub id: i64,
|
||||
pub is_new: i64,
|
||||
pub title: String,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct PaymentInBangumi {
|
||||
pub discount: i64,
|
||||
pub pay_type: PayType,
|
||||
pub price: String,
|
||||
pub promotion: String,
|
||||
pub tip: String,
|
||||
pub view_start_time: i64,
|
||||
pub vip_discount: i64,
|
||||
pub vip_first_promotion: String,
|
||||
pub vip_price: String,
|
||||
pub vip_promotion: String,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct PayType {
|
||||
pub allow_discount: i64,
|
||||
pub allow_pack: i64,
|
||||
pub allow_ticket: i64,
|
||||
pub allow_time_limit: i64,
|
||||
pub allow_vip_discount: i64,
|
||||
pub forbid_bb: i64,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct PlayStrategy {
|
||||
pub strategies: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct Positive {
|
||||
pub id: i64,
|
||||
pub title: String,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct Publish {
|
||||
pub is_finish: i64,
|
||||
pub is_started: i64,
|
||||
pub pub_time: String,
|
||||
pub pub_time_show: String,
|
||||
pub unknow_pub_date: i64,
|
||||
pub weekday: i64,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct Rating {
|
||||
pub count: i64,
|
||||
pub score: f64,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct RightsInBangumi {
|
||||
pub allow_bp: i64,
|
||||
pub allow_bp_rank: i64,
|
||||
pub allow_download: i64,
|
||||
pub allow_review: i64,
|
||||
pub area_limit: i64,
|
||||
pub ban_area_show: i64,
|
||||
pub can_watch: i64,
|
||||
pub copyright: String,
|
||||
pub forbid_pre: i64,
|
||||
pub freya_white: i64,
|
||||
pub is_cover_show: i64,
|
||||
pub is_preview: i64,
|
||||
pub only_vip_download: i64,
|
||||
pub resource: String,
|
||||
pub watch_platform: i64,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
#[allow(clippy::struct_field_names)]
|
||||
pub struct Season {
|
||||
pub badge: String,
|
||||
pub badge_info: BadgeInfo,
|
||||
pub badge_type: i64,
|
||||
pub cover: String,
|
||||
pub enable_vt: bool,
|
||||
pub horizontal_cover_1610: String,
|
||||
pub horizontal_cover_169: String,
|
||||
pub icon_font: IconFont,
|
||||
pub media_id: i64,
|
||||
pub new_ep: NewEpInSeason,
|
||||
pub season_id: i64,
|
||||
pub season_title: String,
|
||||
pub season_type: i64,
|
||||
pub stat: StatInSeason,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct NewEpInSeason {
|
||||
pub cover: String,
|
||||
pub id: i64,
|
||||
pub index_show: String,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct StatInSeason {
|
||||
pub favorites: i64,
|
||||
pub series_follow: i64,
|
||||
pub views: i64,
|
||||
pub vt: i64,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
#[allow(clippy::struct_field_names)]
|
||||
pub struct Series {
|
||||
pub display_type: i64,
|
||||
pub series_id: i64,
|
||||
pub series_title: String,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct Show {
|
||||
pub wide_screen: i64,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct StatInBangumi {
|
||||
pub coins: i64,
|
||||
pub danmakus: i64,
|
||||
pub favorite: i64,
|
||||
pub favorites: i64,
|
||||
pub follow_text: String,
|
||||
pub likes: i64,
|
||||
pub reply: i64,
|
||||
pub share: i64,
|
||||
pub views: i64,
|
||||
pub vt: i64,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct UpInfoInBangumi {
|
||||
pub avatar: String,
|
||||
pub mid: i64,
|
||||
pub uname: String,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct UserStatusInBangumi {
|
||||
pub area_limit: i64,
|
||||
pub ban_area_show: i64,
|
||||
pub follow: i64,
|
||||
pub follow_status: i64,
|
||||
pub login: i64,
|
||||
pub pay: i64,
|
||||
pub pay_pack_paid: i64,
|
||||
pub sponsor: i64,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub struct SectionInBangumi {
|
||||
pub attr: i64,
|
||||
pub episodes: Vec<EpInBangumi>,
|
||||
pub id: i64,
|
||||
pub title: String,
|
||||
#[serde(rename = "type")]
|
||||
pub type_field: i64,
|
||||
pub type2: i64,
|
||||
}
|
||||
8
src-tauri/src/types/get_bangumi_info_params.rs
Normal file
8
src-tauri/src/types/get_bangumi_info_params.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use specta::Type;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Type)]
|
||||
pub enum GetBangumiInfoParams {
|
||||
EpId(i64),
|
||||
SeasonId(i64),
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
pub mod bangumi_info;
|
||||
pub mod get_bangumi_info_params;
|
||||
pub mod get_normal_info_params;
|
||||
pub mod log_level;
|
||||
pub mod normal_info;
|
||||
|
||||
@@ -50,6 +50,14 @@ async getNormalInfo(params: GetNormalInfoParams) : Promise<Result<NormalInfo, Co
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async getBangumiInfo(params: GetBangumiInfoParams) : Promise<Result<BangumiInfo, CommandError>> {
|
||||
try {
|
||||
return { status: "ok", data: await TAURI_INVOKE("get_bangumi_info", { params }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,43 +76,72 @@ logEvent: "log-event"
|
||||
|
||||
/** user-defined types **/
|
||||
|
||||
export type Activity = { head_bg_url: string; id: number; title: string }
|
||||
export type Arc = { aid: number; videos: number; type_id: number; type_name: string; copyright: number; pic: string; title: string; pubdate: number; ctime: number; desc: string; state: number; duration: number; rights: RightsInNormalEp; author: Author; stat: StatInNormalEp; dynamic: string; dimension: Dimension; is_chargeable_season: boolean; is_blooper: boolean; enable_vt: number; vt_display: string; type_id_v2: number; type_name_v2: string; is_lesson_video: number }
|
||||
export type Area = { id: number; name: string }
|
||||
export type ArgueInfo = { argue_msg: string; argue_type: number; argue_link: string }
|
||||
export type Author = { mid: number; name: string; face: string }
|
||||
export type BadgeInfo = { bg_color: string; bg_color_night: string; text: string }
|
||||
export type BangumiInfo = { activity: Activity; actors: string; alias: string; areas: Area[]; bkg_cover: string; cover: string; delivery_fragment_video: boolean; enable_vt: boolean; episodes: EpInBangumi[]; evaluate: string; hide_ep_vv_vt_dm: number; icon_font: IconFont; jp_title: string; link: string; media_id: number; mode: number; new_ep: NewEp; payment: PaymentInBangumi | null; play_strategy: PlayStrategy | null; positive: Positive; publish: Publish; rating: Rating | null; record: string; rights: RightsInBangumi; season_id: number; season_title: string; seasons: Season[]; section: SectionInBangumi[] | null; series: Series; share_copy: string; share_sub_title: string; share_url: string; show: Show; show_season_type: number; square_cover: string; staff: string; stat: StatInBangumi; status: number; styles: string[]; subtitle: string; title: string; total: number; type: number; up_info: UpInfoInBangumi | null; user_status: UserStatusInBangumi }
|
||||
export type CommandError = { err_title: string; err_message: string }
|
||||
export type Config = { downloadDir: string; enableFileLogger: boolean; sessdata: string }
|
||||
export type DescV2 = { raw_text: string; type: number; biz_id: number }
|
||||
export type Dimension = { width: number; height: number; rotate: number }
|
||||
export type DimensionInBangumi = { height: number; rotate: number; width: number }
|
||||
export type Ed = { end: number; start: number }
|
||||
export type EpInBangumi = { aid: number; badge: string; badge_info: BadgeInfo; badge_type: number | null; bvid: string | null; cid: number; cover: string; dimension: DimensionInBangumi | null; duration: number | null; enable_vt: boolean; ep_id: number; from: string | null; id: number; is_view_hide: boolean; link: string; link_type: string | null; long_title: string | null; pub_time: number; pv: number; release_date: string | null; rights: RightsInBangumiEp | null; section_type: number; share_copy: string | null; share_url: string | null; short_link: string | null; showDrmLoginDialog: boolean; show_title: string | null; skip: Skip | null; status: number; subtitle: string | null; title: string; vid: string | null; icon_font: IconFont | null }
|
||||
export type EpInNormal = { season_id: number; section_id: number; id: number; aid: number; cid: number; title: string; attribute: number; arc: Arc; page: PageInNormalEp; bvid: string; pages: PageInNormalEp[] }
|
||||
export type GetBangumiInfoParams = { EpId: number } | { SeasonId: number }
|
||||
export type GetNormalInfoParams = { Bvid: string } | { Aid: number }
|
||||
export type Honor = { aid: number; type: number; desc: string; weekly_recommend_num: number }
|
||||
export type HonorReply = { honor: Honor[] | null }
|
||||
export type IconFont = { name: string; text: string }
|
||||
export type JsonValue = null | boolean | number | string | JsonValue[] | { [key in string]: JsonValue }
|
||||
export type LabelInUserInfo = { path: string; text: string; label_theme: string; text_color: string; bg_style: number; bg_color: string; border_color: string; use_img_label: boolean; img_label_uri_hans: string; img_label_uri_hant: string; img_label_uri_hans_static: string; img_label_uri_hant_static: string }
|
||||
export type LevelInfoInUserInfo = { current_level: number; current_min: number; current_exp: number }
|
||||
export type LogEvent = { timestamp: string; level: LogLevel; fields: { [key in string]: JsonValue }; target: string; filename: string; line_number: number }
|
||||
export type LogLevel = "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR"
|
||||
export type NewEp = { desc: string; id: number; is_new: number; title: string }
|
||||
export type NewEpInSeason = { cover: string; id: number; index_show: string }
|
||||
export type NormalInfo = { bvid: string; aid: number; videos: number; tid: number; tid_v2: number; tname: string; tname_v2: string; copyright: number; pic: string; title: string; pubdate: number; ctime: number; desc: string; desc_v2: DescV2[] | null; state: number; duration: number; rights: Rights; owner: OwnerInNormal; stat: StatInNormal; argue_info: ArgueInfo; dynamic: string; cid: number; dimension: Dimension; teenage_mode: number; is_chargeable_season: boolean; is_story: boolean; is_upower_exclusive: boolean; is_upower_play: boolean; is_upower_preview: boolean; enable_vt: number; vt_display: string; is_upower_exclusive_with_qa: boolean; no_cache: boolean; pages: PageInNormal[]; subtitle: SubtitleInNormal; staff: Staff[] | null; ugc_season: UgcSeason | null; is_season_display: boolean; user_garb: UserGarb; honor_reply: HonorReply; like_icon: string; need_jump_bv: boolean; disable_show_up_info: boolean; is_story_play: number; is_view_self: boolean }
|
||||
export type Official = { role: number; title: string; desc: string; type: number }
|
||||
export type OfficialVerify = { type: number; desc: string }
|
||||
export type Op = { end: number; start: number }
|
||||
export type OwnerInNormal = { mid: number; name: string; face: string }
|
||||
export type PageInNormal = { cid: number; page: number; from: string; part: string; duration: number; vid: string; weblink: string; dimension: Dimension; ctime: number }
|
||||
export type PageInNormalEp = { cid: number; page: number; from: string; part: string; duration: number; vid: string; weblink: string; dimension: Dimension }
|
||||
export type PayType = { allow_discount: number; allow_pack: number; allow_ticket: number; allow_time_limit: number; allow_vip_discount: number; forbid_bb: number }
|
||||
export type PaymentInBangumi = { discount: number; pay_type: PayType; price: string; promotion: string; tip: string; view_start_time: number; vip_discount: number; vip_first_promotion: string; vip_price: string; vip_promotion: string }
|
||||
export type PendantInUserInfo = { pid: number; name: string; image: string; expire: number; image_enhance: string; image_enhance_frame: string; n_pid: number }
|
||||
export type PlayStrategy = { strategies: string[] }
|
||||
export type Positive = { id: number; title: string }
|
||||
export type Publish = { is_finish: number; is_started: number; pub_time: string; pub_time_show: string; unknow_pub_date: number; weekday: number }
|
||||
export type QrcodeData = { url: string; qrcode_key: string }
|
||||
export type QrcodeStatus = { url: string; refresh_token: string; timestamp: number; code: number; message: string }
|
||||
export type Rating = { count: number; score: number }
|
||||
export type Rights = { bp: number; elec: number; download: number; movie: number; pay: number; hd5: number; no_reprint: number; autoplay: number; ugc_pay: number; is_cooperation: number; ugc_pay_preview: number; no_background: number; clean_mode: number; is_stein_gate: number; is_360: number; no_share: number; arc_pay: number; free_watch: number }
|
||||
export type RightsInBangumi = { allow_bp: number; allow_bp_rank: number; allow_download: number; allow_review: number; area_limit: number; ban_area_show: number; can_watch: number; copyright: string; forbid_pre: number; freya_white: number; is_cover_show: number; is_preview: number; only_vip_download: number; resource: string; watch_platform: number }
|
||||
export type RightsInBangumiEp = { allow_dm: number; allow_download: number; area_limit: number }
|
||||
export type RightsInNormalEp = { bp: number; elec: number; download: number; movie: number; pay: number; hd5: number; no_reprint: number; autoplay: number; ugc_pay: number; is_cooperation: number; ugc_pay_preview: number; arc_pay: number; free_watch: number }
|
||||
export type Season = { badge: string; badge_info: BadgeInfo; badge_type: number; cover: string; enable_vt: boolean; horizontal_cover_1610: string; horizontal_cover_169: string; icon_font: IconFont; media_id: number; new_ep: NewEpInSeason; season_id: number; season_title: string; season_type: number; stat: StatInSeason }
|
||||
export type SectionInBangumi = { attr: number; episodes: EpInBangumi[]; id: number; title: string; type: number; type2: number }
|
||||
export type SectionInNormal = { season_id: number; id: number; title: string; type: number; episodes: EpInNormal[] }
|
||||
export type Series = { display_type: number; series_id: number; series_title: string }
|
||||
export type Show = { wide_screen: number }
|
||||
export type Skip = { ed: Ed; op: Op }
|
||||
export type Staff = { mid: number; title: string; name: string; face: string; follower: number; label_style: number }
|
||||
export type StatInBangumi = { coins: number; danmakus: number; favorite: number; favorites: number; follow_text: string; likes: number; reply: number; share: number; views: number; vt: number }
|
||||
export type StatInNormal = { aid: number; view: number; danmaku: number; reply: number; favorite: number; coin: number; share: number; now_rank: number; his_rank: number; like: number; dislike: number; evaluation: string; vt: number }
|
||||
export type StatInNormalEp = { aid: number; view: number; danmaku: number; reply: number; fav: number; coin: number; share: number; now_rank: number; his_rank: number; like: number; dislike: number; evaluation: string; argue_msg: string; vt: number; vv: number }
|
||||
export type StatInNormalSeason = { season_id: number; view: number; danmaku: number; reply: number; fav: number; coin: number; share: number; now_rank: number; his_rank: number; like: number; vt: number; vv: number }
|
||||
export type StatInSeason = { favorites: number; series_follow: number; views: number; vt: number }
|
||||
export type SubtitleDetailInNormal = { id: number; lan: string; lan_doc: string; is_lock: boolean; subtitle_url: string; type: number; id_str: string; ai_type: number; ai_status: number }
|
||||
export type SubtitleInNormal = { allow_submit: boolean; list: SubtitleDetailInNormal[] }
|
||||
export type UgcSeason = { id: number; title: string; cover: string; mid: number; intro: string; sign_state: number; attribute: number; sections: SectionInNormal[]; stat: StatInNormalSeason; ep_count: number; season_type: number; is_pay_season: boolean; enable_vt: number }
|
||||
export type UpInfoInBangumi = { avatar: string; mid: number; uname: string }
|
||||
export type UserGarb = { url_image_ani_cut: string }
|
||||
export type UserInfo = { isLogin: boolean; email_verified: number; face: string; face_nft: number; face_nft_type: number; level_info: LevelInfoInUserInfo; mid: number; mobile_verified: number; money: number; moral: number; official: Official; officialVerify: OfficialVerify; pendant: PendantInUserInfo; scores: number; uname: string; vipDueDate: number; vipStatus: number; vipType: number; vip_pay_type: number; vip_theme_type: number; vip_label: VipLabel; vip_avatar_subscript: number; vip_nickname_color: string; vip: VipInUserInfo; wallet: Wallet | null; has_shop: boolean; shop_url: string; answer_status: number; is_senior_member: number; wbi_img: WbiImg; is_jury: boolean }
|
||||
export type UserStatusInBangumi = { area_limit: number; ban_area_show: number; follow: number; follow_status: number; login: number; pay: number; pay_pack_paid: number; sponsor: number }
|
||||
export type VipInUserInfo = { type: number; status: number; due_date: number; vip_pay_type: number; theme_type: number; label: LabelInUserInfo; avatar_subscript: number; nickname_color: string; role: number; avatar_subscript_url: string; tv_vip_status: number; tv_vip_pay_type: number; tv_due_date: number }
|
||||
export type VipLabel = { path: string; text: string; label_theme: string; text_color: string; bg_style: number; bg_color: string; border_color: string; use_img_label: boolean; img_label_uri_hans: string; img_label_uri_hant: string; img_label_uri_hans_static: string; img_label_uri_hant_static: string }
|
||||
export type Wallet = { mid: number; bcoin_balance: number; coupon_balance: number; coupon_due_time: number }
|
||||
|
||||
Reference in New Issue
Block a user