Skip to content

Commit

Permalink
Merge pull request #96 from shazamio/dev-sq
Browse files Browse the repository at this point in the history
Fix retry login
  • Loading branch information
dotX12 committed Feb 25, 2024
2 parents 2c1cc7e + 89f9375 commit f088e77
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
7 changes: 7 additions & 0 deletions examples/recognize_song.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion shazamio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
4 changes: 3 additions & 1 deletion shazamio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit f088e77

Please sign in to comment.