ShazamIO icon indicating copy to clipboard operation
ShazamIO copied to clipboard

Hang on very small recognition request

Open Dronablo opened this issue 2 years ago • 3 comments

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?

Dronablo avatar Aug 01 '22 10:08 Dronablo

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.

dotX12 avatar Aug 02 '22 23:08 dotX12

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?

Dronablo avatar Aug 07 '22 20:08 Dronablo

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

dotX12 avatar Aug 10 '22 23:08 dotX12

Fixed in #31.

Dronablo avatar Aug 30 '22 07:08 Dronablo