예제 #1
0
    async def _solve(self, solve_image):
        if solve_image:
            from nonocaptcha.image import SolveImage

            self.image = SolveImage(
                self.browser,
                self.image_frame,
                self.proxy,
                self.proxy_auth,
                self.proc_id)
            solve = self.image.solve_by_image
        else:
            from nonocaptcha.audio import SolveAudio

            self.audio = SolveAudio(
                self.page,
                self.loop,
                self.proxy,
                self.proxy_auth,
                self.proc_id)
            await self.loop.create_task(self.wait_for_audio_button())
            result = await self.click_audio_button()
            if isinstance(result, dict):
                if result['status'] == 'detected':
                    return result
            solve = self.audio.solve_by_audio

        result = await self.loop.create_task(solve())
        if result['status'] == 'success':
            code = await self.g_recaptcha_response()
            if code:
                result['code'] = code
                return result
        else:
            return result
예제 #2
0
    async def _solve(self):
        # Coming soon...
        solve_image = False
        if solve_image:
            self.image = SolveImage(self.page, self.proxy, self.proxy_auth,
                                    self.proc_id)
            solve = self.image.solve_by_image
        else:
            self.audio = SolveAudio(self.page, self.proxy, self.proxy_auth,
                                    self.proc_id)
            await self.wait_for_audio_button()
            result = await self.click_audio_button()
            if isinstance(result, dict):
                if result["status"] == "detected":
                    return result
            solve = self.audio.solve_by_audio

        result = await solve()
        if result["status"] == "success":
            code = await self.g_recaptcha_response()
            if code:
                result["code"] = code
                return result
        else:
            return result
예제 #3
0
    async def _solve(self):
        # Coming soon!
        solve_image = False
        if solve_image:
            self.image = SolveImage(self.page, self.proxy, self.log)
            solve = self.image.solve_by_image
        else:
            self.audio = SolveAudio(self.page, self.proxy, self.log)

            await self.wait_for_audio_button()
            await self.click_audio_button()
            solve = self.audio.solve_by_audio

        for i in range(5):
            result = await solve()
            if result:
                code = await self.g_recaptcha_response()
                if code:
                    self.log("Audio response successful")
                    return f"OK|{code}"