Skip to content
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

Serializer is not working #118

Open
IftixorInTouch opened this issue Jul 3, 2024 · 1 comment
Open

Serializer is not working #118

IftixorInTouch opened this issue Jul 3, 2024 · 1 comment

Comments

@IftixorInTouch
Copy link

async def main():
shazam = Shazam()
top_five_track_from_amsterdam = await shazam.top_country_tracks('NL', 5)
for track in top_five_track_from_amsterdam['tracks']:
serialized = Serialize.track(data=track)
print(serialized.title)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Error:

for track in top_five_track_from_amsterdam['tracks']:
KeyError: 'tracks'

@dotX12
Copy link
Collaborator

dotX12 commented Jul 4, 2024

async def main(): shazam = Shazam() top_five_track_from_amsterdam = await shazam.top_country_tracks('NL', 5) for track in top_five_track_from_amsterdam['tracks']: serialized = Serialize.track(data=track) print(serialized.title) loop = asyncio.get_event_loop() loop.run_until_complete(main())

Error:

for track in top_five_track_from_amsterdam['tracks']: KeyError: 'tracks'

Hello!

import asyncio
from shazamio import Shazam, Serialize


async def main():
    shazam = Shazam()
    top_five_track_from_amsterdam = await shazam.top_country_tracks("NL", 100)
    tracks = Serialize.playlists(top_five_track_from_amsterdam)
    print(tracks)

    for track in top_five_track_from_amsterdam["data"]:
        serialized = Serialize.playlist(data=track)
        print(serialized)


loop = asyncio.get_event_loop_policy().get_event_loop()
loop.run_until_complete(main())

There are problems in the readme documentation, there is simply not enough time to update it. See the examples file, the code is always up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants