Skip to content

Commit

Permalink
downloader: fix youtube video merge issue
Browse files Browse the repository at this point in the history
  • Loading branch information
iawia002 committed May 15, 2020
1 parent 5a7836a commit 5531a1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
1 change: 1 addition & 0 deletions utils/ffmpeg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 5531a1c

Please sign in to comment.