fix download fails in batch mode

This commit is contained in:
Julian Freeman
2025-12-30 01:06:44 -04:00
parent 0a439dbd71
commit 63648f9d7c
6 changed files with 14 additions and 8 deletions

2
src-tauri/Cargo.lock generated
View File

@@ -3971,7 +3971,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = "stream-capture"
version = "1.0.1"
version = "1.1.0"
dependencies = [
"anyhow",
"chrono",

View File

@@ -1,6 +1,6 @@
[package]
name = "stream-capture"
version = "1.0.1"
version = "1.1.0"
description = "A Tauri App"
authors = ["you"]
edition = "2021"

View File

@@ -15,6 +15,7 @@ pub struct VideoMetadata {
pub thumbnail: String,
pub duration: Option<f64>,
pub uploader: Option<String>,
pub url: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
@@ -150,12 +151,17 @@ fn parse_video_metadata(json: &serde_json::Value) -> VideoMetadata {
_ => format!("https://i.ytimg.com/vi/{}/mqdefault.jpg", id),
};
let url = json["webpage_url"].as_str()
.or_else(|| json["url"].as_str())
.map(|s| s.to_string());
VideoMetadata {
id,
title: json["title"].as_str().unwrap_or("Unknown Title").to_string(),
thumbnail,
duration: json["duration"].as_f64(),
uploader: json["uploader"].as_str().map(|s| s.to_string()),
url,
}
}

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "StreamCapture",
"version": "1.0.1",
"version": "1.1.0",
"identifier": "top.volan.stream-capture",
"build": {
"beforeDevCommand": "pnpm dev",
@@ -13,7 +13,7 @@
"windows": [
{
"label": "main",
"title": "流萤 - 视频下载 v1.0.1",
"title": "流萤 - 视频下载 v1.1.0",
"width": 1300,
"height": 900,
"visible": false