From 7af0f83f949a6f84e3f46c6e954b765bdb90593d Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Mon, 16 Dec 2024 16:06:36 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Extended=20file=20extension=20detec?= =?UTF-8?q?tion=20to=20properly=20detect=20M4A=20files.=20Fixes=20tamland/?= =?UTF-8?q?python-tidal#309?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tidalapi/media.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidalapi/media.py b/tidalapi/media.py index 4b9ceda..9224e57 100644 --- a/tidalapi/media.py +++ b/tidalapi/media.py @@ -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