Skip to content

Commit

Permalink
Fix json_data empty check
Browse files Browse the repository at this point in the history
  • Loading branch information
pxia committed Jul 15, 2024
1 parent 4cb8f2d commit edfd2a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pikpakapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ async def _make_request(
continue

json_data = response.json()
if "error" not in json_data:
if json_data and "error" not in json_data:
# ok
return json_data

if len(json_data) == 0:
if not json_data:
error_decription = "empty json data"
await asyncio.sleep(backoff_seconds)
backoff_seconds *= 2 # exponential backoff
Expand Down

0 comments on commit edfd2a2

Please sign in to comment.