2 Commits
1.1.1 ... main

Author SHA1 Message Date
86a03647df Merge branch 'main' of https://git.frik.su/n0one/habr-article-API
All checks were successful
Build and Push Docker Image / build-and-push (release) Successful in 2m6s
2025-09-17 16:09:43 +03:00
73da634029 both /article/get/ endpoints now return json 2025-09-17 16:09:29 +03:00

View File

@ -70,14 +70,14 @@ async def remove_rating(entry: Entry, response: Response):
async def get_article_html(article: Article, response: Response = None):
html_string = await scraper.get_article_html(article.url)
b64_string = base64.b64encode(html_string.encode('utf-8')).decode('utf-8')
return Response(content=article.url + '\r\n' + b64_string, media_type='text/plain')
return {article.url: b64_string}
@router.post('/article/get/md')
async def get_article_md(article: Article, response: Response = None):
md_string = await scraper.get_article_html(article.url, md=True)
b64_string = base64.b64encode(md_string.encode('utf-8')).decode('utf-8')
return Response(content=article.url + '\r\n' + b64_string, media_type='text/plain')
return {article.url: b64_string}
@router.post('/articles/get/html')