Skip to content

Validate returned tracks and skip invalid results #342

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

Merged
merged 1 commit into from
Jul 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tidalapi/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,13 @@ def get_tracks_by_isrc(self, isrc: str) -> list[media.Track]:
base_url=self.config.openapi_v2_location,
).json()
if res["data"]:
return [self.track(tr["id"]) for tr in res["data"]]
tracks = []
for tr in res["data"]:
try:
tracks.append(self.track(tr["id"]))
except ObjectNotFound:
continue
return tracks
else:
log.warning("No matching tracks found for ISRC '%s'", isrc)
raise ObjectNotFound
Expand Down