mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-16 13:23:41 +00:00
fix(ffmpeg): use app-writable temporary directory for stream buffers
This commit is contained in:
1 parent
9124976b5c
commit
637004c8a8
6 files changed
+61
-8
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user