In some work I've been doing on the cohomology of the moduli space of curves, the following identity has come up:

$$\prod_{i=1}^n \frac{x^{i-1}}{x^i-1} = \sum_{(a_1^{r_1},\ldots,a_{\ell}^{r_{\ell}}) \vdash n} \left(\prod_{j=1}^{\ell} \frac{1}{a_i^{r_i} (x^{a_i}-1)^{r_i} (r_i)!}\right).$$

Here $x$ is a formal variable and the sum on the RHS is over all partitions of $n$. By $(a_1^{r_1},\ldots,a_{\ell}^{r_{\ell}}) \vdash n$, I mean a partition of the form

$$r_1 a_1 + r_2 a_2 + \cdots + r_{\ell} a_{\ell} = n$$

with $r_1,\ldots,r_{\ell} \geq 1$ and $a_1>a_2>\cdots>a_{\ell} \geq 1$.

I have verified this identity with Mathematica for $1 \leq n \leq 20$. However, I cannot figure out how to prove that it is always true. Can anyone help me?

This reminds me a little bit of the identity in this question, and I've tried without success to use the tools discussed in the answers to that question to solve it.

EDIT: In case anyone is interested, a version of this identity now appears as Lemma 5.2 in my paper "The high dimensional cohomology of the moduli space of curves with level structures" (joint w/ Neil Fullarton), which can be downloaded from my webpage here. Thanks to Lucia for telling me how to prove it!