Skip to content

Commit

Permalink
🛠️ Workaround for wrong extension detection of tidalapi. Fixes #232
Browse files Browse the repository at this point in the history
  • Loading branch information
exislow committed Nov 14, 2024
1 parent d3dedc0 commit 9438244
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 9438244

Please sign in to comment.