Skip to content

Commit

Permalink
Fix .m4a containers
Browse files Browse the repository at this point in the history
  • Loading branch information
ritiek committed Dec 25, 2018
1 parent 9652eca commit 741c3ed
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions spotdl/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@

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:
Expand Down Expand Up @@ -74,6 +77,8 @@ def with_ffmpeg(self):
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":
Expand Down

0 comments on commit 741c3ed

Please sign in to comment.