Update ImageToTextTask.py
This commit is contained in:
parent
276336736d
commit
d02d6c3da5
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue