Repository navigation
This release installs and imports on Python 3.10 through 3.15, and rebuilds the library on the endpoints Shazam still serves. It removes every method whose Shazam service is gone, so it is a breaking release: read Removed before upgrading.
Highlights
- Python 3.13 and 3.14 work.
0.8.1importspydub, which needsaudioop, removed from the standard library in 3.13.pydub,numpy,aiofilesandaudioop-ltsare no longer dependencies; recognition runs entirely onshazamio-core2.0.0, which decodes audio itself, withoutffmpeg. recognize()finds more songs. It now sends a 12 second window, the length the Shazam apps send, instead of 10, and warns if you pass any other length. On 234 songs the right match went from 71 % to 94 %.recognize(..., max_skew=1e-3), opt in: turns an answer whose first match is skewed in time or frequency beyond the limit into a no match. It rejected 23 of 28 wrong answers and 15 of 611 right ones on the same 234 songs. Off by default, because it also rejects sped up, slowed down or pitch shifted audio.- Charts work again. The five
top_*_tracksmethods read Shazam's CSV chart service and returnlist[ChartTrack](rank, artist, title). - Text search is back, on a new route:
search_tracks_via_itunes(query)resolves an iTunes search to Shazam tracks, andtrack_keys_from_apple_ids(ids)maps Apple Music ids to Shazam keys. - YouTube links are back.
TrackInfo.youtube_linkwas alwaysNonesince Shazam stopped sending the video section; it is now built from the track, andget_youtube_data(link)withSerialize.youtube()returns the video caption, thumbnail anduri. - One HTTP session per client. Use
async with Shazam() as shazam:or callawait shazam.close(). - Clearer errors. A
429raisesRateLimited. A chart request answered with anything but200raisesBadResponseStatus, and one answered with a website page instead of CSV raisesBadContentType. These,SignatureErrorand the other exceptions are exported fromshazamio. track_about()and recognition fetch theiphonepayload, which carriesTrackInfo.providersandspotify_uri;shazam_urland the artist id are built correctly.
Removed
| Removed | Use instead |
|---|---|
recognize_song(), send_recognize_request() |
recognize() |
search_track() |
search_tracks_via_itunes() |
search_artist(), search_album(), artist_about(), artist_albums(), listening_counter(), listening_counter_many(), related_tracks() |
nothing: Shazam retired these services |
GeoService.get_country_playlist(), get_city_playlist() |
GeoService.country_url_name(), city_url_name() |
GeoService.get_genre(), get_top(), get_genre_from_country() |
nothing: the chart methods resolve slugs themselves |
TrackInfo.spotify_url |
TrackInfo.spotify_uri, TrackInfo.providers |
GenreMusic.REGIONAL_MEXICANO |
nothing: Shazam publishes no chart for it |
SampleRate, FrequencyBand, Converter, the deprecated package |
nothing: they belonged to the removed Python signature generator |
Chart methods return list[ChartTrack] rather than a dict, and limit now defaults to the whole chart.
Thanks
@Dysta, @BrightSun3125 and @iammcoding for their contributions.
Full Changelog: 0.8.1...0.9.0