AlexaPy 1.29.22__tar.gz → 1.29.23__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.
- {alexapy-1.29.22 → alexapy-1.29.23}/PKG-INFO +1 -1
- {alexapy-1.29.22 → alexapy-1.29.23}/alexapy/alexalogin.py +19 -6
- {alexapy-1.29.22 → alexapy-1.29.23}/pyproject.toml +1 -1
- {alexapy-1.29.22 → alexapy-1.29.23}/AUTHORS.md +0 -0
- {alexapy-1.29.22 → alexapy-1.29.23}/LICENSE +0 -0
- {alexapy-1.29.22 → alexapy-1.29.23}/README.md +0 -0
- {alexapy-1.29.22 → alexapy-1.29.23}/alexapy/__init__.py +0 -0
- {alexapy-1.29.22 → alexapy-1.29.23}/alexapy/alexaapi.py +0 -0
- {alexapy-1.29.22 → alexapy-1.29.23}/alexapy/alexahttp2.py +0 -0
- {alexapy-1.29.22 → alexapy-1.29.23}/alexapy/alexaproxy.py +0 -0
- {alexapy-1.29.22 → alexapy-1.29.23}/alexapy/alexawebsocket.py +0 -0
- {alexapy-1.29.22 → alexapy-1.29.23}/alexapy/const.py +0 -0
- {alexapy-1.29.22 → alexapy-1.29.23}/alexapy/errors.py +0 -0
- {alexapy-1.29.22 → alexapy-1.29.23}/alexapy/helpers.py +0 -0
|
@@ -475,9 +475,13 @@ class AlexaLogin:
|
|
|
475
475
|
await self._session._connector.close()
|
|
476
476
|
self._session._connector = None
|
|
477
477
|
|
|
478
|
-
async def reset(self) -> None:
|
|
478
|
+
async def reset(self, *, delete_cookies: bool = True) -> None:
|
|
479
479
|
"""Remove data related to existing login."""
|
|
480
|
-
_LOGGER.debug(
|
|
480
|
+
_LOGGER.debug(
|
|
481
|
+
"Resetting Login for %s - %s",
|
|
482
|
+
hide_email(self.email),
|
|
483
|
+
self.url,
|
|
484
|
+
)
|
|
481
485
|
await self.close()
|
|
482
486
|
self._session = None
|
|
483
487
|
self._data = None
|
|
@@ -489,9 +493,15 @@ class AlexaLogin:
|
|
|
489
493
|
self._create_session()
|
|
490
494
|
self._close_requested = False
|
|
491
495
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
496
|
+
if delete_cookies:
|
|
497
|
+
_LOGGER.debug(
|
|
498
|
+
"Deleting cookies for %s - %s",
|
|
499
|
+
hide_email(self.email),
|
|
500
|
+
self.url,
|
|
501
|
+
)
|
|
502
|
+
for cookiefile in self._cookiefile:
|
|
503
|
+
if cookiefile and os.path.exists(cookiefile):
|
|
504
|
+
await delete_cookie(cookiefile)
|
|
495
505
|
|
|
496
506
|
@classmethod
|
|
497
507
|
def get_inputs(cls, soup: BeautifulSoup, searchfield=None) -> dict[str, str]:
|
|
@@ -679,7 +689,10 @@ class AlexaLogin:
|
|
|
679
689
|
_LOGGER.debug("Using cookies to log in")
|
|
680
690
|
if await self.test_loggedin(cookies):
|
|
681
691
|
return
|
|
682
|
-
|
|
692
|
+
_LOGGER.debug(
|
|
693
|
+
"Cookie login failed; resetting session without deleting cookies"
|
|
694
|
+
)
|
|
695
|
+
await self.reset(delete_cookies=False)
|
|
683
696
|
_LOGGER.debug("Using credentials to log in")
|
|
684
697
|
if not self._site:
|
|
685
698
|
site: URL = self.start_url
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|