Depending on the number involved, the OEM firmware support of tftp or the like, and if manual activation of tftp is required, that may be an option.
I have very, very vague memories of old TP-Link devices trying tftp firmware updates on every boot. There was some kind of magic packet that you could see on the wire, then initiate a tftp "push" to the device. They should require some manual intervention to initiate that these days, but given how "secure" their devices are, it wouldn't surprise me if they still do it.
I would recommend the tftp mode. Typically there are 2 modes:
Push mode - you push the image to the device.
Pull mode - the device itself requests an image with a special naming.
What of those is supported depends on the preinstalled bootloder on the device.
The supported tftp mode is in general enabled by long pressing the reset button to say the bootloader to get into tftp mode.
I wont go with curl-based script for login, navigating and so on. Some manufacturer change the design with different firmware versions and then your script is broken.
With tftp mode you also dont have to care if its a preused device where the old owner forgot to remove his password. It "just" in very few seconds (dont have to wait till OEM firmware booted up).