Spaces:
Running
Running
zhou12189108
commited on
Commit
•
aa30b8f
1
Parent(s):
452753f
Upload hcaptcha_solver.py
Browse files- hcaptcha_solver.py +2 -3
hcaptcha_solver.py
CHANGED
@@ -9,11 +9,10 @@ from hcaptcha_challenger.agents import AgentT, Malenia
|
|
9 |
solver.install(upgrade=True)
|
10 |
|
11 |
# Save dataset to current working directory
|
12 |
-
context_dir = user_data_dir.joinpath("context")
|
13 |
tmp_dir = Path(__file__).parent.joinpath("tmp_dir")
|
14 |
|
15 |
|
16 |
-
async def hit_challenge(context: ASyncContext, host, sitekey, times: int = 8):
|
17 |
await context.route('**/*', lambda route, request: route_continuation(route, request, host, sitekey))
|
18 |
page = context.pages[0]
|
19 |
agent = AgentT.from_page(page=page, tmp_dir=tmp_dir)
|
@@ -142,5 +141,5 @@ async def bytedance(host, sitekey, user_data_dirs):
|
|
142 |
locale="en-US"
|
143 |
)
|
144 |
await Malenia.apply_stealth(context)
|
145 |
-
token = await hit_challenge(context, host, sitekey)
|
146 |
return token
|
|
|
9 |
solver.install(upgrade=True)
|
10 |
|
11 |
# Save dataset to current working directory
|
|
|
12 |
tmp_dir = Path(__file__).parent.joinpath("tmp_dir")
|
13 |
|
14 |
|
15 |
+
async def hit_challenge(context: ASyncContext, host, sitekey, user_data_dir, times: int = 8):
|
16 |
await context.route('**/*', lambda route, request: route_continuation(route, request, host, sitekey))
|
17 |
page = context.pages[0]
|
18 |
agent = AgentT.from_page(page=page, tmp_dir=tmp_dir)
|
|
|
141 |
locale="en-US"
|
142 |
)
|
143 |
await Malenia.apply_stealth(context)
|
144 |
+
token = await hit_challenge(context, host, sitekey,Path(__file__).parent.joinpath(user_data_dirs))
|
145 |
return token
|