Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -114,10 +114,11 @@ def md_to_dom(markdown_text: str) -> list[dict[str, str | list | dict | None]]:
|
|
114 |
|
115 |
|
116 |
async def tgph_create_page(token: str, title: str, markdown_text: str) -> str:
|
|
|
117 |
params = {
|
118 |
'access_token': token,
|
119 |
'title': title,
|
120 |
-
'content':
|
121 |
'return_content': False
|
122 |
}
|
123 |
async with AsyncClient(verify=False, follow_redirects=True, timeout=30.0) as client:
|
@@ -128,6 +129,8 @@ async def tgph_create_page(token: str, title: str, markdown_text: str) -> str:
|
|
128 |
else:
|
129 |
result = {}
|
130 |
print(f'ошибка создания страницы: {json_response}')
|
|
|
|
|
131 |
return result.get('path')
|
132 |
|
133 |
|
|
|
114 |
|
115 |
|
116 |
async def tgph_create_page(token: str, title: str, markdown_text: str) -> str:
|
117 |
+
content = dumps(md_to_dom(markdown_text))
|
118 |
params = {
|
119 |
'access_token': token,
|
120 |
'title': title,
|
121 |
+
'content': content,
|
122 |
'return_content': False
|
123 |
}
|
124 |
async with AsyncClient(verify=False, follow_redirects=True, timeout=30.0) as client:
|
|
|
129 |
else:
|
130 |
result = {}
|
131 |
print(f'ошибка создания страницы: {json_response}')
|
132 |
+
print(markdown_text)
|
133 |
+
print(content)
|
134 |
return result.get('path')
|
135 |
|
136 |
|