Created
October 30, 2018 00:16
-
-
Save pmac/cd78dccfc12e2ecbe6efc9eb216e47a3 to your computer and use it in GitHub Desktop.
Download all the videos between two events from Ring
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 = 6589184120805222376 | |
# ID of the oldest video you want | |
LAST_ONE = 6587337941997938664 | |
# 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('<your account email>', '<your password>') | |
# play with the API to figure out which camera you want | |
deck = ring.stickup_cams[2] | |
download() | |
print '\nDONE.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if try again same url work but how can set that it automatic try it again