Skip to content

Commit

Permalink
Merge pull request #233 from exislow/232-bug-problems-with-metadata-o…
Browse files Browse the repository at this point in the history
…f-high-quality-flac-files-downloaded-from-tidal-via-the-downloader

🛠️ Workaround for wrong extension detection of `tidalapi`. Fixes #232
  • Loading branch information
exislow authored Nov 14, 2024
2 parents d3dedc0 + 9438244 commit 16dc6e9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tidal_dl_ng/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,16 @@ def item(

return False, ""

file_extension = media_stream.get_stream_manifest().file_extension
# Use M4A extension for MP4 audio tracks, because it looks better and is completely interchangeable.
file_extension = AudioExtensions.M4A if file_extension == AudioExtensions.MP4 else file_extension
# TODO: HOTFIX! Go back to
# file_extension = media_stream.get_stream_manifest().file_extension
# After tidalapi has fixed #304
stream_manifest: StreamManifest = media_stream.get_stream_manifest()
if stream_manifest.file_extension is VideoExtensions.TS:
file_extension = stream_manifest.file_extension
elif AudioExtensions.FLAC in stream_manifest.dash_info.first_url:
file_extension = AudioExtensions.FLAC
else:
file_extension = AudioExtensions.M4A

if self.settings.data.extract_flac and (
media_stream.get_stream_manifest().codecs.upper() == Codec.FLAC
Expand Down

0 comments on commit 16dc6e9

Please sign in to comment.