diff --git a/examples/recognize_song.py b/examples/recognize_song.py index 2604fec..ef37d21 100644 --- a/examples/recognize_song.py +++ b/examples/recognize_song.py @@ -12,6 +12,13 @@ async def main(): + # shazam = Shazam( + # http_client=HTTPClient( + # retry_options=ExponentialRetry(attempts=12, max_timeout=204.8, statuses={500, 502, 503, 504, 429}), + # ), + # ) + # if u need override retry option... + shazam = Shazam() # pass path (deprecated) diff --git a/pyproject.toml b/pyproject.toml index b9dbcd5..1fbb22f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "shazamio" -version = "0.5.0" +version = "0.5.1" description = "Is a asynchronous framework from reverse engineered Shazam API written in Python 3.8+ with asyncio and aiohttp." authors = ["dotX12"] license = "MIT License" diff --git a/setup.py b/setup.py index 45a0a83..25b278f 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="shazamio", - version="0.5.0", + version="0.5.1", author="dotX12", description="Is a FREE asynchronous library from reverse engineered Shazam API written in Python 3.6+ with asyncio and aiohttp. Includes all the methods that Shazam has, including searching for a song by file.", long_description=long_description, diff --git a/shazamio/__init__.py b/shazamio/__init__.py index f04f8e2..ec9198c 100644 --- a/shazamio/__init__.py +++ b/shazamio/__init__.py @@ -2,5 +2,6 @@ from .api import Shazam from .converter import GeoService from .enums import GenreMusic +from .client import HTTPClient -__all__ = ("Serialize", "Shazam", "GeoService", "GenreMusic") +__all__ = ("Serialize", "Shazam", "GeoService", "GenreMusic", "HTTPClient") diff --git a/shazamio/api.py b/shazamio/api.py index 82dfc05..d31b811 100644 --- a/shazamio/api.py +++ b/shazamio/api.py @@ -39,7 +39,9 @@ def __init__( self.endpoint_country = endpoint_country self.http_client = http_client or HTTPClient( - retry_options=ExponentialRetry(attempts=20, statuses={500, 502, 503, 504, 429}), + retry_options=ExponentialRetry( + attempts=20, max_timeout=60, statuses={500, 502, 503, 504, 429} + ), ) self.geo_service = GeoService(self.http_client)