I have similar issue when using LibreTranslate to detect language. The quality and the performance can be lower whenever involves text with url and non word (symbol). Have to use regex to remove those url and symbols 😅 I have take a look at Mastodon source code, the interesting thing is it seems they don't preprocess any text before request translation https://github.com/mastodon/mastodon/pull/19218/files