RandomNinjaAtk / docker-lidarr-extended

lidarr-extended :: Lidarr application packaged with multiple scripts to provide additional functionality
GNU General Public License v3.0
275 stars 24 forks source link

[Feat]: Support Tidal Masters #134

Closed Mavyre closed 1 year ago

Mavyre commented 1 year ago

Is your feature request related to a problem? Please describe. We can only select up to LOSSLESS (16bits/44.1kHz) quality with Tidal. Tidal-dl actually allows up to MASTER quality (which is MQA 24bits/44.1kHz)

Describe the solution you'd like Just add a "master" audioBitrate settings! 😄

Describe alternatives you've considered Downloading manually master quality content

Additional context Nonce

RandomNinjaAtk commented 1 year ago

What your asking for I don't think is possible, due to client limitations and difficulty to authenticate. PR welcome if you know how to make it work.

Mavyre commented 1 year ago

Honestly, I manage everyday to download with tidal-dl Master quality. I'm Using API Key number 4 (4 Android Auto-Normal/High/HiFi/Master) and AudioQuality set to AudioQuality.Master. The required subscription is the highest, though.

I don't really see the difficulty, and I'll try to make it work. But could you detail the issues encountered (or expected to encounter), so I can study and bypass them?

Edit:

Will try adding the following condition to Audio.sh. Keeping you update.

if [ "$audioBitrate" == "master" ]; then
            tidalQuality=Master
            deemixQuality=flac
RandomNinjaAtk commented 1 year ago

Just keep in mind, if you restart the docker, the scripts are overwritten. So either make a copy of the script and move its location to run manually. Or disable auto-run, edit and run manually for testing.

This is configured to use the "4" api key by default: https://github.com/RandomNinjaAtk/docker-lidarr-extended/blob/c7a66e26fd2ce4c8239e50f31a1517ee88a89952/root/scripts/tidal-dl.json#L1

Mavyre commented 1 year ago

I'll try that as a temporary experimentation. If that works, I'll create a PR for you!

RandomNinjaAtk commented 1 year ago

Still seems like master doesn't work... ? https://github.com/yaronzz/Tidal-Media-Downloader/issues/1016

So you should be sure to check that it actually works...

Mavyre commented 1 year ago

This issue is a non-issue. That's not how MQA (Master Quality Authenticated) works.

Taking this as an example: https://tidal.com/browse/track/221531214 The result of MediaInfo after tidal-dl download in Master Quality is:

Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Duration                                 : 4 min 11 s
Bit rate mode                            : Variable
Bit rate                                 : 1 732 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Bit depth                                : 24 bits
Compression mode                         : Lossless
Stream size                              : 52.0 MiB (100%)
Writing library                          : Mutagen 1.45.1

However, once MQA is decoded, here is the real Sampling rate:

  #     Encoding        Name
  1     MQA 192K        Ornette Coleman - Invisible.flac

So, on my end, that works. I'm trying to do the mod right now!

RandomNinjaAtk commented 1 year ago

Give 1.0.298 a try, see if that works, I've not personally tested it...

RandomNinjaAtk commented 1 year ago

I'm closing this because it's implemented, but not actually sure its working in practice. Either way, nothing I can do about it...

Mavyre commented 1 year ago

Hey @RandomNinjaAtk,

I tested by modifying the HiFi by Master, and it actually works! I have to check out that the regain step that you do doesn't break the MQA encoding with some releases. For now, it doesn't seem it did.

However, while downloading an album, it seems that sometimes the script selects other songs from oether releases that aren't available in MQA (a bit of Tidal's fault).