shazamio / ShazamIO

🎵 Is a free asynchronous library from reverse engineered Shazam API written in Python 3.8+ with asyncio and aiohttp.
MIT License
519 stars 75 forks source link

Error Question (Serialize) #123

Open EvaBruh opened 1 month ago

EvaBruh commented 1 month ago

Hi. Everything was working, but at some point on queries on variations of TOPs where i use Serialize.playlist or playlists, started to cause a serialization error, what could be the issue?

# print check 1 not printing

top_w = top_world_genres(self.shazam, genre)
        for track in top_w['data']:
            try:
                serialize_w = Serialize.playlist(data=track)
                print(f'check 1  {serialize_w}')
                have = self.check_track(serialize_w.attributes.artist_name, serialize_w.attributes.name, chart)
                track_info = {
                    "artist": serialize_w.attributes.artist_name,
                    "tname": serialize_w.attributes.name,
                    "have_track": have
                }
                top_list.append(track_info)

            except Exception as e:
                print(str(e), 'error Shazam')
                continue

and error _for each track in topw in Exception print: 1 validation error for PlayList attributes -> hasCredits field required (type=value_error.missing)