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

Hang on very small recognition request #27

Closed Dronablo closed 2 years ago

Dronablo commented 2 years ago

Hi!

If we would try to call Shazam.recognize_song with input less than 128 audio samples it will hang forever: https://github.com/dotX12/ShazamIO/blob/7ec7a3dd0b0731f57118dd218704a73e43be2614/shazamio/api.py#L270-L271

https://github.com/dotX12/ShazamIO/blob/7ec7a3dd0b0731f57118dd218704a73e43be2614/shazamio/algorithm.py#L94-L96

Maybe introducing something like MIN_AUDIO_SECONDS will help?

dotX12 commented 2 years ago

Hi!

If we would try to call Shazam.recognize_song with input less than 128 audio samples it will hang forever:

https://github.com/dotX12/ShazamIO/blob/7ec7a3dd0b0731f57118dd218704a73e43be2614/shazamio/api.py#L270-L271

https://github.com/dotX12/ShazamIO/blob/7ec7a3dd0b0731f57118dd218704a73e43be2614/shazamio/algorithm.py#L94-L96

Maybe introducing something like MIN_AUDIO_SECONDS will help?

Greetings, I'm currently on vacation and would be grateful if you could do a PR.

Dronablo commented 2 years ago

Well, it says 403 when I try to make push of my branch with fix. Am I do something wrong or some additional permissions needed?

dotX12 commented 2 years ago

@Dronablo Fork the repository and push commits to your repository. Then you can open a pull request

Dronablo commented 2 years ago

Fixed in #31.