loading new texture each frame by code (Cycles)?

How would you do it?

I need to load 6 cubemap images each “frame” and apply them to a cube and render that as equirectangular panorama frames via Cycles (camera inside cube, nothing else in the scene).