ci: format
This commit is contained in:
parent
a37e7f2e4a
commit
ff03b932b1
8 changed files with 28 additions and 79 deletions
|
|
@ -17,16 +17,9 @@ from urllib3.util.retry import Retry
|
|||
|
||||
from .base import BaseScraper, extract_precision
|
||||
from .language_ids import get_language_id
|
||||
from .models import (
|
||||
CombinedTest,
|
||||
ContestListResult,
|
||||
ContestSummary,
|
||||
MetadataResult,
|
||||
ProblemSummary,
|
||||
SubmitResult,
|
||||
TestCase,
|
||||
TestsResult,
|
||||
)
|
||||
from .models import (CombinedTest, ContestListResult, ContestSummary,
|
||||
MetadataResult, ProblemSummary, SubmitResult, TestCase,
|
||||
TestsResult)
|
||||
|
||||
MIB_TO_MB = 1.048576
|
||||
BASE_URL = "https://atcoder.jp"
|
||||
|
|
@ -385,9 +378,7 @@ class AtcoderScraper(BaseScraper):
|
|||
try:
|
||||
session = curl_requests.Session(impersonate="chrome")
|
||||
|
||||
login_page = session.get(
|
||||
f"{BASE_URL}/login", timeout=TIMEOUT_SECONDS
|
||||
)
|
||||
login_page = session.get(f"{BASE_URL}/login", timeout=TIMEOUT_SECONDS)
|
||||
login_page.raise_for_status()
|
||||
soup = BeautifulSoup(login_page.text, "html.parser")
|
||||
csrf_input = soup.find("input", {"name": "csrf_token"})
|
||||
|
|
@ -414,9 +405,7 @@ class AtcoderScraper(BaseScraper):
|
|||
success=False,
|
||||
error="Login failed: incorrect username or password",
|
||||
)
|
||||
session.get(
|
||||
BASE_URL + location, timeout=TIMEOUT_SECONDS
|
||||
)
|
||||
session.get(BASE_URL + location, timeout=TIMEOUT_SECONDS)
|
||||
else:
|
||||
login_resp.raise_for_status()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue