Did you look at
https://dashcamtalk.com/forum/threads/blackvue-network-file-downloader-updated-17-07.29728/ ?
I was using an early version of that with some success (after a bit of tweaking), and it's been updated since then. I eventually switched to creating my own Windows app (because that's what I do), so I haven't used the script for a while.
There are "caveats" with the approach you're taking, which I found out the hard way. First, configure your router to supply a constant IP address associated with the Mac. If your router can't do that, you may have a problem (I use DD-WRT, which does allow this). So when you look at your LAN, you'll see the camera has a constant IP, and you can connect to it via the Cloud Viewer (which you don't need for the script, just for testing).
Next, when you drive away, the camera will lose connection to your WiFi (obviously) and the Cloud. It'll retry a few times, and then give up. So when you arrive back home, it won't just magically reconnect. If you get in the habit of tapping the WiFi button on the camera (WiFi Off) as you approach home, and then again (WiFi On) just as you arrive, then it'll reconnect right away. Or, it appears that the camera will retry every 12 hours. I don't have hard data, but I find that in the morning it suddenly reconnects to the router & Cloud.
And finally, WiFi signal strength is critical. I ended up setting up a separate access point in a front room as physically close to my parking spot as possible without being outdoors. The lower the signal strength, the slower file transfers. And there's no way the camera is Wireless-N (or if it is, the file transfer is throttled). Absolute fastest I can get (with the access point sitting on the hook of my Jeep) is download of a 3-minute video (front & rear) in about a minute and a half.
Eventually I hope to release my app for public consumption, but I'm still struggling with some quirks and "creeping featuritus".
Brad.