Compare commits
4 Commits
63648f9d7c
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d5cac7a46 | ||
|
|
bbcb10b3ca | ||
|
|
1554be25d2 | ||
|
|
05887fd7a3 |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "stream-capture",
|
"name": "stream-capture",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
3
src-tauri/Cargo.lock
generated
3
src-tauri/Cargo.lock
generated
@@ -3971,9 +3971,10 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "stream-capture"
|
name = "stream-capture"
|
||||||
version = "1.1.0"
|
version = "1.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
"base64 0.22.1",
|
||||||
"chrono",
|
"chrono",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"regex",
|
"regex",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "stream-capture"
|
name = "stream-capture"
|
||||||
version = "1.1.0"
|
version = "1.2.0"
|
||||||
description = "A Tauri App"
|
description = "A Tauri App"
|
||||||
authors = ["you"]
|
authors = ["you"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
@@ -19,6 +19,7 @@ tauri-plugin-dialog = "2"
|
|||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
reqwest = { version = "0.12", features = ["json", "rustls-tls", "stream"] }
|
reqwest = { version = "0.12", features = ["json", "rustls-tls", "stream"] }
|
||||||
|
base64 = "0.22"
|
||||||
tokio = { version = "1", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
chrono = { version = "0.4", features = ["serde"] }
|
chrono = { version = "0.4", features = ["serde"] }
|
||||||
|
|||||||
@@ -49,6 +49,28 @@ pub fn get_ffmpeg_version(app: AppHandle) -> Result<String, String> {
|
|||||||
binary_manager::get_ffmpeg_version(&app).map_err(|e| e.to_string())
|
binary_manager::get_ffmpeg_version(&app).map_err(|e| e.to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn fetch_image(url: String) -> Result<String, String> {
|
||||||
|
use base64::{Engine as _, engine::general_purpose};
|
||||||
|
|
||||||
|
let client = reqwest::Client::new();
|
||||||
|
let res = client.get(&url)
|
||||||
|
.header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36")
|
||||||
|
.send()
|
||||||
|
.await
|
||||||
|
.map_err(|e| e.to_string())?;
|
||||||
|
|
||||||
|
let bytes = res.bytes().await.map_err(|e| e.to_string())?;
|
||||||
|
|
||||||
|
// Convert to base64
|
||||||
|
let b64 = general_purpose::STANDARD.encode(&bytes);
|
||||||
|
|
||||||
|
// Simple heuristic for mime type
|
||||||
|
let mime = if url.to_lowercase().ends_with(".png") { "image/png" } else { "image/jpeg" };
|
||||||
|
|
||||||
|
Ok(format!("data:{};base64,{}", mime, b64))
|
||||||
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn fetch_metadata(app: AppHandle, url: String, parse_mix_playlist: bool) -> Result<downloader::MetadataResult, String> {
|
pub async fn fetch_metadata(app: AppHandle, url: String, parse_mix_playlist: bool) -> Result<downloader::MetadataResult, String> {
|
||||||
downloader::fetch_metadata(&app, &url, parse_mix_playlist).await.map_err(|e| e.to_string())
|
downloader::fetch_metadata(&app, &url, parse_mix_playlist).await.map_err(|e| e.to_string())
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
use anyhow::{Result, anyhow};
|
use anyhow::{Result, anyhow};
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use crate::binary_manager;
|
use crate::binary_manager;
|
||||||
|
use crate::storage;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub struct VideoMetadata {
|
pub struct VideoMetadata {
|
||||||
@@ -38,6 +39,7 @@ pub struct DownloadOptions {
|
|||||||
pub quality: String, // e.g., "1080", "720", "best"
|
pub quality: String, // e.g., "1080", "720", "best"
|
||||||
pub output_path: String, // Directory
|
pub output_path: String, // Directory
|
||||||
pub output_format: String, // "original", "mp4", "webm", "mkv", "m4a", "aac", "opus", "vorbis", "wav", etc.
|
pub output_format: String, // "original", "mp4", "webm", "mkv", "m4a", "aac", "opus", "vorbis", "wav", etc.
|
||||||
|
pub cookies_path: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Clone, Debug)]
|
#[derive(Serialize, Clone, Debug)]
|
||||||
@@ -67,29 +69,75 @@ pub async fn fetch_metadata(app: &AppHandle, url: &str, parse_mix_playlist: bool
|
|||||||
let ytdlp_path = binary_manager::get_ytdlp_path(app)?;
|
let ytdlp_path = binary_manager::get_ytdlp_path(app)?;
|
||||||
let qjs_path = binary_manager::get_qjs_path(app)?; // Get absolute path to quickjs
|
let qjs_path = binary_manager::get_qjs_path(app)?; // Get absolute path to quickjs
|
||||||
|
|
||||||
let mut cmd = Command::new(ytdlp_path);
|
// Load settings to check for cookies
|
||||||
#[cfg(target_os = "windows")]
|
let settings = storage::load_settings(app)?;
|
||||||
cmd.creation_flags(0x08000000);
|
|
||||||
|
let mut args = Vec::new();
|
||||||
|
|
||||||
// Pass the runtime and its absolute path to --js-runtimes
|
// Pass the runtime and its absolute path to --js-runtimes
|
||||||
// Rust's Command automatically handles spaces in arguments, so we should NOT quote the path here.
|
// Rust's Command automatically handles spaces in arguments, so we should NOT quote the path here.
|
||||||
cmd.arg("--js-runtimes").arg(format!("quickjs:{}", qjs_path.to_string_lossy()));
|
args.push("--js-runtimes".to_string());
|
||||||
|
args.push(format!("quickjs:{}", qjs_path.to_string_lossy()));
|
||||||
|
|
||||||
cmd.arg("--dump-single-json")
|
let mut has_cookies = false;
|
||||||
.arg("--flat-playlist")
|
if let Some(cookies) = &settings.cookies_path {
|
||||||
.arg("--no-warnings");
|
if !cookies.is_empty() {
|
||||||
|
if std::path::Path::new(cookies).exists() {
|
||||||
// Optimize metadata fetching: skip heavy manifests and player JS execution.
|
args.push("--cookies".to_string());
|
||||||
// Skipping JS prevents slow QuickJS spin-up and signature decryption, drastically speeding up single video parsing.
|
args.push(cookies.clone());
|
||||||
cmd.arg("--extractor-args").arg("youtube:skip=dash,hls,translated_subs;player_skip=js");
|
has_cookies = true;
|
||||||
|
app.emit("download-log", LogEvent {
|
||||||
if parse_mix_playlist {
|
id: "Analysis".to_string(),
|
||||||
cmd.arg("--playlist-end").arg("20");
|
message: format!("已加载 Cookies: {}", cookies),
|
||||||
|
level: "info".to_string(),
|
||||||
|
}).ok();
|
||||||
|
} else {
|
||||||
|
app.emit("download-log", LogEvent {
|
||||||
|
id: "Analysis".to_string(),
|
||||||
|
message: format!("Cookies 文件不存在: {}", cookies),
|
||||||
|
level: "error".to_string(),
|
||||||
|
}).ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.arg(url);
|
args.push("--dump-single-json".to_string());
|
||||||
|
args.push("--flat-playlist".to_string());
|
||||||
|
args.push("--no-warnings".to_string());
|
||||||
|
|
||||||
|
if has_cookies {
|
||||||
|
// When using cookies, avoid skipping JS player to prevent challenge errors
|
||||||
|
args.push("--extractor-args".to_string());
|
||||||
|
args.push("youtube:skip=dash,hls,translated_subs".to_string());
|
||||||
|
} else {
|
||||||
|
// Optimize metadata fetching: skip heavy manifests and player JS execution.
|
||||||
|
// Skipping JS prevents slow QuickJS spin-up and signature decryption, drastically speeding up single video parsing.
|
||||||
|
args.push("--extractor-args".to_string());
|
||||||
|
args.push("youtube:skip=dash,hls,translated_subs;player_skip=js".to_string());
|
||||||
|
}
|
||||||
|
|
||||||
|
if parse_mix_playlist {
|
||||||
|
args.push("--playlist-end".to_string());
|
||||||
|
args.push("20".to_string());
|
||||||
|
}
|
||||||
|
|
||||||
|
args.push(url.to_string());
|
||||||
|
|
||||||
|
let mut cmd = Command::new(&ytdlp_path);
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
cmd.creation_flags(0x08000000);
|
||||||
|
|
||||||
|
cmd.args(&args);
|
||||||
cmd.stderr(Stdio::piped());
|
cmd.stderr(Stdio::piped());
|
||||||
|
|
||||||
|
// Log the full command
|
||||||
|
let full_cmd_str = format!("{} {}", ytdlp_path.to_string_lossy(), args.join(" "));
|
||||||
|
app.emit("download-log", LogEvent {
|
||||||
|
id: "Analysis".to_string(),
|
||||||
|
message: format!("正在执行分析命令: {}", full_cmd_str),
|
||||||
|
level: "info".to_string(),
|
||||||
|
}).ok();
|
||||||
|
|
||||||
let output = cmd.output().await?;
|
let output = cmd.output().await?;
|
||||||
|
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
@@ -185,6 +233,13 @@ pub async fn download_video(
|
|||||||
args.push("--ffmpeg-location".to_string());
|
args.push("--ffmpeg-location".to_string());
|
||||||
args.push(ffmpeg_path.to_string_lossy().to_string());
|
args.push(ffmpeg_path.to_string_lossy().to_string());
|
||||||
|
|
||||||
|
if let Some(cookies) = &options.cookies_path {
|
||||||
|
if !cookies.is_empty() {
|
||||||
|
args.push("--cookies".to_string());
|
||||||
|
args.push(cookies.clone());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
args.push(url);
|
args.push(url);
|
||||||
|
|
||||||
// Output template
|
// Output template
|
||||||
@@ -204,7 +259,7 @@ pub async fn download_video(
|
|||||||
let format_arg = if options.quality == "best" {
|
let format_arg = if options.quality == "best" {
|
||||||
"bestvideo+bestaudio/best".to_string()
|
"bestvideo+bestaudio/best".to_string()
|
||||||
} else {
|
} else {
|
||||||
format!("bestvideo[height<={}]+bestaudio/best[height<={}]", options.quality, options.quality)
|
format!("bestvideo[height<={}]+bestaudio/best[height<={}]/best", options.quality, options.quality)
|
||||||
};
|
};
|
||||||
args.push("-f".to_string());
|
args.push("-f".to_string());
|
||||||
args.push(format_arg);
|
args.push(format_arg);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ pub fn run() {
|
|||||||
commands::get_ytdlp_version,
|
commands::get_ytdlp_version,
|
||||||
commands::get_quickjs_version,
|
commands::get_quickjs_version,
|
||||||
commands::get_ffmpeg_version,
|
commands::get_ffmpeg_version,
|
||||||
|
commands::fetch_image,
|
||||||
commands::fetch_metadata,
|
commands::fetch_metadata,
|
||||||
commands::start_download,
|
commands::start_download,
|
||||||
commands::get_settings,
|
commands::get_settings,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use chrono::{DateTime, Utc};
|
|||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub struct Settings {
|
pub struct Settings {
|
||||||
pub download_path: String,
|
pub download_path: String,
|
||||||
|
pub cookies_path: Option<String>,
|
||||||
pub theme: String, // 'light', 'dark', 'system'
|
pub theme: String, // 'light', 'dark', 'system'
|
||||||
pub last_updated: Option<DateTime<Utc>>,
|
pub last_updated: Option<DateTime<Utc>>,
|
||||||
}
|
}
|
||||||
@@ -19,6 +20,7 @@ impl Default for Settings {
|
|||||||
// but for default struct we can keep it empty or a placeholder.
|
// but for default struct we can keep it empty or a placeholder.
|
||||||
Self {
|
Self {
|
||||||
download_path: "".to_string(),
|
download_path: "".to_string(),
|
||||||
|
cookies_path: None,
|
||||||
theme: "system".to_string(),
|
theme: "system".to_string(),
|
||||||
last_updated: None,
|
last_updated: None,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "StreamCapture",
|
"productName": "StreamCapture",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"identifier": "top.volan.stream-capture",
|
"identifier": "top.volan.stream-capture",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "pnpm dev",
|
"beforeDevCommand": "pnpm dev",
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
"windows": [
|
"windows": [
|
||||||
{
|
{
|
||||||
"label": "main",
|
"label": "main",
|
||||||
"title": "流萤 - 视频下载 v1.1.0",
|
"title": "流萤 - 视频下载 v1.2.0",
|
||||||
"width": 1300,
|
"width": 1300,
|
||||||
"height": 900,
|
"height": 900,
|
||||||
"visible": false
|
"visible": false
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ export const useAnalysisStore = defineStore('analysis', () => {
|
|||||||
is_audio_only: false,
|
is_audio_only: false,
|
||||||
quality: 'best',
|
quality: 'best',
|
||||||
output_path: '',
|
output_path: '',
|
||||||
output_format: 'original'
|
output_format: 'original',
|
||||||
|
cookies_path: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
function toggleEntry(id: string) {
|
function toggleEntry(id: string) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { ref } from 'vue'
|
|||||||
|
|
||||||
export interface Settings {
|
export interface Settings {
|
||||||
download_path: string
|
download_path: string
|
||||||
|
cookies_path?: string
|
||||||
theme: 'light' | 'dark' | 'system'
|
theme: 'light' | 'dark' | 'system'
|
||||||
last_updated: string | null
|
last_updated: string | null
|
||||||
}
|
}
|
||||||
@@ -12,6 +13,7 @@ export interface Settings {
|
|||||||
export const useSettingsStore = defineStore('settings', () => {
|
export const useSettingsStore = defineStore('settings', () => {
|
||||||
const settings = ref<Settings>({
|
const settings = ref<Settings>({
|
||||||
download_path: '',
|
download_path: '',
|
||||||
|
cookies_path: '',
|
||||||
theme: 'system',
|
theme: 'system',
|
||||||
last_updated: null
|
last_updated: null
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -61,6 +61,38 @@ watch(() => analysisStore.options.is_audio_only, () => {
|
|||||||
analysisStore.options.output_format = 'original'
|
analysisStore.options.output_format = 'original'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
async function processThumbnail(url: string | undefined): Promise<string | undefined> {
|
||||||
|
if (!url) return undefined;
|
||||||
|
// Check if it's an Instagram URL or similar that needs proxying
|
||||||
|
if (url.includes('instagram.com') || url.includes('fbcdn.net') || url.includes('cdninstagram.com')) {
|
||||||
|
try {
|
||||||
|
return await invoke<string>('fetch_image', { url });
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('Thumbnail fetch failed, falling back to URL', e);
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function processMetadataThumbnails(metadata: any) {
|
||||||
|
if (!metadata) return;
|
||||||
|
|
||||||
|
// Process single video thumbnail
|
||||||
|
if (metadata.thumbnail) {
|
||||||
|
metadata.thumbnail = await processThumbnail(metadata.thumbnail);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process playlist entries
|
||||||
|
if (metadata.entries && Array.isArray(metadata.entries)) {
|
||||||
|
await Promise.all(metadata.entries.map(async (entry: any) => {
|
||||||
|
if (entry.thumbnail) {
|
||||||
|
entry.thumbnail = await processThumbnail(entry.thumbnail);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function analyze() {
|
async function analyze() {
|
||||||
if (!analysisStore.url) return
|
if (!analysisStore.url) return
|
||||||
analysisStore.loading = true
|
analysisStore.loading = true
|
||||||
@@ -122,6 +154,9 @@ async function analyze() {
|
|||||||
throw new Error("所有链接解析失败或均为播放列表。");
|
throw new Error("所有链接解析失败或均为播放列表。");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Process thumbnails for batch results
|
||||||
|
await Promise.all(results.map(r => processMetadataThumbnails(r)));
|
||||||
|
|
||||||
// Construct synthetic playlist
|
// Construct synthetic playlist
|
||||||
analysisStore.metadata = {
|
analysisStore.metadata = {
|
||||||
id: 'batch_download_' + Date.now(),
|
id: 'batch_download_' + Date.now(),
|
||||||
@@ -155,6 +190,8 @@ async function analyze() {
|
|||||||
|
|
||||||
const res = await invoke<any>('fetch_metadata', { url: urlToScan, parseMixPlaylist: parseMix })
|
const res = await invoke<any>('fetch_metadata', { url: urlToScan, parseMixPlaylist: parseMix })
|
||||||
|
|
||||||
|
await processMetadataThumbnails(res);
|
||||||
|
|
||||||
// Initialize selected state for playlist entries
|
// Initialize selected state for playlist entries
|
||||||
if (res.entries) {
|
if (res.entries) {
|
||||||
res.entries = res.entries.map((e: any) => ({ ...e, selected: true }))
|
res.entries = res.entries.map((e: any) => ({ ...e, selected: true }))
|
||||||
@@ -177,6 +214,9 @@ async function startDownload() {
|
|||||||
analysisStore.options.output_path = settingsStore.settings.download_path
|
analysisStore.options.output_path = settingsStore.settings.download_path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure cookies path is set from settings
|
||||||
|
analysisStore.options.cookies_path = settingsStore.settings.cookies_path || ''
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (analysisStore.metadata.entries) {
|
if (analysisStore.metadata.entries) {
|
||||||
// Playlist Download
|
// Playlist Download
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { ref } from 'vue'
|
|||||||
import { useSettingsStore } from '../stores/settings'
|
import { useSettingsStore } from '../stores/settings'
|
||||||
import { invoke } from '@tauri-apps/api/core'
|
import { invoke } from '@tauri-apps/api/core'
|
||||||
import { open } from '@tauri-apps/plugin-dialog'
|
import { open } from '@tauri-apps/plugin-dialog'
|
||||||
import { Folder, RefreshCw, Monitor, Sun, Moon, Terminal } from 'lucide-vue-next'
|
import { Folder, RefreshCw, Monitor, Sun, Moon, Terminal, Download, FileText, X } from 'lucide-vue-next'
|
||||||
import { format } from 'date-fns' // Import format
|
import { format } from 'date-fns' // Import format
|
||||||
|
|
||||||
const settingsStore = useSettingsStore()
|
const settingsStore = useSettingsStore()
|
||||||
@@ -25,6 +25,25 @@ async function browsePath() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function browseCookies() {
|
||||||
|
const selected = await open({
|
||||||
|
multiple: false,
|
||||||
|
directory: false,
|
||||||
|
filters: [{ name: 'Text Files', extensions: ['txt', 'cookies'] }, { name: 'All Files', extensions: ['*'] }],
|
||||||
|
defaultPath: settingsStore.settings.cookies_path || undefined
|
||||||
|
})
|
||||||
|
|
||||||
|
if (selected) {
|
||||||
|
settingsStore.settings.cookies_path = selected as string
|
||||||
|
await settingsStore.save()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function clearCookies() {
|
||||||
|
settingsStore.settings.cookies_path = ''
|
||||||
|
await settingsStore.save()
|
||||||
|
}
|
||||||
|
|
||||||
async function updateYtdlp() {
|
async function updateYtdlp() {
|
||||||
updatingYtdlp.value = true
|
updatingYtdlp.value = true
|
||||||
updateStatus.value = '正在更新 yt-dlp...'
|
updateStatus.value = '正在更新 yt-dlp...'
|
||||||
@@ -98,6 +117,34 @@ function setTheme(theme: 'light' | 'dark' | 'system') {
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- Cookies Path -->
|
||||||
|
<section class="bg-white dark:bg-zinc-900 p-6 rounded-2xl shadow-sm border border-gray-200 dark:border-zinc-800">
|
||||||
|
<h2 class="text-lg font-bold mb-4 text-zinc-900 dark:text-white">Cookies 文件</h2>
|
||||||
|
<div class="flex gap-3">
|
||||||
|
<div class="flex-1 bg-gray-50 dark:bg-zinc-800 rounded-xl px-4 py-3 text-sm text-gray-600 dark:text-gray-300 font-mono border border-transparent focus-within:border-blue-500 transition-colors flex items-center justify-between group min-w-0">
|
||||||
|
<div class="truncate mr-2">
|
||||||
|
{{ settingsStore.settings.cookies_path || '未设置 (默认空)' }}
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
v-if="settingsStore.settings.cookies_path"
|
||||||
|
@click="clearCookies"
|
||||||
|
class="text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-all p-1 rounded-md hover:bg-gray-200 dark:hover:bg-zinc-700 shrink-0"
|
||||||
|
title="清除 Cookies 路径"
|
||||||
|
>
|
||||||
|
<X class="w-4 h-4" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
@click="browseCookies"
|
||||||
|
class="bg-gray-100 hover:bg-gray-200 dark:bg-zinc-800 dark:hover:bg-zinc-700 text-zinc-900 dark:text-white px-4 py-3 rounded-xl font-medium transition-colors flex items-center gap-2 shrink-0"
|
||||||
|
>
|
||||||
|
<FileText class="w-5 h-5" />
|
||||||
|
选择
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<p class="text-xs text-gray-400 mt-2">选填。请指定包含 cookies 的文本文件(Netscape 格式)。频繁使用 cookies 下载视频可能导致封号,慎用。</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
<!-- Theme -->
|
<!-- Theme -->
|
||||||
<section class="bg-white dark:bg-zinc-900 p-6 rounded-2xl shadow-sm border border-gray-200 dark:border-zinc-800">
|
<section class="bg-white dark:bg-zinc-900 p-6 rounded-2xl shadow-sm border border-gray-200 dark:border-zinc-800">
|
||||||
<h2 class="text-lg font-bold mb-4 text-zinc-900 dark:text-white">外观</h2>
|
<h2 class="text-lg font-bold mb-4 text-zinc-900 dark:text-white">外观</h2>
|
||||||
|
|||||||
Reference in New Issue
Block a user