Skip to content

Commit

Permalink
Renamed domain parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Xewdy444 committed Dec 31, 2024
1 parent e07940e commit 8a42312
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
refresh_token = ""

[captcha_solver]
domain = ""
api_domain = ""
api_key = ""

[authorization.credentials]
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async def main() -> None:
)

captcha_solver_config = CaptchaSolverConfig(
domain=config["captcha_solver"]["domain"],
api_domain=config["captcha_solver"]["api_domain"],
api_key=config["captcha_solver"]["api_key"],
)

Expand Down
8 changes: 4 additions & 4 deletions utils/passes_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,15 @@ async def _get_recaptcha_token(
CaptchaError
If the CAPTCHA solving service returns an error or is unsupported.
"""
if captcha_solver_config.domain not in CAPTCHA_TASK_JSON:
if captcha_solver_config.api_domain not in CAPTCHA_TASK_JSON:
raise CaptchaError("Unsupported CAPTCHA solving service.")

create_task_response = await self._session.post(
f"https://{captcha_solver_config.domain}/createTask",
f"https://{captcha_solver_config.api_domain}/createTask",
json={
"clientKey": captcha_solver_config.api_key,
"task": {
**CAPTCHA_TASK_JSON[captcha_solver_config.domain],
**CAPTCHA_TASK_JSON[captcha_solver_config.api_domain],
"websiteURL": "https://www.passes.com/login",
"websiteKey": self.RECAPTCHA_SITEKEY,
"pageAction": "login",
Expand All @@ -297,7 +297,7 @@ async def _get_recaptcha_token(

while True:
task_result = await self._session.post(
f"https://{captcha_solver_config.domain}/getTaskResult",
f"https://{captcha_solver_config.api_domain}/getTaskResult",
json={
"clientKey": captcha_solver_config.api_key,
"taskId": task_json["taskId"],
Expand Down
4 changes: 2 additions & 2 deletions utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ async def json(self) -> str:
class CaptchaSolverConfig(BaseModel):
"""A class for representing the configuration for a CAPTCHA solving service."""

domain: str
api_domain: str
api_key: str

def __bool__(self) -> bool:
return bool(self.domain and self.api_key)
return bool(self.api_domain and self.api_key)

0 comments on commit 8a42312

Please sign in to comment.