diff --git a/entity/src/entities/page.rs b/entity/src/entities/page.rs index 1fd5782..b794790 100644 --- a/entity/src/entities/page.rs +++ b/entity/src/entities/page.rs @@ -8,7 +8,7 @@ pub struct Model { #[sea_orm(primary_key)] pub id: i32, pub video_id: i32, - pub cid: i32, + pub cid: i64, pub pid: i32, pub name: String, pub width: Option, diff --git a/src/bilibili/video.rs b/src/bilibili/video.rs index 9110704..d2798db 100644 --- a/src/bilibili/video.rs +++ b/src/bilibili/video.rs @@ -39,7 +39,7 @@ impl serde::Serialize for Tag { } #[derive(Debug, serde::Deserialize, Default)] pub struct PageInfo { - pub cid: i32, + pub cid: i64, pub page: i32, #[serde(rename = "part")] pub name: String, @@ -92,7 +92,7 @@ impl<'a> Video<'a> { pub async fn get_danmaku_writer(&self, page: &'a PageInfo) -> Result { let tasks = FuturesUnordered::new(); for i in 1..=(page.duration + 359) / 360 { - tasks.push(self.get_danmaku_segment(page, i as i32)); + tasks.push(self.get_danmaku_segment(page, i as i64)); } let result: Vec> = tasks.try_collect().await?; let mut result: Vec = result.into_iter().flatten().collect(); @@ -100,7 +100,7 @@ impl<'a> Video<'a> { Ok(DanmakuWriter::new(page, result.into_iter().map(|x| x.into()).collect())) } - async fn get_danmaku_segment(&self, page: &PageInfo, segment_idx: i32) -> Result> { + async fn get_danmaku_segment(&self, page: &PageInfo, segment_idx: i64) -> Result> { let mut res = self .client .request(Method::GET, "http://api.bilibili.com/x/v2/dm/web/seg.so")