-
Notifications
You must be signed in to change notification settings - Fork 18k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tools: siyi image and video download script #27947
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice Randy! I added a few non-functional suggestions on the python code, mostly for readability. Feel free to accept/dismiss any as they have likely won't impact functionality.
As far as building the URL's, consider using urllib's built in support for parameters, which can replace the call
return "http://" + ip_address + ":82/cgi-bin/media.cgi/api/v1/getdirectories?media_type=" + str(media_type)
With something like:
params = {"media_type": str(media_type)}
f"http://{ip_address}:82/cgi-bin/media.cgi/api/v1/getdirectories?" + urllib.parse.urlencode(params)
Reference:
https://stackoverflow.com/a/15799706/11032285
Or, you can even use the urlparse
library.
String concatenation works totally fine too!
Hi @Ryanf55, thanks very much for that, I'll make those changes! |
2be9d3d
to
d43490e
Compare
d43490e
to
f7b6b0b
Compare
Besides the changes requested by Ryan, I've also added a bit more error checking so I think this is ready to be merged to master. I have also discovered that there's an issue on the Siyi side in that we can't download the raw thermal images but I've raised this with Siyi and hopefully they will resolve this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really only care about the AP_FLAKE8_CLEAN
change.
f7b6b0b
to
74ee8fa
Compare
This adds a python script to the Tools/camera_gimbals directory that makes it easy to download images and videos from Siyi camera gimbals.
I'm not a python expert so all suggestions for improvements are very welcome. ChatGPT has given me a fairly long list of things that could be improved so if people like I could try and improve it further.
This has been tested on a Siyi ZT6 and some sample output is shown below