How to pregenerate thumbnails for possible file formats compatible with Plasma 6/Dolphin?

I have a lot of files and scrolling drastically slows down during generation so I want to pregenerate thumbnails beforehand.
I have found several .py scripts but they are outdated at this point and despite thumbnails being generated in cache they are not used in the system.
How can I do this?