I never had much luck with painkillers, rarely when I take them for headaches can I say, "that's better, thank you pills".
When I had my first frozen shoulder I was given a veritable range of horse pills, which did very little but make me really constipated. Fortunately my physio was able to sort me out.
Having written the above the unknown, of course, is I don't know how I would have been if I hadn't of taken them....
As others have suggested, best to find the cause of the headaches, they are an output.
Wish you well as they are no fun.