mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-08-04 12:06:41 +08:00
feat: add configuration options for video download settings
This commit is contained in:
@@ -35,6 +35,7 @@ type Config struct {
|
||||
Storages []storage.StorageConfig `toml:"-" mapstructure:"-" json:"storages"`
|
||||
Parser parserConfig `toml:"parser" mapstructure:"parser" json:"parser"`
|
||||
Hook hookConfig `toml:"hook" mapstructure:"hook" json:"hook"`
|
||||
Ytdlp YtdlpConfig `toml:"ytdlp" mapstructure:"ytdlp" json:"ytdlp"`
|
||||
}
|
||||
|
||||
type aria2Config struct {
|
||||
@@ -131,6 +132,9 @@ func Init(ctx context.Context, configFile ...string) error {
|
||||
"api.host": "0.0.0.0",
|
||||
"api.port": 8080,
|
||||
"api.token": "",
|
||||
|
||||
// yt-dlp
|
||||
"ytdlp.recode": "mp4",
|
||||
}
|
||||
|
||||
for key, value := range defaultConfigs {
|
||||
|
||||
13
config/ytdlp.go
Normal file
13
config/ytdlp.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package config
|
||||
|
||||
type YtdlpConfig struct {
|
||||
// MaxHeight limits the video resolution by height in pixels (e.g. 1080, 720).
|
||||
// 0 means no limit (best available). Ignored when Format is set.
|
||||
MaxHeight int `toml:"max_height" mapstructure:"max_height" json:"max_height"`
|
||||
// Format is a raw yt-dlp format selector (-f). When set, it takes precedence
|
||||
// over MaxHeight and gives the user full control.
|
||||
Format string `toml:"format" mapstructure:"format" json:"format"`
|
||||
// Recode is the target video container yt-dlp recodes into (e.g. mp4).
|
||||
// Empty disables recoding.
|
||||
Recode string `toml:"recode" mapstructure:"recode" json:"recode"`
|
||||
}
|
||||
Reference in New Issue
Block a user