mirror of
https://github.com/lanyeeee/bilibili-video-downloader.git
synced 2026-09-09 01:27:27 +08:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c42d59ec1 | ||
|
|
0a650c24f0 | ||
|
|
ace6b8efa0 | ||
|
|
d1ef3a87be | ||
|
|
f394ae68e7 |
@@ -327,6 +327,7 @@ pub mod v1 {
|
||||
pub part_title: Option<String>,
|
||||
pub part_order: Option<i64>,
|
||||
pub episode_title: String,
|
||||
pub episode_title_in_collection: Option<String>,
|
||||
pub episode_order: i64,
|
||||
pub up_name: Option<String>,
|
||||
pub up_uid: Option<i64>,
|
||||
|
||||
Generated
+16
@@ -315,6 +315,7 @@ dependencies = [
|
||||
"tauri-plugin-dialog",
|
||||
"tauri-plugin-opener",
|
||||
"tauri-plugin-os",
|
||||
"tauri-plugin-window-state",
|
||||
"tauri-specta",
|
||||
"tokio",
|
||||
"tracing",
|
||||
@@ -4463,6 +4464,21 @@ dependencies = [
|
||||
"thiserror 2.0.12",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-window-state"
|
||||
version = "2.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2d5f6fe3291bfa609c7e0b0ee3bedac294d94c7018934086ce782c1d0f2a468e"
|
||||
dependencies = [
|
||||
"bitflags 2.9.1",
|
||||
"log",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"thiserror 2.0.12",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime"
|
||||
version = "2.7.0"
|
||||
|
||||
@@ -22,6 +22,7 @@ tauri = { version = "2", features = [] }
|
||||
tauri-plugin-opener = "2"
|
||||
tauri-plugin-os = "2"
|
||||
tauri-plugin-dialog = "2"
|
||||
tauri-plugin-window-state = "2"
|
||||
dlopen2 = { version = "0.8.2" }
|
||||
bilibili-video-downloader-plugin-api = { path = "../src-plugin/plugin-api" }
|
||||
|
||||
|
||||
@@ -351,7 +351,8 @@ impl BiliClient {
|
||||
.read()
|
||||
.get("https://api.bilibili.com/x/space/wbi/arc/search")
|
||||
.query(¶ms)
|
||||
.header("cookie", self.get_cookie());
|
||||
// 不带DedeUserID会随机触发412错误
|
||||
.header("cookie", format!("DedeUserID=1; {}", self.get_cookie()));
|
||||
let http_resp = request.send().await?;
|
||||
// 检查http响应状态码
|
||||
let status = http_resp.status();
|
||||
|
||||
@@ -32,6 +32,7 @@ use crate::{
|
||||
bangumi_info::BangumiInfo,
|
||||
cheese_info::CheeseInfo,
|
||||
codec_type::CodecType,
|
||||
get_normal_info_params::GetNormalInfoParams,
|
||||
normal_info::{NormalInfo, UgcSeason},
|
||||
video_quality::VideoQuality,
|
||||
},
|
||||
@@ -54,6 +55,7 @@ pub struct DownloadProgress {
|
||||
pub part_title: Option<String>,
|
||||
pub part_order: Option<i64>,
|
||||
pub episode_title: String,
|
||||
pub episode_title_in_collection: Option<String>,
|
||||
pub episode_order: i64,
|
||||
pub up_name: Option<String>,
|
||||
pub up_uid: Option<i64>,
|
||||
@@ -129,6 +131,7 @@ impl DownloadProgress {
|
||||
part_title: None,
|
||||
part_order: None,
|
||||
episode_title: episode.show_title.clone().unwrap_or(episode.title.clone()),
|
||||
episode_title_in_collection: None,
|
||||
episode_order,
|
||||
up_name,
|
||||
up_uid,
|
||||
@@ -179,6 +182,7 @@ impl DownloadProgress {
|
||||
part_title: None,
|
||||
part_order: None,
|
||||
episode_title: episode.title.clone(),
|
||||
episode_title_in_collection: None,
|
||||
episode_order: episode.index,
|
||||
up_name: Some(info.up_info.uname.clone()),
|
||||
up_uid: Some(info.up_info.mid),
|
||||
@@ -338,6 +342,18 @@ impl DownloadProgress {
|
||||
let audio_selected = self.audio_task.selected;
|
||||
let audio_completed = self.audio_task.completed;
|
||||
|
||||
// 通过合集批量创建的任务时,合集接口只提供视频在合集内的标题
|
||||
// 所以在创建任务阶段,episode_title暂时用它占位
|
||||
// 在真正开始下载前,需要重新获取视频的真实标题
|
||||
if self.episode_type == EpisodeType::Normal && self.episode_title_in_collection.is_some() {
|
||||
let bili_client = app.get_bili_client();
|
||||
let info = bili_client
|
||||
.get_normal_info(GetNormalInfoParams::Aid(self.aid))
|
||||
.await
|
||||
.wrap_err("获取视频信息失败")?;
|
||||
self.episode_title = info.title;
|
||||
}
|
||||
|
||||
if (!video_selected && !audio_selected) || (video_completed && audio_completed) {
|
||||
// 如果视频和音频都没有选中,或者都已经完成,则更新需要格式化的字段就返回
|
||||
self.update_fmt_fields(app)
|
||||
@@ -352,6 +368,7 @@ impl DownloadProgress {
|
||||
let Some(bvid) = &self.bvid else {
|
||||
return Err(eyre!("progress中的bvid为None,无法获取视频链接"));
|
||||
};
|
||||
|
||||
let media_url = bili_client
|
||||
.get_normal_url(bvid, self.cid)
|
||||
.await
|
||||
@@ -442,6 +459,7 @@ impl DownloadProgress {
|
||||
pub_ts: self.pub_ts,
|
||||
collection_title: self.collection_title.clone(),
|
||||
episode_title: self.episode_title.clone(),
|
||||
episode_title_in_collection: self.episode_title_in_collection.clone(),
|
||||
episode_order: self.episode_order,
|
||||
part_title: self.part_title.clone(),
|
||||
part_order: self.part_order,
|
||||
@@ -526,6 +544,7 @@ fn create_normal_progresses_for_single(
|
||||
part_title: Some(page.part.clone()),
|
||||
part_order: Some(page.page),
|
||||
episode_title: info.title.clone(),
|
||||
episode_title_in_collection: None,
|
||||
episode_order: 1,
|
||||
up_name: Some(info.owner.name.clone()),
|
||||
up_uid: Some(info.owner.mid),
|
||||
@@ -564,6 +583,7 @@ fn create_normal_progresses_for_single(
|
||||
part_title: None,
|
||||
part_order: None,
|
||||
episode_title: info.title.clone(),
|
||||
episode_title_in_collection: None,
|
||||
episode_order: 1,
|
||||
up_name: Some(info.owner.name.clone()),
|
||||
up_uid: Some(info.owner.mid),
|
||||
@@ -602,6 +622,7 @@ fn create_normal_progresses_for_single(
|
||||
part_title: Some(page.part.clone()),
|
||||
part_order: Some(page.page),
|
||||
episode_title: info.title.clone(),
|
||||
episode_title_in_collection: None,
|
||||
episode_order: 1,
|
||||
up_name: Some(info.owner.name.clone()),
|
||||
up_uid: Some(info.owner.mid),
|
||||
@@ -653,6 +674,10 @@ fn create_normal_progresses_for_season(
|
||||
|
||||
let tasks = Tasks::new(config, &ep.arc.pic);
|
||||
|
||||
// 合集接口返回的只有在合集内的标题,视频标题先用它占位,到prepare时再按aid获取真实标题
|
||||
let episode_title = ep.title.clone();
|
||||
let episode_title_in_collection = Some(ep.title.clone());
|
||||
|
||||
let create_ts = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
|
||||
|
||||
if let Some(cid) = cid {
|
||||
@@ -672,7 +697,8 @@ fn create_normal_progresses_for_season(
|
||||
collection_title: ugc_season.title.clone(),
|
||||
part_title: Some(page.part.clone()),
|
||||
part_order: Some(page.page),
|
||||
episode_title: ep.title.clone(),
|
||||
episode_title: episode_title.clone(),
|
||||
episode_title_in_collection: episode_title_in_collection.clone(),
|
||||
episode_order,
|
||||
up_name: Some(info.owner.name.clone()),
|
||||
up_uid: Some(info.owner.mid),
|
||||
@@ -710,7 +736,8 @@ fn create_normal_progresses_for_season(
|
||||
collection_title: ugc_season.title.clone(),
|
||||
part_title: None,
|
||||
part_order: None,
|
||||
episode_title: ep.title.clone(),
|
||||
episode_title: episode_title.clone(),
|
||||
episode_title_in_collection: episode_title_in_collection.clone(),
|
||||
episode_order,
|
||||
up_name: Some(info.owner.name.clone()),
|
||||
up_uid: Some(info.owner.mid),
|
||||
@@ -749,7 +776,8 @@ fn create_normal_progresses_for_season(
|
||||
collection_title: ugc_season.title.clone(),
|
||||
part_title: Some(page.part.clone()),
|
||||
part_order: Some(page.page),
|
||||
episode_title: ep.title.clone(),
|
||||
episode_title: episode_title.clone(),
|
||||
episode_title_in_collection: episode_title_in_collection.clone(),
|
||||
episode_order,
|
||||
up_name: Some(info.owner.name.clone()),
|
||||
up_uid: Some(info.owner.mid),
|
||||
|
||||
@@ -130,6 +130,7 @@ impl DownloadTask {
|
||||
ep_id = progress.ep_id,
|
||||
collection_title = progress.collection_title,
|
||||
episode_title = progress.episode_title,
|
||||
episode_title_in_collection = progress.episode_title_in_collection,
|
||||
episode_order = progress.episode_order,
|
||||
part_title = progress.part_title,
|
||||
part_order = progress.part_order,
|
||||
@@ -278,6 +279,7 @@ impl DownloadTask {
|
||||
ep_id = self.trace_fields.ep_id,
|
||||
collection_title = self.trace_fields.collection_title,
|
||||
episode_title = self.trace_fields.episode_title,
|
||||
episode_title_in_collection = self.trace_fields.episode_title_in_collection,
|
||||
episode_order = self.trace_fields.episode_order,
|
||||
part_title = self.trace_fields.part_title,
|
||||
part_order = self.trace_fields.part_order,
|
||||
@@ -484,6 +486,7 @@ impl DownloadTask {
|
||||
ep_id = self.trace_fields.ep_id,
|
||||
collection_title = self.trace_fields.collection_title,
|
||||
episode_title = self.trace_fields.episode_title,
|
||||
episode_title_in_collection = self.trace_fields.episode_title_in_collection,
|
||||
episode_order = self.trace_fields.episode_order,
|
||||
part_title = self.trace_fields.part_title,
|
||||
part_order = self.trace_fields.part_order,
|
||||
@@ -546,6 +549,7 @@ pub struct DownloadTaskTraceFields {
|
||||
pub ep_id: Option<i64>,
|
||||
pub collection_title: String,
|
||||
pub episode_title: String,
|
||||
pub episode_title_in_collection: Option<String>,
|
||||
pub episode_order: i64,
|
||||
pub part_title: Option<String>,
|
||||
pub part_order: Option<i64>,
|
||||
@@ -564,6 +568,7 @@ impl From<&DownloadProgress> for DownloadTaskTraceFields {
|
||||
ep_id: progress.ep_id,
|
||||
collection_title: progress.collection_title.clone(),
|
||||
episode_title: progress.episode_title.clone(),
|
||||
episode_title_in_collection: progress.episode_title_in_collection.clone(),
|
||||
episode_order: progress.episode_order,
|
||||
part_title: progress.part_title.clone(),
|
||||
part_order: progress.part_order,
|
||||
|
||||
@@ -25,6 +25,7 @@ pub struct FmtParams {
|
||||
pub pub_ts: i64,
|
||||
pub collection_title: String,
|
||||
pub episode_title: String,
|
||||
pub episode_title_in_collection: Option<String>,
|
||||
pub episode_order: i64,
|
||||
pub part_title: Option<String>,
|
||||
pub part_order: Option<i64>,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
use std::{io, path::PathBuf, sync::Arc};
|
||||
|
||||
use eyre::{WrapErr, eyre};
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -98,54 +98,29 @@ impl VideoProcessTask {
|
||||
|
||||
let output_path = episode_dir.join(format!("{filename}-merged.mp4"));
|
||||
|
||||
let (tx, rx) = tokio::sync::oneshot::channel();
|
||||
let video_path_clone = video_path.clone();
|
||||
let audio_path_clone = audio_path.clone();
|
||||
let metadata_path_clone = metadata_path.clone();
|
||||
let output_path_clone = output_path.clone();
|
||||
let mut command = std::process::Command::new(ffmpeg_program);
|
||||
|
||||
let current_span = tracing::Span::current();
|
||||
tauri::async_runtime::spawn_blocking(move || {
|
||||
let _enter = current_span.enter();
|
||||
|
||||
let mut command = std::process::Command::new(ffmpeg_program);
|
||||
|
||||
command.arg("-i").arg(video_path_clone);
|
||||
command.arg("-i").arg(audio_path_clone);
|
||||
if let Some(metadata_path) = metadata_path_clone {
|
||||
command.arg("-i").arg(metadata_path);
|
||||
command.arg("-map_metadata").arg("2");
|
||||
}
|
||||
|
||||
command.arg("-c").arg("copy");
|
||||
command.arg("-map").arg("0:v:0");
|
||||
command.arg("-map").arg("1:a:0");
|
||||
|
||||
command.arg(output_path_clone).arg("-y");
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
// 隐藏窗口
|
||||
use std::os::windows::process::CommandExt;
|
||||
command.creation_flags(0x0800_0000);
|
||||
}
|
||||
|
||||
let output = command.output();
|
||||
|
||||
let _ = tx.send(output);
|
||||
});
|
||||
|
||||
let output = rx.await??;
|
||||
|
||||
if !output.status.success() {
|
||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||
let stdout = String::from_utf8_lossy(&output.stdout);
|
||||
let err = eyre!(format!("STDOUT: {stdout}"))
|
||||
.wrap_err(format!("STDERR: {stderr}"))
|
||||
.wrap_err("原因可能是视频或音频文件损坏,建议[重来]试试");
|
||||
return Err(err);
|
||||
command.arg("-i").arg(&video_path);
|
||||
command.arg("-i").arg(&audio_path);
|
||||
if let Some(metadata_path) = &metadata_path {
|
||||
command.arg("-i").arg(metadata_path);
|
||||
command.arg("-map_metadata").arg("2");
|
||||
}
|
||||
|
||||
command.arg("-c").arg("copy");
|
||||
command.arg("-map").arg("0:v:0");
|
||||
command.arg("-map").arg("1:a:0");
|
||||
command.arg(&output_path).arg("-y");
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
// 隐藏窗口
|
||||
use std::os::windows::process::CommandExt;
|
||||
command.creation_flags(0x0800_0000);
|
||||
}
|
||||
|
||||
execute_ffmpeg(command).await.wrap_err("执行FFmpeg失败")?;
|
||||
|
||||
std::fs::remove_file(&video_path)
|
||||
.wrap_err(format!("删除视频文件`{}`失败", video_path.display()))?;
|
||||
std::fs::remove_file(&audio_path)
|
||||
@@ -192,49 +167,24 @@ impl VideoProcessTask {
|
||||
|
||||
let ffmpeg_program = utils::get_ffmpeg_program().wrap_err("获取FFmpeg程序路径失败")?;
|
||||
|
||||
let (tx, rx) = tokio::sync::oneshot::channel();
|
||||
let video_path_clone = video_path.clone();
|
||||
let audio_path_clone = audio_path.clone();
|
||||
let output_path_clone = output_path.clone();
|
||||
let mut command = std::process::Command::new(ffmpeg_program);
|
||||
|
||||
let current_span = tracing::Span::current();
|
||||
tauri::async_runtime::spawn_blocking(move || {
|
||||
let _enter = current_span.enter();
|
||||
command.arg("-i").arg(&video_path);
|
||||
command.arg("-i").arg(&audio_path);
|
||||
command.arg("-c").arg("copy");
|
||||
command.arg("-map").arg("0:v:0");
|
||||
command.arg("-map").arg("1:a:0");
|
||||
command.arg(&output_path).arg("-y");
|
||||
|
||||
let mut command = std::process::Command::new(ffmpeg_program);
|
||||
|
||||
command.arg("-i").arg(video_path_clone);
|
||||
command.arg("-i").arg(audio_path_clone);
|
||||
|
||||
command.arg("-c").arg("copy");
|
||||
command.arg("-map").arg("0:v:0");
|
||||
command.arg("-map").arg("1:a:0");
|
||||
|
||||
command.arg(output_path_clone).arg("-y");
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
// 隐藏窗口
|
||||
use std::os::windows::process::CommandExt;
|
||||
command.creation_flags(0x0800_0000);
|
||||
}
|
||||
|
||||
let output = command.output();
|
||||
|
||||
let _ = tx.send(output);
|
||||
});
|
||||
|
||||
let output = rx.await??;
|
||||
|
||||
if !output.status.success() {
|
||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||
let stdout = String::from_utf8_lossy(&output.stdout);
|
||||
let err = eyre!(format!("STDOUT: {stdout}"))
|
||||
.wrap_err(format!("STDERR: {stderr}"))
|
||||
.wrap_err("原因可能是视频或音频文件损坏,建议[重来]试试");
|
||||
return Err(err);
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
// 隐藏窗口
|
||||
use std::os::windows::process::CommandExt;
|
||||
command.creation_flags(0x0800_0000);
|
||||
}
|
||||
|
||||
execute_ffmpeg(command).await.wrap_err("执行FFmpeg失败")?;
|
||||
|
||||
std::fs::remove_file(&video_path)
|
||||
.wrap_err(format!("删除视频文件`{}`失败", video_path.display()))?;
|
||||
std::fs::remove_file(&audio_path)
|
||||
@@ -279,48 +229,23 @@ impl VideoProcessTask {
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
let (tx, rx) = tokio::sync::oneshot::channel();
|
||||
let video_path_clone = video_path.clone();
|
||||
let metadata_path_clone = metadata_path.clone();
|
||||
let output_path_clone = output_path.clone();
|
||||
let mut command = std::process::Command::new(ffmpeg_program);
|
||||
|
||||
let current_span = tracing::Span::current();
|
||||
tauri::async_runtime::spawn_blocking(move || {
|
||||
let _enter = current_span.enter();
|
||||
command.arg("-i").arg(&video_path);
|
||||
command.arg("-i").arg(&metadata_path);
|
||||
command.arg("-map_metadata").arg("1");
|
||||
command.arg("-c").arg("copy");
|
||||
command.arg(&output_path).arg("-y");
|
||||
|
||||
let mut command = std::process::Command::new(ffmpeg_program);
|
||||
|
||||
command.arg("-i").arg(video_path_clone);
|
||||
command.arg("-i").arg(metadata_path_clone);
|
||||
|
||||
command.arg("-map_metadata").arg("1");
|
||||
command.arg("-c").arg("copy");
|
||||
|
||||
command.arg(output_path_clone).arg("-y");
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
// 隐藏窗口
|
||||
use std::os::windows::process::CommandExt;
|
||||
command.creation_flags(0x0800_0000);
|
||||
}
|
||||
|
||||
let output = command.output();
|
||||
|
||||
let _ = tx.send(output);
|
||||
});
|
||||
|
||||
let output = rx.await??;
|
||||
|
||||
if !output.status.success() {
|
||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||
let stdout = String::from_utf8_lossy(&output.stdout);
|
||||
let err = eyre!(format!("STDOUT: {stdout}"))
|
||||
.wrap_err(format!("STDERR: {stderr}"))
|
||||
.wrap_err("原因可能是视频或音频文件损坏,建议[重来]试试");
|
||||
return Err(err);
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
// 隐藏窗口
|
||||
use std::os::windows::process::CommandExt;
|
||||
command.creation_flags(0x0800_0000);
|
||||
}
|
||||
|
||||
execute_ffmpeg(command).await.wrap_err("执行FFmpeg失败")?;
|
||||
|
||||
std::fs::remove_file(&video_path)
|
||||
.wrap_err(format!("删除视频文件`{}`失败", video_path.display()))?;
|
||||
std::fs::rename(&output_path, &video_path).wrap_err(format!(
|
||||
@@ -388,3 +313,32 @@ impl VideoProcessTask {
|
||||
Ok(Some(metadata_path))
|
||||
}
|
||||
}
|
||||
|
||||
#[instrument(level = "error", skip_all)]
|
||||
async fn execute_ffmpeg(mut command: std::process::Command) -> eyre::Result<()> {
|
||||
let span = tracing::Span::current();
|
||||
|
||||
tauri::async_runtime::spawn_blocking(move || {
|
||||
let _enter = span.enter();
|
||||
|
||||
let program = command.get_program().to_string_lossy().into_owned();
|
||||
let output = command.output().map_err(|err| {
|
||||
if err.kind() == io::ErrorKind::NotFound {
|
||||
eyre!(err).wrap_err(format!("找不到FFmpeg `{program}`"))
|
||||
} else {
|
||||
eyre!(err)
|
||||
}
|
||||
})?;
|
||||
|
||||
if output.status.success() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||
let stdout = String::from_utf8_lossy(&output.stdout);
|
||||
Err(eyre!(format!("STDOUT: {stdout}")))
|
||||
.wrap_err(format!("STDERR: {stderr}"))
|
||||
.wrap_err("原因可能是视频或音频文件损坏,建议[重来]试试")
|
||||
})
|
||||
.await?
|
||||
}
|
||||
|
||||
@@ -106,6 +106,7 @@ pub fn run() {
|
||||
}
|
||||
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_window_state::Builder::default().build())
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.plugin(tauri_plugin_os::init())
|
||||
.plugin(tauri_plugin_opener::init())
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
"height": 600,
|
||||
"minWidth": 800,
|
||||
"minHeight": 600,
|
||||
"visible": false,
|
||||
"decorations": false,
|
||||
"theme": "Light"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,11 @@
|
||||
"height": 600,
|
||||
"minWidth": 800,
|
||||
"minHeight": 600,
|
||||
"visible": false,
|
||||
"hiddenTitle": true,
|
||||
"titleBarStyle": "Overlay",
|
||||
"theme": "Light"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,11 @@
|
||||
"height": 600,
|
||||
"minWidth": 800,
|
||||
"minHeight": 600,
|
||||
"visible": false,
|
||||
"decorations": false,
|
||||
"shadow": true,
|
||||
"theme": "Light"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -329,7 +329,7 @@ export type Dimension = { width: number; height: number; rotate: number }
|
||||
export type DimensionInBangumi = { height: number; rotate: number; width: number }
|
||||
export type DimensionInWatchLater = { width: number; height: number; rotate: number }
|
||||
export type DownloadEvent = { event: "Speed"; data: { speed: string } } | { event: "TaskCreate"; data: { state: DownloadTaskState; progress: DownloadProgress } } | { event: "TaskStateUpdate"; data: { task_id: string; state: DownloadTaskState } } | { event: "TaskSleeping"; data: { task_id: string; remaining_sec: number } } | { event: "TaskDelete"; data: { task_id: string } } | { event: "ProgressPreparing"; data: { task_id: string } } | { event: "ProgressUpdate"; data: { progress: DownloadProgress } }
|
||||
export type DownloadProgress = { task_id: string; episode_type: EpisodeType; aid: number; bvid: string | null; cid: number; ep_id: number | null; duration: number; pub_ts: number; collection_title: string; part_title: string | null; part_order: number | null; episode_title: string; episode_order: number; up_name: string | null; up_uid: number | null; up_avatar: string | null; episode_dir: string; filename: string; video_task: VideoTask; audio_task: AudioTask; video_process_task: VideoProcessTask; subtitle_task: SubtitleTask; danmaku_task: DanmakuTask; cover_task: CoverTask; nfo_task: NfoTask; json_task: JsonTask; create_ts: number; completed_ts: number | null; is_drm: boolean; is_preview: boolean }
|
||||
export type DownloadProgress = { task_id: string; episode_type: EpisodeType; aid: number; bvid: string | null; cid: number; ep_id: number | null; duration: number; pub_ts: number; collection_title: string; part_title: string | null; part_order: number | null; episode_title: string; episode_title_in_collection: string | null; episode_order: number; up_name: string | null; up_uid: number | null; up_avatar: string | null; episode_dir: string; filename: string; video_task: VideoTask; audio_task: AudioTask; video_process_task: VideoProcessTask; subtitle_task: SubtitleTask; danmaku_task: DanmakuTask; cover_task: CoverTask; nfo_task: NfoTask; json_task: JsonTask; create_ts: number; completed_ts: number | null; is_drm: boolean; is_preview: boolean }
|
||||
export type DownloadTaskState = "Pending" | "Downloading" | "Paused" | "Completed" | "Failed"
|
||||
export type Ed = { end: number; start: number }
|
||||
export type EpInBangumi = { aid: number; badge: string; badge_info: BadgeInfoInBangumi; 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 }
|
||||
|
||||
@@ -56,13 +56,17 @@ function AvailableFmtFields() {
|
||||
<div>
|
||||
<span class="rounded bg-gray-500 px-1 select-all">collection_title</span>
|
||||
<span class="ml-2">
|
||||
合集名称,
|
||||
<span class="text-blue">对于单独(没有合集)的视频,合集名称就是视频名称</span>
|
||||
合集标题,
|
||||
<span class="text-blue">对于单独(没有合集)的视频,合集标题就是视频标题</span>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="rounded bg-gray-500 px-1 select-all">episode_title</span>
|
||||
<span class="ml-2">视频名称</span>
|
||||
<span class="ml-2">视频标题</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="rounded bg-gray-500 px-1 select-all">episode_title_in_collection</span>
|
||||
<span class="ml-2">视频在合集内的标题</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="rounded bg-gray-500 px-1 select-all">episode_order</span>
|
||||
@@ -83,7 +87,7 @@ function AvailableFmtFields() {
|
||||
</div>
|
||||
<div>
|
||||
<span class="rounded bg-gray-500 px-1 select-all">part_title</span>
|
||||
<span class="ml-2">分P名称</span>
|
||||
<span class="ml-2">分P标题</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="rounded bg-gray-500 px-1 select-all">part_order</span>
|
||||
|
||||
Reference in New Issue
Block a user