🐛 Fix metadata

This commit is contained in:
Oskar Dudziński
2025-10-17 09:53:52 +02:00
parent 146dd6ae77
commit f767f5ca41
3 changed files with 20 additions and 22 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "tiddl"
version = "2.6.3"
version = "2.6.4"
description = "Download Tidal tracks with CLI downloader."
readme = "README.md"
requires-python = ">=3.11"
+11 -11
View File
@@ -236,6 +236,17 @@ def DownloadCommand(
else:
lyrics_subtitles = ""
if track_stream.audioQuality in ["HI_RES_LOSSLESS"]:
path = asyncio.run(
convertFileExtension(
source_file=path,
extension=".flac",
remove_source=True,
is_video=False,
copy_audio=True, # extract flac from m4a container
)
)
try:
addMetadata(
path,
@@ -248,17 +259,6 @@ def DownloadCommand(
except Exception as e:
logging.error(f"Can not add metadata to: {path}, {e}")
if track_stream.audioQuality in ["HI_RES_LOSSLESS", "LOSSLESS"]:
path = asyncio.run(
convertFileExtension(
source_file=path,
extension=".flac",
remove_source=True,
is_video=False,
copy_audio=True, # extract flac from m4a container
)
)
elif isinstance(item, Video):
path = asyncio.run(
convertFileExtension(
+8 -10
View File
@@ -73,16 +73,14 @@ def parseTrackStream(track_stream: TrackStream) -> tuple[list[str], str]:
case "application/dash+xml":
urls, codecs = parseManifestXML(decoded_manifest)
# if codecs == "flac":
# file_extension = ".flac"
# if track_stream.audioQuality == "HI_RES_LOSSLESS":
# file_extension = ".m4a"
# elif codecs.startswith("mp4"):
# file_extension = ".m4a"
# else:
# raise ValueError(f"Unknown codecs `{codecs}` (trackId {track_stream.trackId}")
file_extension = ".m4a"
if codecs == "flac":
file_extension = ".flac"
if track_stream.audioQuality == "HI_RES_LOSSLESS":
file_extension = ".m4a"
elif codecs.startswith("mp4"):
file_extension = ".m4a"
else:
raise ValueError(f"Unknown codecs `{codecs}` (trackId {track_stream.trackId}")
return urls, file_extension