src/Client.php
public function recognizeKeyCaptcha(
        $SSCUserId,
        $SSCSessionId,
        $SSCWebServerSign,
        $SSCWebServerSign2,
        $pageUrl,
        $extra = []
    ) {
        $captchaId = $this
            ->sendKeyCaptcha($SSCUserId, $SSCSessionId, $SSCWebServerSign, $SSCWebServerSign2, $pageUrl, $extra);

        $startTime = time();

        while (true) {
            $this->getLogger()->info("Waiting {$this->rTimeout} sec.");

            sleep($this->recaptchaRTimeout);

            if (time() - $startTime >= $this->mTimeout) {
                throw new RuntimeException("Captcha waiting timeout.");
            }

            $result = $this->getCaptchaResult($captchaId);

            if ($result === false) {
                continue;
            }

            $this->getLogger()->info("Elapsed " . (time()-$startTime) . " second(s).");

            return $result;
        }

        throw new RuntimeException('Unknown recognition logic error.');
    }
public function recognizeKeyCaptcha(
        $SSCUserId,
        $SSCSessionId,
        $SSCWebServerSign,
        $SSCWebServerSign2,
        $pageUrl,
        $extra = []
    ) {
        $captchaId = $this
            ->sendKeyCaptcha($SSCUserId, $SSCSessionId, $SSCWebServerSign, $SSCWebServerSign2, $pageUrl, $extra);

        $startTime = time();

        while (true) {
            $this->getLogger()->info("Waiting {$this->rTimeout} sec.");

            sleep($this->recaptchaRTimeout);

            if (time() - $startTime >= $this->mTimeout) {
                throw new RuntimeException("Captcha waiting timeout.");
            }

            $result = $this->getCaptchaResult($captchaId);

            if ($result === false) {
                continue;
            }

            $this->getLogger()->info("Elapsed " . (time()-$startTime) . " second(s).");

            return $result;
        }

        throw new RuntimeException('Unknown recognition logic error.');
    }
Keycaptcha recognition.

@param string $SSCUserId
@param string $SSCSessionId
@param string $SSCWebServerSign
@param string $SSCWebServerSign2
@param string $pageUrl
@param array $extra
@return string                       # Code to place into id="capcode" input value
@throws ErrorResponseException
@throws InvalidArgumentException
@throws RuntimeException
@throws \GuzzleHttp\Exception\GuzzleException