I don't think I have the kind of willpower necessary to pull that off.
Nor do I! Which is why I cancel my internet subscription when necessary. It's super inconvenient, but I haven't found a way to solve this problem otherwise.
What I'm saying, I guess, is that I don't have a hack. In my experience, pleasures and pains are very hard to move around as an adult. But the danger you describe in your OP is very, very serious (one I face as well), and so it seems to me to be worth extraordinary measures. But I'm eagerly reading for any easier method.
I have a master's project I'm having trouble working on. It's something I've wanted to do, and I even started working on, long before I started my master's degree. If I can't even enjoy that, then I'm doomed to spend eight hours a day doing something I hate for the rest of my life. Even if I manage to improve my willpower, I doubt I'll be very productive doing something I don't want to do.
Does anyone have any idea how I can enjoy working more?