feat: 为下载视频接口加入 wbi 签名 (#143)
This commit is contained in:
@@ -20,12 +20,11 @@ use crate::utils::status::Status;
|
||||
|
||||
pub async fn collection_from<'a>(
|
||||
collection_item: &'a CollectionItem,
|
||||
mixin_key: &'a str,
|
||||
path: &Path,
|
||||
bili_client: &'a BiliClient,
|
||||
connection: &DatabaseConnection,
|
||||
) -> Result<(Box<dyn VideoListModel>, Pin<Box<dyn Stream<Item = VideoInfo> + 'a>>)> {
|
||||
let collection = Collection::new(bili_client, collection_item, mixin_key);
|
||||
let collection = Collection::new(bili_client, collection_item);
|
||||
let collection_info = collection.get_info().await?;
|
||||
collection::Entity::insert(collection::ActiveModel {
|
||||
s_id: Set(collection_info.sid),
|
||||
|
||||
@@ -17,13 +17,8 @@ use watch_later::watch_later_from;
|
||||
use crate::bilibili::{BiliClient, CollectionItem, VideoInfo};
|
||||
|
||||
pub enum Args<'a> {
|
||||
Favorite {
|
||||
fid: &'a str,
|
||||
},
|
||||
Collection {
|
||||
collection_item: &'a CollectionItem,
|
||||
mixin_key: &'a str,
|
||||
},
|
||||
Favorite { fid: &'a str },
|
||||
Collection { collection_item: &'a CollectionItem },
|
||||
WatchLater,
|
||||
}
|
||||
|
||||
@@ -35,10 +30,7 @@ pub async fn video_list_from<'a>(
|
||||
) -> Result<(Box<dyn VideoListModel>, Pin<Box<dyn Stream<Item = VideoInfo> + 'a>>)> {
|
||||
match args {
|
||||
Args::Favorite { fid } => favorite_from(fid, path, bili_client, connection).await,
|
||||
Args::Collection {
|
||||
collection_item,
|
||||
mixin_key,
|
||||
} => collection_from(collection_item, mixin_key, path, bili_client, connection).await,
|
||||
Args::Collection { collection_item } => collection_from(collection_item, path, bili_client, connection).await,
|
||||
Args::WatchLater => watch_later_from(path, bili_client, connection).await,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user