From c4db12b154c502d3a1fb4660cce9856867f4904c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=80=E1=B4=8D=E1=B4=9B=E1=B4=8F=E1=B4=80=E1=B4=87?= =?UTF-8?q?=CA=80?= Date: Fri, 31 May 2024 12:21:23 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4=E7=9A=84=E6=95=B0=E5=80=BC?= =?UTF-8?q?=E6=BA=A2=E5=87=BA=20(#115)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entity/src/entities/page.rs | 2 +- src/bilibili/video.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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")