Added ability to download recent video clip

This commit is contained in:
Kevin Fronczak
2018-01-20 20:13:33 -05:00
parent 79191d757a
commit 8ab44041eb
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -12,6 +12,7 @@ A list of changes between each release
- Refactored code for better organization
- Moved some request calls out of @property methods (enables future CLI support)
- Renamed get_summary() method to summary and changed to @property
- Added ability to download most recent video clip
0.6.0 (2017-05-12)
^^^^^^^^^^^^^^^^^^
+7
View File
@@ -178,6 +178,13 @@ class BlinkCamera(object):
with open(path, 'wb') as imgfile:
copyfileobj(response.raw, imgfile)
def video_to_file(self, path):
"""Write video to file."""
response = _request(self.blink, url=self.clip, headers=self.header,
reqtype='get', stream=True, json_resp=False)
with open(path, 'wb') as vidfile:
copyfileobj(response.raw, vidfile)
class Blink(object):
"""Class to initialize communication and sync module."""