aioamazondevices 6.4.4__py3-none-any.whl → 6.4.5__py3-none-any.whl
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/__init__.py +1 -1
- aioamazondevices/api.py +5 -1
- aioamazondevices/const.py +7 -6
- {aioamazondevices-6.4.4.dist-info → aioamazondevices-6.4.5.dist-info}/METADATA +1 -1
- aioamazondevices-6.4.5.dist-info/RECORD +12 -0
- aioamazondevices-6.4.4.dist-info/RECORD +0 -12
- {aioamazondevices-6.4.4.dist-info → aioamazondevices-6.4.5.dist-info}/WHEEL +0 -0
- {aioamazondevices-6.4.4.dist-info → aioamazondevices-6.4.5.dist-info}/licenses/LICENSE +0 -0
aioamazondevices/__init__.py
CHANGED
aioamazondevices/api.py
CHANGED
|
@@ -50,6 +50,7 @@ from .const import (
|
|
|
50
50
|
JSON_EXTENSION,
|
|
51
51
|
REFRESH_ACCESS_TOKEN,
|
|
52
52
|
REFRESH_AUTH_COOKIES,
|
|
53
|
+
REQUEST_AGENT,
|
|
53
54
|
SAVE_PATH,
|
|
54
55
|
SENSORS,
|
|
55
56
|
URI_DEVICES,
|
|
@@ -347,6 +348,7 @@ class AmazonEchoApi:
|
|
|
347
348
|
url: str,
|
|
348
349
|
input_data: dict[str, Any] | list[dict[str, Any]] | None = None,
|
|
349
350
|
json_data: bool = False,
|
|
351
|
+
agent: str = "Amazon",
|
|
350
352
|
) -> tuple[BeautifulSoup, ClientResponse]:
|
|
351
353
|
"""Return request response context data."""
|
|
352
354
|
_LOGGER.debug(
|
|
@@ -358,6 +360,7 @@ class AmazonEchoApi:
|
|
|
358
360
|
)
|
|
359
361
|
|
|
360
362
|
headers = DEFAULT_HEADERS.copy()
|
|
363
|
+
headers.update({"User-Agent": REQUEST_AGENT[agent]})
|
|
361
364
|
headers.update({"Accept-Language": self._language})
|
|
362
365
|
|
|
363
366
|
if self._csrf_cookie:
|
|
@@ -1046,6 +1049,7 @@ class AmazonEchoApi:
|
|
|
1046
1049
|
_, raw_resp = await self._session_request(
|
|
1047
1050
|
method=HTTPMethod.GET,
|
|
1048
1051
|
url=f"https://alexa.amazon.{self._domain}/api/bootstrap?version=0",
|
|
1052
|
+
agent="Browser",
|
|
1049
1053
|
)
|
|
1050
1054
|
if raw_resp.status != HTTPStatus.OK:
|
|
1051
1055
|
_LOGGER.debug(
|
|
@@ -1253,7 +1257,7 @@ class AmazonEchoApi:
|
|
|
1253
1257
|
device: AmazonDevice,
|
|
1254
1258
|
message_body: str,
|
|
1255
1259
|
) -> None:
|
|
1256
|
-
"""Call Alexa.
|
|
1260
|
+
"""Call Alexa.TextCommand to issue command."""
|
|
1257
1261
|
return await self._send_message(
|
|
1258
1262
|
device, AmazonSequenceType.TextCommand, message_body
|
|
1259
1263
|
)
|
aioamazondevices/const.py
CHANGED
|
@@ -39,14 +39,15 @@ AMAZON_CLIENT_OS = "18.5"
|
|
|
39
39
|
|
|
40
40
|
DEFAULT_SITE = "https://www.amazon.com"
|
|
41
41
|
DEFAULT_HEADERS = {
|
|
42
|
-
"User-Agent": (
|
|
43
|
-
f"AmazonWebView/AmazonAlexa/{AMAZON_APP_VERSION}/iOS/{AMAZON_CLIENT_OS}/iPhone"
|
|
44
|
-
),
|
|
45
42
|
"Accept-Charset": "utf-8",
|
|
46
43
|
"Accept-Encoding": "gzip",
|
|
47
44
|
"Connection": "keep-alive",
|
|
48
45
|
}
|
|
49
46
|
CSRF_COOKIE = "csrf"
|
|
47
|
+
REQUEST_AGENT = {
|
|
48
|
+
"Amazon": f"AmazonWebView/AmazonAlexa/{AMAZON_APP_VERSION}/iOS/{AMAZON_CLIENT_OS}/iPhone", # noqa: E501
|
|
49
|
+
"Browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0", # noqa: E501
|
|
50
|
+
}
|
|
50
51
|
|
|
51
52
|
REFRESH_ACCESS_TOKEN = "access_token" # noqa: S105
|
|
52
53
|
REFRESH_AUTH_COOKIES = "auth_cookies"
|
|
@@ -184,7 +185,7 @@ DEVICE_TYPE_TO_MODEL: dict[str, dict[str, str | None]] = {
|
|
|
184
185
|
"model": "Echo Dot",
|
|
185
186
|
"hw_version": "Gen3",
|
|
186
187
|
},
|
|
187
|
-
"A1TD5Z1R8IWBHA
|
|
188
|
+
"A1TD5Z1R8IWBHA": {
|
|
188
189
|
"model": "Fire Tablet HD 8",
|
|
189
190
|
"hw_version": "Gen12",
|
|
190
191
|
},
|
|
@@ -235,7 +236,7 @@ DEVICE_TYPE_TO_MODEL: dict[str, dict[str, str | None]] = {
|
|
|
235
236
|
"model": "Echo Dot Clock",
|
|
236
237
|
"hw_version": "Gen5",
|
|
237
238
|
},
|
|
238
|
-
"A2E0SNTXJVT7WK
|
|
239
|
+
"A2E0SNTXJVT7WK": {
|
|
239
240
|
"model": "Fire TV Stick",
|
|
240
241
|
"hw_version": "Gen2",
|
|
241
242
|
},
|
|
@@ -319,7 +320,7 @@ DEVICE_TYPE_TO_MODEL: dict[str, dict[str, str | None]] = {
|
|
|
319
320
|
"model": "Echo Dot",
|
|
320
321
|
"hw_version": "Gen3",
|
|
321
322
|
},
|
|
322
|
-
"A33S43L213VSHQ
|
|
323
|
+
"A33S43L213VSHQ": {
|
|
323
324
|
"model": "Smart TV 4K",
|
|
324
325
|
"hw_version": "4 Series",
|
|
325
326
|
},
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
aioamazondevices/__init__.py,sha256=OFf1p25xoL4BCdFQmpphXf541iLmm0Py8LC_rJYPL98,276
|
|
2
|
+
aioamazondevices/api.py,sha256=uTWsZagMQDZ4I-v8lpk9xCTebxUTMDXMU6JE4NANhPc,50367
|
|
3
|
+
aioamazondevices/const.py,sha256=BZTyUku94uQa50R1ZeXo1h585xgUNT_Pb7KAifjawWc,12266
|
|
4
|
+
aioamazondevices/exceptions.py,sha256=gRYrxNAJnrV6uRuMx5e76VMvtNKyceXd09q84pDBBrI,638
|
|
5
|
+
aioamazondevices/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
aioamazondevices/query.py,sha256=SKn-fXFUnXnCvmKd6IvAGdkFL7sBzhYBEAZ0aZ2ez9E,1800
|
|
7
|
+
aioamazondevices/sounds.py,sha256=CXMDk-KoKVFxBdVAw3MeOClqgpzcVDxvQhFOJp7qX-Y,1896
|
|
8
|
+
aioamazondevices/utils.py,sha256=RzuKRhnq_8ymCoJMoQJ2vBYyuew06RSWpqQWmqdNczE,2019
|
|
9
|
+
aioamazondevices-6.4.5.dist-info/METADATA,sha256=k0QHRnM6juLj756-Okw0vq_8FVolrQR7SCF2FF7UdU8,7648
|
|
10
|
+
aioamazondevices-6.4.5.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
11
|
+
aioamazondevices-6.4.5.dist-info/licenses/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
|
|
12
|
+
aioamazondevices-6.4.5.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
aioamazondevices/__init__.py,sha256=RJKwkp9uAk9e7js3Pk8zK2QhdAUUkwRTFRnANkhba1E,276
|
|
2
|
-
aioamazondevices/api.py,sha256=D0rYuokOL84pOejK-0p47ixeaHIFWU1CI_Mk3pIr57E,50218
|
|
3
|
-
aioamazondevices/const.py,sha256=DPMKG-mWE2qOSFtOKz-FybOlNPdGti2a7hycLIWqHDc,12097
|
|
4
|
-
aioamazondevices/exceptions.py,sha256=gRYrxNAJnrV6uRuMx5e76VMvtNKyceXd09q84pDBBrI,638
|
|
5
|
-
aioamazondevices/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
aioamazondevices/query.py,sha256=SKn-fXFUnXnCvmKd6IvAGdkFL7sBzhYBEAZ0aZ2ez9E,1800
|
|
7
|
-
aioamazondevices/sounds.py,sha256=CXMDk-KoKVFxBdVAw3MeOClqgpzcVDxvQhFOJp7qX-Y,1896
|
|
8
|
-
aioamazondevices/utils.py,sha256=RzuKRhnq_8ymCoJMoQJ2vBYyuew06RSWpqQWmqdNczE,2019
|
|
9
|
-
aioamazondevices-6.4.4.dist-info/METADATA,sha256=s7Ky3nRqiRh6ajdgvMJxd3Kz8nc1PmuYbevZFOU0n3k,7648
|
|
10
|
-
aioamazondevices-6.4.4.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
11
|
-
aioamazondevices-6.4.4.dist-info/licenses/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
|
|
12
|
-
aioamazondevices-6.4.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|