fix(ffmpeg): use app-writable temporary directory for stream buffers

This commit is contained in:
Levi committed 2026-09-13 18:00:10 +08:00
1 parent 9124976b5c
commit 637004c8a8
6 files changed
+61 -8

No files matched your search

+6
View File
@@ -3,6 +3,7 @@ package download
import (
"context"
"io"
"path/filepath"
"strings"
"sync"
@@ -126,7 +127,12 @@ func (d *Downloader) newExtensionEngine() (*engine.Engine, *engineSession) {
}{UserAgent: httpProtocol.DefaultUserAgent}
d.getProtocolConfig("http", &httpConfig)
userAgent := strings.TrimSpace(httpConfig.UserAgent)
tempDir := ""
if d.cfg.StorageDir != "" {
tempDir = filepath.Join(d.cfg.StorageDir, "temp", "ffmpeg")
}
e := engine.NewEngine(&engine.Config{
TempDir: tempDir,
HTTPUserAgent: &userAgent,
ProxyConfig: d.cfg.Proxy,
StreamConfig: engineCfg,