@@ -75,7 +75,7 @@ func (c *Youtube) QueryTrack(track *models.Track) error { // Queries youtube for
7575func (c * Youtube ) GetTrack (track * models.Track ) error {
7676 ctx := context .Background () // ctx for yt-dlp
7777
78- track .File = getFilename (track .Title , track .Artist )
78+ track .File = getFilename (track .Title , track .Artist )+ ".opus"
7979 track .Present = fetchAndSaveVideo (ctx , * c , * track )
8080
8181 if track .Present {
@@ -128,7 +128,7 @@ func saveVideo(c Youtube, track models.Track, stream *goutubedl.DownloadResult)
128128 }
129129 }()
130130
131- input := fmt .Sprintf ("%s%s_TEMP.mp3 " , c .DownloadDir , track .File )
131+ input := fmt .Sprintf ("%s%s.tmp " , c .DownloadDir , track .File )
132132 file , err := os .Create (input )
133133 if err != nil {
134134 log .Fatalf ("failed to create song file: %s" , err .Error ())
@@ -148,7 +148,7 @@ func saveVideo(c Youtube, track models.Track, stream *goutubedl.DownloadResult)
148148 return false
149149 }
150150
151- cmd := ffmpeg .Input (input ).Output (fmt .Sprintf ("%s%s.mp3 " , c .DownloadDir , track .File ), ffmpeg.KwArgs {
151+ cmd := ffmpeg .Input (input ).Output (fmt .Sprintf ("%s%s" , c .DownloadDir , track .File ), ffmpeg.KwArgs {
152152 "map" : "0:a" ,
153153 "metadata" : []string {"artist=" + track .Artist , "title=" + track .Title , "album=" + track .Album },
154154 "loglevel" : "error" ,
0 commit comments