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.4.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.4-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kylinautosolve-1.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 a9db62c8a0c3a9d6cc848457a74dd51612e2ec9d738d3dbc2c9b8d86bfb1e8c9
MD5 2aa2cced78aaa10359a301b060c6d270
BLAKE2b-256 19c6e295afc6c60d20fd619e9d768c6b0a0050ca62fb97581157580ee6f22c3b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kylinautosolve-1.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cad59f73d55744ebb5d0cd7a2b141e37cb5647cd6f0230b008d3be4363f0b6ba
MD5 d315f02b8044faacf757c7472a90304c
BLAKE2b-256 02676f16ff44531c60ed06d6b8b62faeff33fe613730dbc591e21eb6878bae36

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