EbbLabs/python-tidal

File extension determination is wrong

Closed this issue · 1 comments

I did some research and found out that this behavior is wrong:
https://github.com/tamland/python-tidal/blob/1720a0bcb7b2ec1d935ca11b366eba1d1655d459/tidalapi/media.py#L619-L637

We need to separate the used codec and the file extension. Since, if a file is returned as MP4 it still can have a FLAC encoded audio channel, but the container is indeed an MP4 container.

What happens here is, if stream has ".mp4" in it's file name, the lines above try to check the used codec and wrongly adapt the file extension. To overcome this problem problem I propose solely rely on the extension within the URL. I have a problem which is related to this exislow/tidal-dl-ng#232

A lot of debugging led me to this conclusion. I will propose a solution with a PR.

Here you go: #305