tamland / python-tidal

Python API for TIDAL music streaming service
GNU Lesser General Public License v3.0
406 stars 110 forks source link

Quality "HIGH" for HiRes-FLAC from August 2023? #172

Closed unwan878 closed 1 year ago

unwan878 commented 1 year ago

TIDAL has announced to change from MQA to HiRes-FLAC starting in August 2023. Would you please implement downloading HiRes-FLAC "HI_RES_LOSSLESS" files?

tehkillerbee commented 1 year ago

Yep, I am currently working on adding support for this.

tehkillerbee commented 1 year ago

It turns out very little was needed to add support for HI_RES. I have added a couple of helper functions to allow setting the quality manually, otherwise it will use HIGH per default.

import tidalapi

session = tidalapi.Session()
# Will run until you visit the printed url and link your account
session.login_oauth_simple()
# Override the required playback quality, if necessary
session.set_audio_quality(Quality.lossless)
# session.set_audio_quality(Quality.master)

album = session.album(66236918)
tracks = album.tracks()
for track in tracks:
    print(track.name)
    for artist in track.artists:
        print(' by: ', artist.name)