You can't flow while integrating a third party library anywhere near as easily as you can flow by rewriting half of it (badly) from scratch.
Flow is a rush. Anything that is a rush can be indulged in to the point of self- (or other-) harm.
That is not so clear cut, it depends on the library. If the documentation sucks or the library is a mess, rewriting it may both induce flow and be a win for the team.
I frequently need to reach states of deep flow when I am reading large inter-related files for refactoring, or modifying existing code to use a new library, or to follow tutorials for something only tangential, like new deployment tooling.
Reaching states of flow is necessary no matter what you’re doing, and given the insane explosion of modern process overhead and meeting-centric corporate culture, it’s important to protect flow time and make it known how important flow is. Whereas I can see how people might try to use thinking like in your comment to undermine flow time, and falsely act like it’s somehow better to deny developers workspace or blocks of time for getting into flow states.
Libraries should help keep the flow going at a high level by keeping one from being bogged down with having to reinvent the wheel. In fact, if they didn't contribute to flow, I don't think we'd use them!
Most people engaging in NIH aren't removing a library that is already being used in your build process. They're deciding it's easier to implement URL processing (spoilers: it's not) than to use a library that already exists.
The exception to that is when the existing library turns out to be a dumpster fire and you rip it out and replace it with something else or a custom version.
Have you talked to them about it?
Not everybody does that, and if they do, there is appropriate compensation (cash, extra time off and/or both). Good companies simply don't, they realize you can easily walk away to next company. I never ever worked for an employer like that for example, and that's 15 years and 6 employers in 3 countries.
You're selling yourself cheap. Have some dignity.
Good companies do realize that making people work overtime consistently without reward is a bad idea, if for no other reason than the selfish one: your good employees will leave.
I know a lot of companies that do it anyway because they either don't care or don't accept people are leaving because of the constant overtime.
I also know people who have stayed at bad companies either because they don't want to let their team down or they just got used to the constant overtime and didn't realize how bad it was until they left. Or the simple fact that many people do not like change, and prefer the overtime they know rather than jumping to the unknown new job.
Just because someone is working overtime without compensation doesn't mean they don't have dignity. There are many reasons to stay at a crap job (for a while, if you have to). Please don't insult others just because their life is worse than you have allowed your life to get.
That being said, I agree with a few other posters - if you are consistently working 13 hour days, start looking for a new job. My rule of thumb is to spend one hour job hunting for every hour of required/expected overtime.
Go home and contribute to an open source project or something. Unless you're at a tiny startup and getting tons of equity you're never going to be compensated for it, and it'll still be there tomorrow.
And if they do require 13 hour days, leave. The market for devs is too good right now to tolerate that.
(Which I guess is nothing against what you said, just a pet-peeve of mine)