How do I change this script to render as openGL with transparency?

I am trying to render only the CONSTANT keyframes of an animation in opengl, I was using the script found here

But I have no clue how coding works and don’t know how to change it to opengl.

I tried changing bpy.ops.render.render( write_still=True )

to

bpy.ops.render.opengl(animation=True, view_context=True)

And it renders in opengl, but doesn’t follow the script like it should and renders every frame instead, even
when the “fill” setting in the script is set to False.

HELP

wouldnt it be easier to remove filler space between keyframes, render out as images, import the renders as an image sequence, then mess with the timing then?