Skip to content

Commit 7af0f83

Browse files
author
Robert Honz
committed
✨ Extended file extension detection to properly detect M4A files. Fixes #309
1 parent b17c8b2 commit 7af0f83

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tidalapi/media.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ def get_file_extension(stream_url: str, stream_codec: Optional[str] = None) -> s
620620
if AudioExtensions.FLAC in stream_url:
621621
# If the file extension within the URL is '*.flac', this is simply a FLAC file.
622622
result: str = AudioExtensions.FLAC
623-
elif AudioExtensions.MP4 in stream_url:
623+
elif AudioExtensions.MP4 in stream_url or AudioExtensions.M4A in stream_url or stream_codec == Codec.MP4A:
624624
# MPEG-4 is simply a container format for different audio / video encoded lines, like FLAC, AAC, M4A etc.
625625
# '*.m4a' is usually used as file extension, if the container contains only audio lines
626626
# See https://en.wikipedia.org/wiki/MP4_file_format

0 commit comments

Comments
 (0)