fix ffmpeg download
This commit is contained in:
@@ -3,8 +3,3 @@
|
||||
A simple Youtube downloader.
|
||||
|
||||
Generated by Gemini CLI.
|
||||
|
||||
## Problems
|
||||
|
||||
1. windows 上打包后运行命令会出现黑窗,而且还是会出现找不到 js-runtimes 的问题,但是 quickjs 是正常下载了
|
||||
2. macos 上未测试
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "stream-capture",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@@ -3971,7 +3971,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||
|
||||
[[package]]
|
||||
name = "stream-capture"
|
||||
version = "0.1.0"
|
||||
version = "1.0.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "stream-capture"
|
||||
version = "0.1.0"
|
||||
version = "1.0.1"
|
||||
description = "A Tauri App"
|
||||
authors = ["you"]
|
||||
edition = "2021"
|
||||
|
||||
@@ -308,17 +308,19 @@ pub async fn download_ffmpeg(app: &AppHandle) -> Result<PathBuf> {
|
||||
for asset in assets {
|
||||
if let (Some(name), Some(url)) = (asset.get("name").and_then(|n| n.as_str()), asset.get("browser_download_url").and_then(|u| u.as_str())) {
|
||||
let lname = name.to_lowercase();
|
||||
if lname.contains("win64") && lname.ends_with(".zip") {
|
||||
// Prefer GPL static build, avoid shared to get a single exe
|
||||
if lname.contains("win64") && lname.contains("gpl") && !lname.contains("shared") && lname.ends_with(".zip") {
|
||||
download_url = Some(url.to_string());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if download_url.is_none() {
|
||||
// fallback: choose first zip asset
|
||||
// fallback: choose first zip asset that is NOT shared if possible
|
||||
for asset in assets {
|
||||
if let (Some(url), Some(name)) = (asset.get("browser_download_url").and_then(|u| u.as_str()), asset.get("name").and_then(|n| n.as_str())) {
|
||||
if name.to_lowercase().ends_with(".zip") {
|
||||
let lname = name.to_lowercase();
|
||||
if lname.ends_with(".zip") && !lname.contains("shared") {
|
||||
download_url = Some(url.to_string());
|
||||
break;
|
||||
}
|
||||
@@ -341,7 +343,8 @@ pub async fn download_ffmpeg(app: &AppHandle) -> Result<PathBuf> {
|
||||
if file.is_dir() { continue; }
|
||||
let name = file.name().to_string();
|
||||
let filename_only = name.split('/').last().unwrap_or("");
|
||||
if filename_only.eq_ignore_ascii_case("ffmpeg.exe") || filename_only.ends_with(".dll") {
|
||||
// Only extract the executable, ignore DLLs
|
||||
if filename_only.eq_ignore_ascii_case("ffmpeg.exe") {
|
||||
let mut out_file = fs::File::create(bin_dir.join(filename_only))?;
|
||||
std::io::copy(&mut file, &mut out_file)?;
|
||||
found = true;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "StreamCapture",
|
||||
"version": "1.0.0",
|
||||
"productName": "流萤-视频下载",
|
||||
"version": "1.0.1",
|
||||
"identifier": "top.volan.stream-capture",
|
||||
"build": {
|
||||
"beforeDevCommand": "pnpm dev",
|
||||
@@ -13,7 +13,7 @@
|
||||
"windows": [
|
||||
{
|
||||
"label": "main",
|
||||
"title": "流萤 - 视频下载 v1.0.0",
|
||||
"title": "流萤 - 视频下载 v1.0.1",
|
||||
"width": 1300,
|
||||
"height": 900,
|
||||
"visible": false
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// filepath: src/App.vue
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from 'vue'
|
||||
import { RouterView, RouterLink, useRoute } from 'vue-router'
|
||||
|
||||
Reference in New Issue
Block a user