mirror of
https://github.com/oskvr37/tiddl.git
synced 2026-06-13 04:05:08 +03:00
🐛 Fix metadata
This commit is contained in:
+1
-1
@@ -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"
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user