code cleanup
This commit is contained in:
60
app/types.go
Normal file
60
app/types.go
Normal file
@@ -0,0 +1,60 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/lrstanley/go-ytdlp"
|
||||
)
|
||||
|
||||
type DownloadOptions struct {
|
||||
EmbedThumbnail bool
|
||||
IncludeSubtitles bool
|
||||
VideoFormatID string
|
||||
AudioFormatID string
|
||||
}
|
||||
|
||||
type VideoOption struct {
|
||||
Height *int `json:"height,omitempty"`
|
||||
Resolution string `json:"resolution,omitempty"`
|
||||
FormatID string `json:"format_id"`
|
||||
Ext string `json:"ext"`
|
||||
TBR *float64 `json:"tbr,omitempty"`
|
||||
}
|
||||
|
||||
type AudioOption struct {
|
||||
Format string `json:"format"`
|
||||
FormatID string `json:"format_id"`
|
||||
Ext string `json:"ext"`
|
||||
TBR *float64 `json:"tbr,omitempty"`
|
||||
Language *string `json:"language,omitempty"`
|
||||
}
|
||||
|
||||
type FormatOptions struct {
|
||||
VideoOptions []VideoOption `json:"video_options"`
|
||||
AudioOptions []AudioOption `json:"audio_options"`
|
||||
}
|
||||
|
||||
type ProgressUpdate struct {
|
||||
Status ytdlp.ProgressStatus
|
||||
Percent string
|
||||
ETA time.Duration
|
||||
Filename string
|
||||
Phase string
|
||||
}
|
||||
|
||||
// InteractionState holds the state for a specific interaction
|
||||
type InteractionState struct {
|
||||
URL string
|
||||
FormatOptions *FormatOptions
|
||||
VideoFormatID string
|
||||
AudioFormatID string
|
||||
}
|
||||
|
||||
// DownloadResult represents the result of an async download operation
|
||||
type DownloadResult struct {
|
||||
Success bool
|
||||
Message string
|
||||
URL string
|
||||
Format string
|
||||
Error error
|
||||
}
|
||||
Reference in New Issue
Block a user