aioamazondevices 3.2.1__tar.gz → 3.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aioamazondevices-3.2.1 → aioamazondevices-3.2.2}/PKG-INFO +1 -1
- {aioamazondevices-3.2.1 → aioamazondevices-3.2.2}/pyproject.toml +1 -1
- {aioamazondevices-3.2.1 → aioamazondevices-3.2.2}/src/aioamazondevices/__init__.py +1 -1
- {aioamazondevices-3.2.1 → aioamazondevices-3.2.2}/src/aioamazondevices/api.py +4 -6
- {aioamazondevices-3.2.1 → aioamazondevices-3.2.2}/LICENSE +0 -0
- {aioamazondevices-3.2.1 → aioamazondevices-3.2.2}/README.md +0 -0
- {aioamazondevices-3.2.1 → aioamazondevices-3.2.2}/src/aioamazondevices/const.py +0 -0
- {aioamazondevices-3.2.1 → aioamazondevices-3.2.2}/src/aioamazondevices/exceptions.py +0 -0
- {aioamazondevices-3.2.1 → aioamazondevices-3.2.2}/src/aioamazondevices/py.typed +0 -0
- {aioamazondevices-3.2.1 → aioamazondevices-3.2.2}/src/aioamazondevices/sounds.py +0 -0
- {aioamazondevices-3.2.1 → aioamazondevices-3.2.2}/src/aioamazondevices/utils.py +0 -0
@@ -352,7 +352,7 @@ class AmazonEchoApi:
|
|
352
352
|
if not amazon_user_agent:
|
353
353
|
_LOGGER.debug("Changing User-Agent to %s", DEFAULT_AGENT)
|
354
354
|
headers.update({"User-Agent": DEFAULT_AGENT})
|
355
|
-
if self._csrf_cookie
|
355
|
+
if self._csrf_cookie:
|
356
356
|
csrf = {CSRF_COOKIE: self._csrf_cookie}
|
357
357
|
_LOGGER.debug("Adding <%s> to headers", csrf)
|
358
358
|
headers.update(csrf)
|
@@ -377,6 +377,9 @@ class AmazonEchoApi:
|
|
377
377
|
raise CannotConnect(f"Connection error during {method}") from exc
|
378
378
|
|
379
379
|
self._cookies.update(**await self._parse_cookies_from_headers(resp.headers))
|
380
|
+
if not self._csrf_cookie:
|
381
|
+
self._csrf_cookie = resp.cookies.get(CSRF_COOKIE, Morsel()).value
|
382
|
+
_LOGGER.debug("CSRF cookie value: <%s>", self._csrf_cookie)
|
380
383
|
|
381
384
|
content_type: str = resp.headers.get("Content-Type", "")
|
382
385
|
_LOGGER.debug(
|
@@ -786,11 +789,6 @@ class AmazonEchoApi:
|
|
786
789
|
_LOGGER.debug("Response code: |%s|", response_code)
|
787
790
|
|
788
791
|
response_data = await raw_resp.text()
|
789
|
-
|
790
|
-
if not self._csrf_cookie:
|
791
|
-
self._csrf_cookie = raw_resp.cookies.get(CSRF_COOKIE, Morsel()).value
|
792
|
-
_LOGGER.debug("CSRF cookie value: <%s>", self._csrf_cookie)
|
793
|
-
|
794
792
|
json_data = {} if len(response_data) == 0 else await raw_resp.json()
|
795
793
|
|
796
794
|
_LOGGER.debug("JSON data: |%s|", scrub_fields(json_data))
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|