From 58c317cc6140def1aa9f6a24655327c4b1e066b5 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Sat, 29 Feb 2020 00:53:43 +0300 Subject: [PATCH] artlebedev typograph fallback for big pages --- modules/sync/kazimir/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/sync/kazimir/__init__.py b/modules/sync/kazimir/__init__.py index 881bfc75..43cafd8c 100644 --- a/modules/sync/kazimir/__init__.py +++ b/modules/sync/kazimir/__init__.py @@ -98,7 +98,11 @@ def html_from_tree(tree): async def typo(text): from kazimir import artlebedev - return await artlebedev.typograf(text) + result = await artlebedev.typograf(text) + if result == 'Размер текста ограничен 32 КБ': + return text + + return result # url = 'http://www.typograf.ru/webservice/' # params = dict(text=text) # return await request.post(url, params, {'chr': 'utf-8'})