pip3 install ShazamAPI
Also you need to install ffmpeg and ffprobe then add it to path
fromShazamAPIimportShazamwithopen('filename.mp3', 'rb') asfp:
mp3_file_content_to_recognize=fp.read()
recognize_generator=Shazam().recognize_song(mp3_file_content_to_recognize)
# or just:# recognize_generator = Shazam().recognize_song('filename.mp3')for (offset, resp) inrecognize_generator:
print(offset, resp)