设常数 $\alpha>0, \beta>0$, 若反常积分 $\int_{\frac{\pi}{2}}^\pi \frac{1}{(-\cos x)^\alpha(1+\cos x)^\beta} \mathrm{d} x$ 收敛, 则
$\text{A.}$ $0 < \alpha < 1,0 < \beta < 1$.
$\text{B.}$ $0 < \alpha < \frac{1}{2}, 0 < \beta < \frac{1}{2}$.
$\text{C.}$ $0 < \alpha < 1,0 < \beta < \frac{1}{2}$.
$\text{D.}$ $0 < \alpha < \frac{1}{2}, 0 < \beta < 1$.