aioamazondevices 0.13.0__py3-none-any.whl → 1.0.0__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 +8 -5
- aioamazondevices/const.py +2 -2
- {aioamazondevices-0.13.0.dist-info → aioamazondevices-1.0.0.dist-info}/METADATA +1 -1
- aioamazondevices-1.0.0.dist-info/RECORD +10 -0
- aioamazondevices-0.13.0.dist-info/RECORD +0 -10
- {aioamazondevices-0.13.0.dist-info → aioamazondevices-1.0.0.dist-info}/LICENSE +0 -0
- {aioamazondevices-0.13.0.dist-info → aioamazondevices-1.0.0.dist-info}/WHEEL +0 -0
aioamazondevices/__init__.py
CHANGED
aioamazondevices/api.py
CHANGED
@@ -28,7 +28,7 @@ from .const import (
|
|
28
28
|
AMAZON_DEVICE_TYPE,
|
29
29
|
DEFAULT_ASSOC_HANDLE,
|
30
30
|
DEFAULT_HEADERS,
|
31
|
-
|
31
|
+
DOMAIN_BY_ISO3166_COUNTRY,
|
32
32
|
HTML_EXTENSION,
|
33
33
|
JSON_EXTENSION,
|
34
34
|
NODE_BLUETOOTH,
|
@@ -72,7 +72,7 @@ class AmazonEchoApi:
|
|
72
72
|
# Force country digits as lower case
|
73
73
|
country_code = login_country_code.lower()
|
74
74
|
|
75
|
-
locale =
|
75
|
+
locale = DOMAIN_BY_ISO3166_COUNTRY.get(country_code)
|
76
76
|
domain = locale["domain"] if locale else country_code
|
77
77
|
|
78
78
|
if locale and (assoc := locale.get("openid.assoc_handle")):
|
@@ -84,7 +84,6 @@ class AmazonEchoApi:
|
|
84
84
|
self._login_email = login_email
|
85
85
|
self._login_password = login_password
|
86
86
|
self._domain = domain
|
87
|
-
self._url = f"https://www.amazon.{domain}"
|
88
87
|
self._cookies = self._build_init_cookies()
|
89
88
|
self._headers = DEFAULT_HEADERS
|
90
89
|
self._save_raw_data = save_raw_data
|
@@ -235,7 +234,11 @@ class AmazonEchoApi:
|
|
235
234
|
cookies=self._website_cookies,
|
236
235
|
)
|
237
236
|
content_type: str = resp.headers.get("Content-Type", "")
|
238
|
-
_LOGGER.debug(
|
237
|
+
_LOGGER.debug(
|
238
|
+
"Response %s with content type: %s",
|
239
|
+
resp.status_code,
|
240
|
+
content_type,
|
241
|
+
)
|
239
242
|
|
240
243
|
await self._save_to_file(
|
241
244
|
resp.text,
|
@@ -253,7 +256,7 @@ class AmazonEchoApi:
|
|
253
256
|
output_path: str = SAVE_PATH,
|
254
257
|
) -> None:
|
255
258
|
"""Save response data to disk."""
|
256
|
-
if not self._save_raw_data:
|
259
|
+
if not self._save_raw_data or not raw_data:
|
257
260
|
return
|
258
261
|
|
259
262
|
output_dir = Path(output_path)
|
aioamazondevices/const.py
CHANGED
@@ -6,12 +6,12 @@ _LOGGER = logging.getLogger(__package__)
|
|
6
6
|
|
7
7
|
DEFAULT_ASSOC_HANDLE = "amzn_dp_project_dee_ios"
|
8
8
|
|
9
|
-
|
9
|
+
DOMAIN_BY_ISO3166_COUNTRY = {
|
10
10
|
"us": {
|
11
11
|
"domain": "com",
|
12
12
|
"openid.assoc_handle": DEFAULT_ASSOC_HANDLE,
|
13
13
|
},
|
14
|
-
"
|
14
|
+
"gb": {
|
15
15
|
"domain": "co.uk",
|
16
16
|
},
|
17
17
|
"au": {
|
@@ -0,0 +1,10 @@
|
|
1
|
+
aioamazondevices/__init__.py,sha256=XbJRDlStfKsLjiOzztTl_ZThVv3tQtDrUsHqBgQcUco,276
|
2
|
+
aioamazondevices/api.py,sha256=h3KtDQwERROb8HEkcnSY4pWpRWte3FRo70j_rtDxBUU,19407
|
3
|
+
aioamazondevices/auth.py,sha256=vLJh7iOEUYu-44WOvmrmZZueOcwz5dmHAGQmqs9fJME,10099
|
4
|
+
aioamazondevices/const.py,sha256=ikFYN9ZLAirnETkzOiuv-tJo6DYVDlEJyXWGRdbxI4A,1981
|
5
|
+
aioamazondevices/exceptions.py,sha256=qK_Hak9pc-lC2FPW-0i4rYIwNpEOHMmA9Rii8F2lkQo,1260
|
6
|
+
aioamazondevices/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
+
aioamazondevices-1.0.0.dist-info/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
|
8
|
+
aioamazondevices-1.0.0.dist-info/METADATA,sha256=0DhyVc7ZfnhIdGAJOsHxJ2_tC-Nq_H77wu98dRE7iZw,4742
|
9
|
+
aioamazondevices-1.0.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
10
|
+
aioamazondevices-1.0.0.dist-info/RECORD,,
|
@@ -1,10 +0,0 @@
|
|
1
|
-
aioamazondevices/__init__.py,sha256=6wV1gd7isgO5AUmPIAfBf15kyca8gwxV-r6OoIt1rJg,277
|
2
|
-
aioamazondevices/api.py,sha256=CpDap56Un4O8W19u9O9-Rr0CurTJWlwCyVWpNUvmyGE,19353
|
3
|
-
aioamazondevices/auth.py,sha256=vLJh7iOEUYu-44WOvmrmZZueOcwz5dmHAGQmqs9fJME,10099
|
4
|
-
aioamazondevices/const.py,sha256=pY3CTWW8mOaWbaDV_oZunX9hGcDZIhImzTXZEf-mXDU,1973
|
5
|
-
aioamazondevices/exceptions.py,sha256=qK_Hak9pc-lC2FPW-0i4rYIwNpEOHMmA9Rii8F2lkQo,1260
|
6
|
-
aioamazondevices/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
aioamazondevices-0.13.0.dist-info/LICENSE,sha256=sS48k5sp9bFV-NSHDfAJuTZZ_-AP9ZDqUzQ9sffGlsg,11346
|
8
|
-
aioamazondevices-0.13.0.dist-info/METADATA,sha256=3jik4PsdZwDzgKQoze9X98c-V4h9_NJ-RW0PIWV-cm4,4743
|
9
|
-
aioamazondevices-0.13.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
10
|
-
aioamazondevices-0.13.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|