Skip to content

Commit b5917cc

Browse files
authored
RC-2715-fix-async-call-example (#85)
* Fix async call example Signed-off-by: Maxim S <poplers24@gmail.com> * Fix async call example Signed-off-by: Maxim S <poplers24@gmail.com> --------- Signed-off-by: Maxim S <poplers24@gmail.com>
1 parent aaa3e6a commit b5917cc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,16 @@ import asyncio
377377
import concurrent.futures
378378
from twocaptcha import TwoCaptcha
379379

380-
captcha_result = await captchaSolver(image)
380+
API_KEY = "YOUR_API_KEY"
381+
image = "data:image/png;base64,iVBORw0KGgoA..."
381382

382383
async def captchaSolver(image):
383384
loop = asyncio.get_running_loop()
384-
with concurrent.future.ThreadPoolExecutor() as pool:
385+
with concurrent.futures.ThreadPoolExecutor() as pool:
385386
result = await loop.run_in_executor(pool, lambda: TwoCaptcha(API_KEY).normal(image))
386387
return result
388+
389+
captcha_result = asyncio.run(captchaSolver(image))
387390
```
388391

389392

0 commit comments

Comments
 (0)