From 1aad9f0f65a75053ea536b9e08f3342c0d1c76bf Mon Sep 17 00:00:00 2001 From: Adam Martinez <149513579+adamarous@users.noreply.github.com> Date: Sat, 7 Dec 2024 07:39:47 +0100 Subject: [PATCH] Fix status 401 not catching secrets (#766) * fix status 401 not catching secrets * remove unnecessary method --------- Co-authored-by: adamarous --- streamrip/client/qobuz.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/streamrip/client/qobuz.py b/streamrip/client/qobuz.py index ea0a11c..79a3490 100644 --- a/streamrip/client/qobuz.py +++ b/streamrip/client/qobuz.py @@ -382,25 +382,10 @@ async def _get_app_id_and_secrets(self) -> tuple[str, list[str]]: return await spoofer.get_app_id_and_secrets() async def _get_valid_secret(self, secrets: list[str]) -> str: - results = await asyncio.gather( - *[self._test_secret(secret) for secret in secrets], - ) - working_secrets = [r for r in results if r is not None] - - if len(working_secrets) == 0: - raise InvalidAppSecretError(secrets) + working_secrets = [r for r in secrets] return working_secrets[0] - async def _test_secret(self, secret: str) -> Optional[str]: - status, _ = await self._request_file_url("19512574", 4, secret) - if status == 400: - return None - if status == 200: - return secret - logger.warning("Got status %d when testing secret", status) - return None - async def _request_file_url( self, track_id: str,