Skip to content

Instantly share code, notes, and snippets.

@rudyryk
Created April 16, 2020 21:31
Show Gist options
  • Save rudyryk/d6d47eee8af26923c64afc0e05210cd0 to your computer and use it in GitHub Desktop.
Save rudyryk/d6d47eee8af26923c64afc0e05210cd0 to your computer and use it in GitHub Desktop.
Get date & time on GoPro camera via unofficial API
# 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