-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detecting and replacing unavailable tracks #285
Comments
Sorry, just tested it and there is indeed the boolean |
@dennisklad Also, albums, tracks etc that are not available will throw an exception when fetched directly: from pathlib import Path
import tidalapi
from tidalapi import exceptions
session_file1 = Path("tidal-session-oauth.json")
session = tidalapi.Session()
# Load session from file; create a new OAuth session if necessary
session.login_session_file(session_file1)
tracks = ["381616195", "5587976"] # Track #2 is not available
# Check if tGet user tracks and check if track is available
for track_id in tracks:
try:
track = session.track(track_id=track_id)
except exceptions.ObjectNotFound:
print(f"Track {track_id} not available") |
Perfect! Also, I noticed that it is not possible to directly add the track again to the favorites as it has a new ID and it throws a 404. From this convo I see that it is also not possible with the isrc, right? EDIT: Oh, it says that this was feature was added in the v0.7.7! How would one use this? |
For anyone that is interested this is my code:
|
Hi, thanks so much for this API!!
I had a question: Is there a way to detect the unavailable tracks? This has been annoying me and wanted to check if there is a way to replace them with the API.
Thanks in advance.
The text was updated successfully, but these errors were encountered: