The official client package of Kylin Autosolve for Python
Project description
The client library of Kylin Autosolve
by Kylin Inc.
This is a client library of Kylin Autosolve based on the WebSocket protocol.
Installation
pip install kylin-autosolve-client-python
Usage
Initialize a client
import kylinautosolve
client = kylinautosolve.KylinAutosolveClient()
Connect to the autosolve service
cliennt.access_token = 'ACCESS_TOKEN'
client.cient_key = 'CLIENT_KEY'
client.start()
Add a listener to receive result
def handler(evt):
notification = evt.notification
task_result = notification.task_result()
evt.handled += 1
print('received task result:', task_result)
client.on('notification:task_result', handler)
NOTE
The token field is encoded in JSON format.
Create a task to solve a challenge
options = {
'site_key': '6Lfv-q0ZAAAAADy0U9JUaCPCZI15U-7jhbAiYa0U',
'version': '3',
'action': 'login'
}
message = client.make_create_task_message({
'google',
'https://recaptcha-test.kylinbot.io/',
options.get('timeout', 0'),
options
})
await client.when_ready()
response = await client.invoke(message)
print('response:', response)
Poll the result of a task
You don't have to poll the result usually, the autosolve server will notify client when it got the result from Kylin One Click, install a notification handler to receive result instead.
await client.invoke(client.make_get_task_result_message(
kylinautosolve.GetTaskResultRequest(
task_id=create_task_response.create_task.task_id
)))
Cancel a request
await client.invoke(client.make_cancel_task_message(
kylinautosolve.CancelTaskRequest(
task_id=create_task_response.create_task.task_id
)))
Cancel all requests
await client.invoke(client.make_cancel_task_message())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kylinautosolve-1.0.6.tar.gz.
File metadata
- Download URL: kylinautosolve-1.0.6.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fba6eb0700d0eb13b0ff76a0f534a4cd1b410889c18d14b4678e639a0a33f11
|
|
| MD5 |
f67ace791b2aea607409b36c2990d878
|
|
| BLAKE2b-256 |
e1202d5eff7840f27dd21dd2fb12b169f22d76fc6238dbd52ca4b528613398bd
|
File details
Details for the file kylinautosolve-1.0.6-py3-none-any.whl.
File metadata
- Download URL: kylinautosolve-1.0.6-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0e7ca6a60173520be062abd0b6eddd531e941ba02c5276f9428985e79fabfa7
|
|
| MD5 |
5c0693071272c639c208d79ed4d3f91f
|
|
| BLAKE2b-256 |
20ec062aa5ed445ad5164711f2c5f60dd8aafcc235ed93f23ba2e2c586d04c72
|