diff --git a/pyproject.toml b/pyproject.toml index 6147e5d..2574555 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "tiddl" -version = "3.4.0a4" +version = "3.4.0a5" description = "Download Tidal tracks with CLI downloader." readme = "README.md" requires-python = ">=3.13" diff --git a/tiddl/cli/commands/download/downloader.py b/tiddl/cli/commands/download/downloader.py index 60dbc51..1357ce8 100644 --- a/tiddl/cli/commands/download/downloader.py +++ b/tiddl/cli/commands/download/downloader.py @@ -159,6 +159,8 @@ class Downloader: if stream.audioQuality in ["HI_RES_LOSSLESS", "LOSSLESS"]: quality = f"{quality} {stream.bitDepth}-bit, {(stream.sampleRate or 0) / 1000:.1f} kHz" should_extract_flac = True + else: + download_path = download_path.with_suffix(".m4a") elif isinstance(item, Video): stream = self.api.get_video_stream( diff --git a/tiddl/core/api/models/base.py b/tiddl/core/api/models/base.py index d2c93e1..e03e96e 100644 --- a/tiddl/core/api/models/base.py +++ b/tiddl/core/api/models/base.py @@ -124,7 +124,7 @@ class Favorites(BaseModel): class TrackStream(BaseModel): trackId: int assetPresentation: Literal["FULL"] - audioMode: Literal["STEREO"] + audioMode: Literal["STEREO", "DOLBY_ATMOS"] audioQuality: TrackQuality manifestMimeType: Literal["application/dash+xml", "application/vnd.tidal.bts"] manifestHash: str diff --git a/tiddl/core/utils/parse.py b/tiddl/core/utils/parse.py index 78c72d8..5575b9a 100644 --- a/tiddl/core/utils/parse.py +++ b/tiddl/core/utils/parse.py @@ -80,7 +80,7 @@ def parse_track_stream(track_stream: TrackStream) -> tuple[list[str], str]: file_extension = ".flac" if track_stream.audioQuality == "HI_RES_LOSSLESS": file_extension = ".m4a" - elif codecs.startswith("mp4"): + elif codecs.startswith("mp4") or codecs == "eac3": file_extension = ".m4a" else: raise ValueError(f"Unknown codecs `{codecs}` (trackId {track_stream.trackId}")