Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kylinautosolve-1.0.5.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kylinautosolve-1.0.5-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file kylinautosolve-1.0.5.tar.gz.

File metadata

  • Download URL: kylinautosolve-1.0.5.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

Hashes for kylinautosolve-1.0.5.tar.gz
Algorithm Hash digest
SHA256 b9555199c3a68e2c870de5333c737fa00fd04d60e0b67e6b2fb9d23ba3a0b5fa
MD5 1e9defa2de871fe29b6a181a380ec37b
BLAKE2b-256 5b74ff6388c39510819a04e6d1e02d8110c38e217ebee8e2380369b9b58ac970

See more details on using hashes here.

File details

Details for the file kylinautosolve-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: kylinautosolve-1.0.5-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

Hashes for kylinautosolve-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7ec18bff1cbde33e56736fdee8d256b14f286e9a54e8d2ed0e30901f0ce98f83
MD5 ca08cad5ed25d416dcaf7592e24a6c78
BLAKE2b-256 7871ae3274614e2b6c2a03d471bc0f1af97d4676a1cf75f51802942c2d39e850

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page