shazamio / ShazamIO

🎵 Is a free asynchronous library from reverse engineered Shazam API written in Python 3.8+ with asyncio and aiohttp.
MIT License
519 stars 76 forks source link

recognize_song function is blocking #7

Closed syricium closed 3 years ago

syricium commented 3 years ago

I've been using the recognize_song function for a while now, but only just found out, that it is blocking. Am I doing something wrong or is it not my fault?

dotX12 commented 3 years ago

yes, the part of the code responsible for creating the signature and the algorithm is blocking the code, too many actions are going on in the function. I'll sit down next week to rewrite the algorithm. :(

dotX12 commented 3 years ago

Alternatively, you can run the task in run_in_executor.

syricium commented 3 years ago

I did, but that didn't help, but that could actually somehow be my fault, as my run in executor seems to never be working

dotX12 commented 3 years ago

I will try to release the update as soon as possible if I can achieve a higher speed. But I'm afraid that it will be difficult to implement, since the process of creating the algorithm and signature is too long. Perhaps I will rewrite this for RUST.

dotX12 commented 9 months ago

@syricium, Better late than never, but it happened thanks to pyo3 and RUST. https://github.com/dotX12/shazamio-core

Fixed in 0.5.0. See comment: https://github.com/shazamio/ShazamIO/issues/76#issuecomment-1961610344