From a0847f19b9d3cf965aef59f316a229b1220ae22a Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Tue, 25 Dec 2018 19:32:49 +0530 Subject: [PATCH] Fix .m4a containers --- spotdl/convert.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/spotdl/convert.py b/spotdl/convert.py index c898e81..c158d7e 100644 --- a/spotdl/convert.py +++ b/spotdl/convert.py @@ -17,10 +17,13 @@ https://trac.ffmpeg.org/wiki/Encode/AAC def song(input_song, output_song, folder, avconv=False, trim_silence=False): """ Do the audio format conversion. """ - if input_song == output_song: - return 0 convert = Converter(input_song, output_song, folder, trim_silence) - log.info("Converting {0} to {1}".format(input_song, output_song.split(".")[-1])) + if not input_song == output_song: + log.info("Converting {0} to {1}".format(input_song, output_song.split(".")[-1])) + elif input_song.endswith(".m4a"): + log.info("Correcting container in {}".format(input_song)) + else: + return 0 if avconv: exit_code = convert.with_avconv() else: @@ -74,6 +77,8 @@ class Converter: ffmpeg_params = "-codec:v copy -codec:a libmp3lame -ar 44100 " elif output_ext == ".webm": ffmpeg_params = "-codec:a libopus -vbr on " + elif output_ext == ".m4a": + ffmpeg_params = "-vn -acodec copy " elif input_ext == ".webm": if output_ext == ".mp3":