Well, this link refers to that inline component as a rectifier. So I am guessing that is what it is.

Rectifier?

If the string runs acceptably well with a 9 volt battery, then I'd get a nine volt power supply, splice it into the light string and ride off into the sunset.

Power supply


"We live in a time when intelligent people are being silenced so that stupid people won't be offended".