shazamio / ShazamIO

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

Question: How can I get the title and the artist name? #38

Closed Lolimipsu closed 2 years ago

Lolimipsu commented 2 years ago

Hi, I would like to ask how can I get the name and artist name only?

image

I'm trying to get only the title and subtitle but I don't know how can I get them from the raw format, is there a way to get it? thank you in advance. image

dotX12 commented 2 years ago

@Lolimipsu, hello!

    out = await shazam.recognize_song("data/dora.ogg")
    print(out)

    serialized = Serialize.full_track(out)
    print(serialized.track.title)
    print(serialized.track.subtitle)
dotX12 commented 2 years ago

or

out["track"]["title"]
out["track"]["subtitle"]
Lolimipsu commented 2 years ago

ohh so this is how I should do it, thank you @dotX12 !