Closed l7123222l7 closed 2 days ago
0.7.1版本 OCR使用正常 可以識別 但在0.7.3版本中 出現了 這該如何解決 OCR Error: cannot identify image file <_io.BytesIO object at 0x7f91e2057ec0> OCR Error: cannot identify image file <_io.BytesIO object at 0x7f91e1dc8040> OCR Error: cannot identify image file <_io.BytesIO object at 0x7f91e1eb9a30>
` async def captcha_challenge(self, response_text, origin, s, impersonate_option, headers, proxies, url): soup = BeautifulSoup(response_text, 'html.parser') captcha_id = soup.find('input', {'name': 'WAF_CAPTCHA_ID'}).get('value') captcha_image_url = soup.find('img', {'id': 'ui-captcha-image'}).get('src')
if captcha_id and captcha_image_url: captcha_image_url = urllib.parse.urljoin(origin, captcha_image_url) captcha_response = await s.get(captcha_image_url, **impersonate_option, headers=headers, proxies=proxies, verify=False, timeout=15, allow_redirects=True) if captcha_response.status_code == 200: try: # 轉換處理 from io import BytesIO buffer = BytesIO(captcha_response.content) content = buffer.getvalue() captcha_code = self.ocr.classification(content) print(captcha_code) except Exception as e: print(f"OCR Error: {str(e)}") return None`
It's not part of this project's scope. You need to reach out to your vendor or find the root cause.
0.7.1版本 OCR使用正常 可以識別 但在0.7.3版本中 出現了 這該如何解決 OCR Error: cannot identify image file <_io.BytesIO object at 0x7f91e2057ec0> OCR Error: cannot identify image file <_io.BytesIO object at 0x7f91e1dc8040> OCR Error: cannot identify image file <_io.BytesIO object at 0x7f91e1eb9a30>
` async def captcha_challenge(self, response_text, origin, s, impersonate_option, headers, proxies, url): soup = BeautifulSoup(response_text, 'html.parser') captcha_id = soup.find('input', {'name': 'WAF_CAPTCHA_ID'}).get('value') captcha_image_url = soup.find('img', {'id': 'ui-captcha-image'}).get('src')