Skip to content

0.9.0

Latest

Choose a tag to compare

@dotX12 dotX12 released this 26 Oct 01:08
· 51 commits to master since this release
f94faaf

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.1 imports pydub, which needs audioop, removed from the standard library in 3.13. pydub, numpy, aiofiles and audioop-lts are no longer dependencies; recognition runs entirely on shazamio-core 2.0.0, which decodes audio itself, without ffmpeg.
  • 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_*_tracks methods read Shazam's CSV chart service and return list[ChartTrack] (rank, artist, title).
  • Text search is back, on a new route: search_tracks_via_itunes(query) resolves an iTunes search to Shazam tracks, and track_keys_from_apple_ids(ids) maps Apple Music ids to Shazam keys.
  • YouTube links are back. TrackInfo.youtube_link was always None since Shazam stopped sending the video section; it is now built from the track, and get_youtube_data(link) with Serialize.youtube() returns the video caption, thumbnail and uri.
  • One HTTP session per client. Use async with Shazam() as shazam: or call await shazam.close().
  • Clearer errors. A 429 raises RateLimited. A chart request answered with anything but 200 raises BadResponseStatus, and one answered with a website page instead of CSV raises BadContentType. These, SignatureError and the other exceptions are exported from shazamio.
  • track_about() and recognition fetch the iphone payload, which carries TrackInfo.providers and spotify_uri; shazam_url and 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