Skip to content

Commit 7ef8367

Browse files
fix: decoding bytes to string for image captcha
1 parent cb15a67 commit 7ef8367

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bestcaptchasolverapi3/bestcaptchasolverapi.py

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ def submit_image_captcha(self, opts):
6161
if os.path.exists(image_path):
6262
with open(image_path, 'rb') as f:
6363
data['b64image'] = b64encode(f.read())
64+
# it might require decoding of bytes to string
65+
try:
66+
data['b64image'] = data['b64image'].decode('utf-8')
67+
except:
68+
pass
6469
else:
6570
data['b64image'] = image_path # should be b64 already
6671

0 commit comments

Comments
 (0)