Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to use shazamio for big lists (e.g. >500)? #120

Open
asapsmc opened this issue Aug 19, 2024 · 2 comments
Open

Question: How to use shazamio for big lists (e.g. >500)? #120

asapsmc opened this issue Aug 19, 2024 · 2 comments

Comments

@asapsmc
Copy link

asapsmc commented Aug 19, 2024

Is there any recommended approach for when we need to retrieve a big list of shazams? I'm working with a list of more than 500 files, and I'm using the same code as in one of your examples:

Shazam(
        http_client=HTTPClient(
            retry_options=ExponentialRetry(
                attempts=12, max_timeout=204.8, statuses={500, 502, 503, 504, 429}
            ),
        ),

I've also implemented a sort of manual shazam_cache, to avoid repeating the same audio Shazam.
However, I get many errors. Firstly, I start getting '429' errors, but in reattempts, I start getting mostly "Failed to decode json" errors.
Eventually, after many reruns, I am able to identify most audios, but this is far from a good approach.
Could anyone recommend an approach to handle these errors more effectively, especially when dealing with large lists? Any tips on optimizing the retry logic or managing rate limits would be greatly appreciated.

Thanks in advance for your help!

@wttdotm
Copy link

wttdotm commented Oct 14, 2024

yo @asapsmc did you figure this out? i have a backlog of several hundreds of gigs of songs I need to identify lol

@asapsmc
Copy link
Author

asapsmc commented Oct 14, 2024

No, I couldn't figure any smart way to solve this. If you do, please share it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants