'TIDAL API documention - how to get track IDs

I'm using the TIDAL API to retrieve information on what tracks are on what playlists. To log in to the API I'm using the below code:

session = tidalapi.Session()
session.login_oauth_simple()

From that, I have been able to get track names and IDs from playlists with

playlists = session.get_playlist_tracks('b2c94789-14d4-4a55-b6ee-33a96b952900')
for track in playlists:
   print(track.id)

What I would like to do is match that list with a different list of tracks to see if those tracks are on this playlist. I'm struggling there, as I'm not sure how to get to an ISRC from the TIDAL track ID or the other way around. I've tried the following:

playlists = session.get_playlist_tracks('b2c94789-14d4-4a55-b6ee-33a96b952900')
for track in playlists:
   trackid = track.id
   tracks = session.get_track(trackid)
   print(tracks.isrc)

But there doesn't seem to be an ISRC under the track object. Unfortunately, the documentation I have found doesn't really clarify much (link here).

I have found this documentation as well but it doesn't seem to be accurate as I can't seem to be able to use those functions.

So my question for anyone with more experience with the TIDAL API - what am I doing wrong here? How can I either get an ISRC for a track ID or get the track ID based on an ISRC?

Thanks in advance!



Solution 1:[1]

this is a possibility in the 0.7 rewrite of the API. the article you read is part of the nodejs version it seems. rewrite docs: https://0-7-x--tidalapi.netlify.app/ to install you will need to download the zip code from the 0.7 rewrite branch on github and install in the cli with pip

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Agastya Sandhuja