Skip to content

Commit fa8bdfa

Browse files
committed
Submit verification for funcaptcha example
1 parent c5bf3f7 commit fa8bdfa

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

examples/funcaptcha_request.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,17 @@ def get_token(form_html):
4545
return job.get_token_response()
4646

4747

48+
def form_submit(token):
49+
return requests.post(
50+
url="{}/verify".format(url), data={"name": "xx", "fc-token": token}
51+
).text
52+
53+
4854
def process():
4955
html = get_form_html()
50-
return get_token(html)
56+
token = get_token(html)
57+
return form_submit(token)
5158

5259

5360
if __name__ == "__main__":
54-
print('Solved!' in process())
61+
print("Solved!" in process())

tests/test_examples.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class FuncaptchaTestCase(TestCase):
6565
def test_funcaptcha(self):
6666
from examples import funcaptcha_request
6767

68-
self.assertIn('Solved!', funcaptcha_request.process())
68+
self.assertIn("Solved!", funcaptcha_request.process())
6969

7070

7171
@missing_key
@@ -121,7 +121,7 @@ def test_process(self):
121121

122122

123123
@missing_key
124-
@skipIf(True, 'We testing via proxy for performance reason.')
124+
@skipIf(True, "We testing via proxy for performance reason.")
125125
class HCaptchaTaskProxylessTestCase(TestCase):
126126
@retry(tries=3)
127127
def test_process(self):
@@ -132,6 +132,7 @@ def test_process(self):
132132

133133
@missing_key
134134
class HCaptchaTaskTestCase(TestCase):
135+
@retry(tries=3)
135136
def test_process(self):
136137
from examples import hcaptcha_request_proxy
137138

0 commit comments

Comments
 (0)