Example 2 Calculate
$$
\left(1+\cos \frac{\pi}{7}\right)\left(1+\cos \frac{3 \pi}{7}\right)\left(1+\cos \frac{5 \pi}{7}\right)
$$

the value.
$(2017$, Peking University Boya Talent Program Exam)
【Analysis】Using the double angle formula, the original expression can be transformed into $8 \sin \frac{\pi}{7} \cdot \sin \frac{2 \pi}{7} \cdot \sin \frac{3 \pi}{7} \cdot \sin \frac{4 \pi}{7} \cdot \sin \frac{5 \pi}{7} \cdot \sin \frac{6 \pi}{7}$.
Let the $n$ complex roots of $x^{n}=1$ be $1, \omega, \omega^{2}, \cdots, \omega^{n-1}\left(\arg \omega=\frac{2 \pi}{n}=\theta\right)$.
Then, by the factorization theorem, we have
$$
\begin{array}{l}
x^{n-1}+x^{n-2}+\cdots+1=\prod_{j=1}^{n-1}\left(x-\omega^{j}\right) \\
\Rightarrow \prod_{j=1}^{n-1}\left|1-\omega^{j}\right|=n \\
\Rightarrow \prod_{j=1}^{n-1}\left|\omega^{-\frac{j}{2}}-\omega^{\frac{j}{2}}\right|=n \\
\Rightarrow \prod_{j=1}^{n-1} \sin \frac{j \pi}{n}=\frac{n}{2^{n-1}} .
\end{array}
$$

Therefore, the desired value is $\frac{7}{8}$.