(self, api_key: str, proxy: str = None)
| 36 | ) |
| 37 | |
| 38 | def __init__(self, api_key: str, proxy: str = None) -> None: |
| 39 | self.API_KEY = api_key |
| 40 | self.proxy = proxy |
| 41 | self._validate_proxy() |
| 42 | self._headers = { |
| 43 | 'Authorization': self.API_KEY |
| 44 | } |
| 45 | self._connector = ProxyConnector.from_url(self.proxy, ttl_dns_cache=300) if self.proxy else aiohttp.TCPConnector( |
| 46 | resolver=aiohttp.resolver.AsyncResolver(), |
| 47 | limit_per_host=50 |
| 48 | ) |
| 49 | self._session = aiohttp.ClientSession(connector=self._connector, headers=self._headers) |
| 50 | |
| 51 | async def __aenter__(self): |
| 52 | return self |
nothing calls this directly
no test coverage detected