Skip to content

Commit

Permalink
copy file instead of creating a new one
Browse files Browse the repository at this point in the history
  • Loading branch information
LumePart committed Dec 1, 2024
1 parent a7e41bf commit e950877
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/youtube.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func getVideo(ctx context.Context, cfg Youtube, videoID string) (*goutubedl.Down
if err != nil {
return nil, fmt.Errorf("could not create URL for video download: %s", err.Error())
}

downloadResult, err := result.Download(ctx, "bestaudio")
if err != nil {
return nil, fmt.Errorf("could not download video: %s", err.Error())
Expand Down Expand Up @@ -106,7 +106,7 @@ func saveVideo(cfg Youtube, track Track, stream *goutubedl.DownloadResult) bool
return false // If the download fails (downloads a few bytes) then it will get triggered here: "tls: bad record MAC"
}

cmd := ffmpeg.Input(input).Output(fmt.Sprintf("%s%s.mp3", cfg.DownloadDir, track.File), ffmpeg.KwArgs{
cmd := ffmpeg.Input(input, ffmpeg.KwArgs{
"c": "copy",
"metadata": []string{"artist="+track.Artist,"title="+track.Title,"album="+track.Album},
"loglevel": "error",
Expand Down

0 comments on commit e950877

Please sign in to comment.