Skip to content

Playlist track parsing crashes, if a track is unavailable. #383

@exislow

Description

@exislow

We might found a bug / new behavior of TIDAL, which is reported here: exislow/tidal-dl-ng#662

There is a public playlist, which apparently has a track, which is unavailable inside. If I get the metadata of the playlist, all is still good. But as soon as I request the tracks of the playlist, one track is returned as:

 /home/vnm_rzv/.local/lib/python3.14/site-packages/tidalapi/media.py:307 in parse_track                                                   │
│                                                                                                                                          │
│   304 │   │   self.audio_quality = json_obj["audioQuality"]                                                                              │
│   305 │   │   self.audio_modes = json_obj["audioModes"]                                                                                  │
│   306 │   │   self.version = json_obj["version"]                                                                                         │
│ ❱ 307 │   │   self.media_metadata_tags = json_obj["mediaMetadata"]["tags"]                                                               │
│   308 │   │                                                                                                                              │
│   309 │   │   if self.version is not None:                                                                                               │
│   310 │   │   │   self.full_name = f"{json_obj['title']} ({json_obj['version']})"                                                        │
│                                                                                                                                          │
│ ╭────────────────────────── locals ──────────────────────────╮                                                                           │
│ │    album = None                                            │                                                                           │
│ │ json_obj = {                                               │                                                                           │
│ │            │   'id': 49270039,                             │                                                                           │
│ │            │   'title': 'Unavailable',                     │                                                                           │
│ │            │   'duration': 0,                              │                                                                           │
│ │            │   'replayGain': 0.0,                          │                                                                           │
│ │            │   'peak': 0.0,                                │                                                                           │
│ │            │   'allowStreaming': False,                    │                                                                           │
│ │            │   'streamReady': False,                       │                                                                           │
│ │            │   'payToStream': False,                       │                                                                           │
│ │            │   'adSupportedStreamReady': False,            │                                                                           │
│ │            │   'djReady': False,                           │                                                                           │
│ │            │   ... +29                                     │                                                                           │
│ │            }                                               │                                                                           │
│ │     self = <tidalapi.media.Track object at 0x7fc86b74c550> │                                                                           │
│ ╰────────────────────────────────────────────────────────────╯                                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: 'NoneType' object is not subscriptable

Apparently mediaMetadata is missing and the this library crashes. Shall this be handled accordingly or is this misbehavior of TIDAL?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions