Update ImageToTextTask.py

This commit is contained in:
Andrei 2022-10-28 04:38:09 +03:00
parent 276336736d
commit d02d6c3da5
1 changed files with 14 additions and 2 deletions

View File

@ -178,7 +178,17 @@ class ImageToTextTask:
"""
# Список допустимых параметров Session.request()
session_attrs = ['headers', 'cookies', 'auth', 'proxies', 'hooks', 'params', 'verify', 'cert', 'stream']
session_attrs = [
"headers",
"cookies",
"auth",
"proxies",
"hooks",
"params",
"verify",
"cert",
"stream",
]
session_params = kwargs.copy()
for key in kwargs:
if key in session_attrs:
@ -217,7 +227,9 @@ class ImageToTextTask:
else:
# Ожидаем решения капчи
time.sleep(self.sleep_time)
return get_sync_result(result_payload=self.result_payload, sleep_time=self.sleep_time, **session_params)
return get_sync_result(
result_payload=self.result_payload, sleep_time=self.sleep_time, **session_params
)
class aioImageToTextTask: