downlad into temp folder then move to out folder when done, temp replace with my fork until upstream PR is merged
This commit is contained in:
@@ -91,13 +91,17 @@ func GetFormats(url string) (*FormatOptions, error) {
|
||||
return formatOpts, nil
|
||||
}
|
||||
|
||||
func DownloadVideo(out_dir, url string, opts DownloadOptions, progressChan chan<- ProgressUpdate) {
|
||||
func DownloadVideo(out_dir, temp_dir, url string, opts DownloadOptions, progressChan chan<- ProgressUpdate) {
|
||||
defer close(progressChan)
|
||||
|
||||
homePath := "home:" + out_dir
|
||||
tempPath := "temp:" + temp_dir
|
||||
|
||||
var lastPhase string
|
||||
|
||||
dl := ytdlp.New().
|
||||
SetWorkDir(out_dir).
|
||||
Paths(homePath).
|
||||
Paths(tempPath).
|
||||
RecodeVideo("mp4").
|
||||
ProgressFunc(100*time.Millisecond, func(prog ytdlp.ProgressUpdate) {
|
||||
// Detect phase transition -- differentiate "downloading" as the main download
|
||||
|
||||
Reference in New Issue
Block a user