mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-09-05 15:39:07 +08:00
refactor: 移除不必要的标记和代码块,统一 use 格式 (#144)
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
use std::fmt::{Display, Formatter};
|
||||
|
||||
use anyhow::Result;
|
||||
use arc_swap::access::Access;
|
||||
use async_stream::stream;
|
||||
use futures::Stream;
|
||||
use reqwest::Method;
|
||||
|
||||
@@ -133,6 +133,14 @@ mod tests {
|
||||
#[tokio::test]
|
||||
async fn test_video_info_type() {
|
||||
let bili_client = BiliClient::new();
|
||||
set_global_mixin_key(
|
||||
bili_client
|
||||
.wbi_img()
|
||||
.await
|
||||
.map(|x| x.into_mixin_key())
|
||||
.unwrap()
|
||||
.unwrap(),
|
||||
);
|
||||
let video = Video::new(&bili_client, "BV1Z54y1C7ZB".to_string());
|
||||
assert!(matches!(video.get_view_info().await, Ok(VideoInfo::View { .. })));
|
||||
let collection_item = CollectionItem {
|
||||
|
||||
@@ -4,12 +4,11 @@ use futures::TryStreamExt;
|
||||
use prost::Message;
|
||||
use reqwest::Method;
|
||||
|
||||
use super::credential::encoded_query;
|
||||
use super::MIXIN_KEY;
|
||||
use crate::bilibili::analyzer::PageAnalyzer;
|
||||
use crate::bilibili::client::BiliClient;
|
||||
use crate::bilibili::credential::encoded_query;
|
||||
use crate::bilibili::danmaku::{DanmakuElem, DanmakuWriter, DmSegMobileReply};
|
||||
use crate::bilibili::{Validate, VideoInfo};
|
||||
use crate::bilibili::{Validate, VideoInfo, MIXIN_KEY};
|
||||
|
||||
static MASK_CODE: u64 = 2251799813685247;
|
||||
static XOR_CODE: u64 = 23442827791579;
|
||||
@@ -63,7 +62,6 @@ impl<'a> Video<'a> {
|
||||
Self { client, aid, bvid }
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
/// 直接调用视频信息接口获取详细的视频信息
|
||||
pub async fn get_view_info(&self) -> Result<VideoInfo> {
|
||||
let mut res = self
|
||||
|
||||
Reference in New Issue
Block a user