I don’t think it’s YouTube, it’s the computer itself. The problem is getting on the computer with no purpose. If you’re sitting on the computer, with no direction, you will end up mesmerizing yourself with whatever you find interesting.
I think the solution is to stop sitting around on the computer/phone in the first place. If you stop using YouTube, but sit there on your phone for no reason, you’ll just end up wasting time on something else.