Skip to content

Commit

Permalink
✨ Extended file extension detection to properly detect M4A files. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
exislow committed Dec 16, 2024
1 parent b17c8b2 commit 7af0f83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tidalapi/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ def get_file_extension(stream_url: str, stream_codec: Optional[str] = None) -> s
if AudioExtensions.FLAC in stream_url:
# If the file extension within the URL is '*.flac', this is simply a FLAC file.
result: str = AudioExtensions.FLAC
elif AudioExtensions.MP4 in stream_url:
elif AudioExtensions.MP4 in stream_url or AudioExtensions.M4A in stream_url or stream_codec == Codec.MP4A:
# MPEG-4 is simply a container format for different audio / video encoded lines, like FLAC, AAC, M4A etc.
# '*.m4a' is usually used as file extension, if the container contains only audio lines
# See https://en.wikipedia.org/wiki/MP4_file_format
Expand Down

0 comments on commit 7af0f83

Please sign in to comment.