From a0847f19b9d3cf965aef59f316a229b1220ae22a Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Tue, 25 Dec 2018 19:32:49 +0530 Subject: [PATCH 1/3] 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": From 9170ff22a773b46dc438fa63c6c34c85e71f99b5 Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Tue, 25 Dec 2018 19:34:49 +0530 Subject: [PATCH 2/3] Surround filename in quotes --- spotdl/convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spotdl/convert.py b/spotdl/convert.py index c158d7e..8af876e 100644 --- a/spotdl/convert.py +++ b/spotdl/convert.py @@ -21,7 +21,7 @@ def song(input_song, output_song, folder, avconv=False, trim_silence=False): 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)) + log.info('Correcting container in "{}"'.format(input_song)) else: return 0 if avconv: From 018fb5d7f0b0525edd381ceb4c10c86e9189397e Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Tue, 25 Dec 2018 19:48:06 +0530 Subject: [PATCH 3/3] Update CHANGES.md --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index e340b4a..5c7eccb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Ability to pass multiple tracks with `-s` option ([@ritiek](https://github.com/ritiek)) (#442) ### Changed +- Correct `.m4a` container before writing metadata so metadata fields shows up properly in + media players (especially iTunes) ([@ritiek](https://github.com/ritiek) with thanks to [@Amit-L](https://github.com/Amit-L)!) (#453) - Refactored core downloading module ([@ritiek](https://github.com/ritiek)) (#410) ### Fixed