diff --git a/downloader/downloader.go b/downloader/downloader.go index 71f914426..9a44c55f2 100644 --- a/downloader/downloader.go +++ b/downloader/downloader.go @@ -630,8 +630,8 @@ func (downloader *Downloader) Download(data *types.Data) error { } fmt.Printf("Merging video parts into %s\n", mergedFilePath) - if stream.Ext == "mp4" { - return utils.MergeToMP4(parts, mergedFilePath, title) + if stream.Ext != "mp4" || data.Site == "YouTube youtube.com" { + return utils.MergeFilesWithSameExtension(parts, mergedFilePath) } - return utils.MergeFilesWithSameExtension(parts, mergedFilePath) + return utils.MergeToMP4(parts, mergedFilePath, title) } diff --git a/utils/ffmpeg.go b/utils/ffmpeg.go index 6d4fdfc2c..730d186e3 100644 --- a/utils/ffmpeg.go +++ b/utils/ffmpeg.go @@ -26,6 +26,7 @@ func runMergeCmd(cmd *exec.Cmd, paths []string, mergeFilePath string) error { } // MergeFilesWithSameExtension merges files that have the same extension into one. +// Can also handle merging audio and video. func MergeFilesWithSameExtension(paths []string, mergedFilePath string) error { cmds := []string{ "-y",