Created
April 16, 2020 21:31
-
-
Save rudyryk/d6d47eee8af26923c64afc0e05210cd0 to your computer and use it in GitHub Desktop.
Get date & time on GoPro camera via unofficial API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/KonradIT/gopro-py-api | |
import json | |
import datetime | |
from goprocam import GoProCamera, constants | |
goproCamera = GoProCamera.GoPro() | |
status = json.loads(goproCamera.getStatusRaw()).get('status') | |
status_time = status.get('40', [])[1:].split('%') | |
time_parts = [int(item, 16) for item in status_time] | |
if time_parts: | |
time_parts[0] += 2000 | |
print(datetime.datetime(*time_parts)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment