Created
April 13, 2019 04:51
-
-
Save rickscherer/cdc2224980536f4125444ce6f4c0c9f9 to your computer and use it in GitHub Desktop.
This file contains 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/tchellomello/python-ring-doorbell | |
from ring_doorbell import Ring | |
# ID of the newest video you want | |
OLDER_THAN = 6678032064860195883 | |
# ID of the oldest video you want | |
LAST_ONE = 6675690255416888363 | |
# grab info on this many videos at a time | |
CHUNK_SIZE = 50 | |
def download(): | |
count = 0 | |
eid = OLDER_THAN | |
while True: | |
events = deck.history(older_than=eid, limit=CHUNK_SIZE) | |
for event in events: | |
eid = event['id'] | |
if eid < LAST_ONE: | |
return | |
deck.recording_download(eid, filename='videos/{}.mp4'.format(eid)) | |
count += 1 | |
print '%s %s' % (count, eid) | |
ring = Ring('username', 'password') | |
# play with the API to figure out which camera you want | |
deck = ring.stickup_cams[0] | |
download() | |
print '\nDONE.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment