This is pretty easy to solve. If you present data by algorithm, you are no longer an impartial common carrier and are liable for the content you present. If the user decides you don’t, ala social media 1.0.
This is one of those things that don’t translate to legal reality very well, as then you have to define “what is an algorithm”. Is adding advertisements an algorithm? Is including likes an algorithm? Is automatically starting the next video after a previous one has finished an algorithm? Is infinite scroll an algorithm? Etc
I'm not saying there aren't infinite edge cases and second-order effects - but we tolerate those already for many things. I'm not pretending this is simple or even desirable - I'm merely stating it's possible if we want to do it.
My biggest fear is that (like the UK Online safety act) this acts to favour the huge corporations because they are the only ones that can afford a team of lawyers. Any legislation should aim to carve out exceptions to avoid indirectly helping monopolies.