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

Added Proxy option #88

Closed
wants to merge 2 commits into from
Closed

Conversation

Lautarotetamusa
Copy link

Related to this issue: #65

I recently started experiencing issues using the library in a project because I consistently reached the Shazam API call limit. That's why I decided to implement the option to use proxies.

I added the 'proxy' parameter to the Shazam class; hence, all requests will use this proxy. I believe that if someone wants to use proxies, they would prefer using the same proxy for all requests. If you think the proxy should be in the 'recognize_song' call, let me know, and I can make the change.

class Shazam(Converter, Geo, Request):
    """Is asynchronous framework for reverse engineered Shazam API written in Python 3.7 with
    asyncio and aiohttp."""

    def __init__(self, language: str = "en-US", endpoint_country: str = "GB", proxy: str = ""):
        super().__init__(language=language)
        self.language = language
        self.endpoint_country = endpoint_country
        self.proxy = proxy

@dotX12
Copy link
Collaborator

dotX12 commented Feb 18, 2024

@Lautarotetamusa hello!
Thanks for your input, but the HTTPClient has been greatly changed, the proxyhas been added here and will soon fall into main branch.
#91

@dotX12
Copy link
Collaborator

dotX12 commented Feb 18, 2024

I also don’t see the point of a permanent proxy, when a person needs it, he will pass it to the required method, otherwise he will have to recreate the Shazamio object / remove self.proxy value / set self.proxy value, etc..

@dotX12 dotX12 closed this Feb 18, 2024
@asapsmc
Copy link

asapsmc commented Sep 1, 2024

Could anyone give an example of how to use a proxy? I'm getting too many 429 errors.

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

Successfully merging this pull request may close these issues.

3 participants