qums-fetch 0.4.4.dev1__tar.gz → 0.4.4.dev2__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.
- {qums_fetch-0.4.4.dev1 → qums_fetch-0.4.4.dev2}/PKG-INFO +1 -1
- {qums_fetch-0.4.4.dev1 → qums_fetch-0.4.4.dev2}/pyproject.toml +1 -1
- {qums_fetch-0.4.4.dev1 → qums_fetch-0.4.4.dev2}/pyproject.toml.orig +1 -1
- {qums_fetch-0.4.4.dev1 → qums_fetch-0.4.4.dev2}/src/qums_fetch/client.py +8 -12
- {qums_fetch-0.4.4.dev1 → qums_fetch-0.4.4.dev2}/README.md +0 -0
- {qums_fetch-0.4.4.dev1 → qums_fetch-0.4.4.dev2}/src/qums_fetch/__init__.py +0 -0
- {qums_fetch-0.4.4.dev1 → qums_fetch-0.4.4.dev2}/src/qums_fetch/captcha.py +0 -0
- {qums_fetch-0.4.4.dev1 → qums_fetch-0.4.4.dev2}/src/qums_fetch/exceptions.py +0 -0
- {qums_fetch-0.4.4.dev1 → qums_fetch-0.4.4.dev2}/src/qums_fetch/py.typed +0 -0
|
@@ -245,7 +245,7 @@ class Client:
|
|
|
245
245
|
|
|
246
246
|
# Check if login was successful
|
|
247
247
|
def _looks_like_login_success(self, resp: requests.Response) -> bool:
|
|
248
|
-
if resp.url == BASE_URL:
|
|
248
|
+
if resp.url.rstrip("/") == BASE_URL:
|
|
249
249
|
soup = BeautifulSoup(resp.text, "html.parser")
|
|
250
250
|
still_has_captcha = soup.select_one(CAPTCHA_IMG_SELECTOR) is not None
|
|
251
251
|
return not still_has_captcha
|
|
@@ -255,17 +255,13 @@ class Client:
|
|
|
255
255
|
# Extract error message from the login page
|
|
256
256
|
@staticmethod
|
|
257
257
|
def _extract_error_message(soup: BeautifulSoup) -> str | None:
|
|
258
|
-
|
|
259
|
-
if
|
|
260
|
-
|
|
261
|
-
if
|
|
262
|
-
raise
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
if credentials_error:
|
|
266
|
-
text = credentials_error.get_text(strip=True)
|
|
267
|
-
if text:
|
|
268
|
-
raise CredentialsError(text)
|
|
258
|
+
error_div = soup.select_one(".validation-summary-errors")
|
|
259
|
+
if error_div:
|
|
260
|
+
error_text = error_div.select_one("li").get_text(strip=True)
|
|
261
|
+
if "password" and "incorrect" in error_text:
|
|
262
|
+
raise CredentialsError(error_text)
|
|
263
|
+
else:
|
|
264
|
+
raise CaptchaError(error_text)
|
|
269
265
|
|
|
270
266
|
return None
|
|
271
267
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|