Skip to content

Commit b654923

Browse files
committed
Release Screenshot API support in v0.2.0
1 parent 48914e1 commit b654923

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "search1api"
7-
version = "0.1.0"
7+
version = "0.2.0"
88
description = "Official Python client for Search1API"
99
readme = "README.md"
1010
license = { file = "LICENSE" }

‎src/search1api/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@
3535
"UnprocessableEntityError",
3636
]
3737

38-
__version__ = "0.1.0"
38+
__version__ = "0.2.0"

‎src/search1api/client.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ def _retry_after(response: httpx.Response) -> Optional[float]:
127127
return max(0.0, float(value))
128128
except ValueError:
129129
try:
130-
return max(0.0, parsedate_to_datetime(value).timestamp() - time.time())
130+
retry_at = float(parsedate_to_datetime(value).timestamp())
131+
return max(0.0, retry_at - time.time())
131132
except (TypeError, ValueError, OverflowError):
132133
return None
133134

@@ -178,7 +179,7 @@ def _request_headers(self, accept: str = "application/json") -> Dict[str, str]:
178179
return {
179180
"Accept": accept,
180181
"Authorization": f"Bearer {self.api_key}",
181-
"X-Search1API-Client": "python/0.1.0",
182+
"X-Search1API-Client": "python/0.2.0",
182183
**self.headers,
183184
}
184185

0 commit comments

Comments
 (0)