# Path: python_anticaptcha/compat.py
# def split(value, sep, maxsplit):
#     return value.split(sep, maxsplit=maxsplit)
# 
# Path: python_anticaptcha/exceptions.py
# class AnticaptchaException(Exception):
#     def __init__(self, error_id, error_code, error_description, *args):
#         super(AnticaptchaException, self).__init__(
#             "[{}:{}]{}".format(error_code, error_id, error_description)
#         )
#         self.error_description = error_description
#         self.error_id = error_id
#         self.error_code = error_code


import requests
import time
import json
import warnings
from .compat import split
from six.moves.urllib_parse import urljoin
from .exceptions import AnticaptchaException
    SOFT_ID = 847
    language_pool = "en"
    response_timeout = 5

    def __init__(
        self, client_key, language_pool="en", host="api.anti-captcha.com", use_ssl=True
    ):
        self.client_key = client_key
        self.language_pool = language_pool
        self.base_url = "{proto}://{host}/".format(
            proto="https" if use_ssl else "http", host=host
        )
        self.session = requests.Session()

    @property
    def client_ip(self):
        if not hasattr(self, "_client_ip"):
            self._client_ip = self.session.get(
                "https://api.myip.com", timeout=self.response_timeout
            ).json()["ip"]
        return self._client_ip

    def _check_response(self, response):
        if response.get("errorId", False) == 11:
            response[
                "errorDescription"
            ] = "{} Your missing IP address is propably {}.".format(
                response["errorDescription"], self.client_ip
            )
        if response.get("errorId", False):

# Path: python_anticaptcha/compat.py
# def split(value, sep, maxsplit):
#     return value.split(sep, maxsplit=maxsplit)
# 
# Path: python_anticaptcha/exceptions.py
# class AnticaptchaException(Exception):
#     def __init__(self, error_id, error_code, error_description, *args):
#         super(AnticaptchaException, self).__init__(
#             "[{}:{}]{}".format(error_code, error_id, error_description)
#         )
#         self.error_description = error_description
#         self.error_id = error_id
#         self.error_code = error_code


# Path: python_anticaptcha/base.py
import requests
import time
import json
import warnings
from .compat import split
from six.moves.urllib_parse import urljoin
from .exceptions import AnticaptchaException

    SOFT_ID = 847
    language_pool = "en"
    response_timeout = 5

    def __init__(
        self, client_key, language_pool="en", host="api.anti-captcha.com", use_ssl=True
    ):
        self.client_key = client_key
        self.language_pool = language_pool
        self.base_url = "{proto}://{host}/".format(
            proto="https" if use_ssl else "http", host=host
        )
        self.session = requests.Session()

    @property
    def client_ip(self):
        if not hasattr(self, "_client_ip"):
            self._client_ip = self.session.get(
                "https://api.myip.com", timeout=self.response_timeout
            ).json()["ip"]
        return self._client_ip

    def _check_response(self, response):
        if response.get("errorId", False) == 11:
            response[
                "errorDescription"
            ] = "{} Your missing IP address is propably {}.".format(
                response["errorDescription"], self.client_ip
            )
        if response.get("errorId", False):

            raise AnticaptchaException(