How to calculate $\lim_{x\to1}\left(\frac{1+\cos(\pi x)}{\tan^2(\pi x)}\right)^{\!x^2}$ How can I calculate this Limit without l'Hôpital's rule?

Calculate
  $$\lim_{x\to1}\left(\frac{1+\cos(\pi x)}{\tan^2(\pi x)}\right)^{\!x^2}$$

All I got is this:
$$\exp \left(\left(\lim \limits_{x\to1}x^2\right)\ln\left(\lim \limits_{x\to1}\frac{1+\cos(\pi x)}{\tan^2(\pi x)}\right)\right)=\exp\left(\ln \left(\lim \limits_{x\to1}\frac{1+\cos(\pi x)}{\tan^2(\pi x)}\right)\right)$$
then I split the $\tan$ into $\dfrac\sin\cos$ and I dont know how to continue.

Setting $x=1-h$
$$\lim_{x\to1}\frac{1+\cos\pi x}{\tan^2\pi x}=\lim_{h\to0}\frac{1+\cos\{\pi(1-h)\}}{[\tan\{\pi(1-h)\}]^2}$$
$$=\lim_{h\to0}\frac{1-\cos\pi h}{\tan^2\pi h}\text{ as }\cos(\pi-y)=-\cos y,\tan(\pi-y)=-\tan y$$
$$=\lim_{h\to0}\frac{1-\cos\pi h}{\sin^2\pi h}\cdot \left(\lim_{h\to0}\ \cos\pi h\right)^2$$
$$=\lim_{h\to0}\frac{1-\cos\pi h}{(1-\cos\pi h)(1+\cos\pi h)}\cdot1$$
$$=\lim_{h\to0}\frac1{1+\cos\pi h}$$ as $1-\cos\pi h\ne0$ as $h\ne0$ as $h\to0$
$$=\cdots$$
