удаление @username из всего текста, замена Конец сообщения на Пип
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 29s

This commit is contained in:
vrubel 2026-06-20 08:20:57 +00:00
parent 50e7cea1f5
commit 39f10be7fd

View file

@ -66,11 +66,12 @@ def get_ogg_duration(path: str) -> int:
def clean_text(text: str) -> str:
text = emoji.replace_emoji(text, '')
text = re.sub(r'@\S+\s*', '', text)
text = re.sub(r'[ \t]+', ' ', text)
text = re.sub(r'\n{2,}', '\n', text)
text = text.strip()
if text:
text += '\nКонец сообщения.'
text += '\nПип.'
return text