Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Retrieve metadata for videos #685

Merged
merged 6 commits into from
Feb 5, 2023
Merged

Conversation

rhhayward
Copy link
Contributor

Description:

I have a micro-service which I have been using to get blink camera armed and battery status. I'd like to add to that micro-service the ability to 1. list videos, and 2. download videos. I checked, and download_videos had the components I was looking for, but they were all wrapped up together. With this PR I'm breaking out two methods: 1. get_videos_metadata, and 2. do_http_get. The download_videos now consists of 1. forcing camera into a list, a call to get_videos_metadata, and then calling the download parser. The download parser was only modified to call do_http_get instead of downloading directly, and moving the calculation of clip_address into do_http_get.

Related issue (if applicable): N/A

Checklist:

  • Local tests with tox run successfully PR cannot be meged unless tests pass
➜  blinkpy git:(videos-metadata) ✗ python -m tox -e py38          
...
Results (0.79s):
     107 passed
  py38: OK (1.22=setup[0.07]+cmd[1.15] seconds)
  congratulations :) (1.32 seconds)
  • Changes tested locally to ensure platform still works as intended
### I changed download dir in blinkapp.py to /tmp for my local testing
➜  blinkpy git:(videos-metadata) ✗ python3 -m pip install ./ && CREDFILE=./creds.json python3 blinkapp/blinkapp.py                      
...
➜  blinkpy git:(videos-metadata) ✗ ls -al /tmp/*.mp4  
-rw-rw-r-- 1 rhh rhh  158028 Feb  4 16:18 /tmp/front-door-2023-02-02t20-30-53-00-00.mp4
-rw-rw-r-- 1 rhh rhh  935551 Feb  4 16:18 /tmp/front-door-2023-02-02t23-32-10-00-00.mp4
...
-rw-rw-r-- 1 rhh rhh  456354 Feb  4 16:17 /tmp/garage-ext-2023-02-04t15-01-36-00-00.mp4
-rw-rw-r-- 1 rhh rhh  976975 Feb  4 16:17 /tmp/garage-ext-2023-02-04t15-31-06-00-00.mp4
  • Tests added to verify new code works

@codecov
Copy link

codecov bot commented Feb 4, 2023

Codecov Report

Merging #685 (d50d4d6) into dev (0b5b4cb) will increase coverage by 0.08%.
The diff coverage is 91.66%.

@@            Coverage Diff             @@
##              dev     #685      +/-   ##
==========================================
+ Coverage   84.23%   84.31%   +0.08%     
==========================================
  Files           8        8              
  Lines        1364     1371       +7     
==========================================
+ Hits         1149     1156       +7     
  Misses        215      215              
Flag Coverage Δ
unittests 84.31% <91.66%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
blinkpy/blinkpy.py 84.49% <91.66%> (+0.43%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@fronzbot
Copy link
Owner

fronzbot commented Feb 5, 2023

LGTM, thanks!

@fronzbot fronzbot merged commit ac96b8a into fronzbot:dev Feb 5, 2023
@fronzbot fronzbot changed the title adding get_videos_metadata Retrieve metadata for videos Feb 5, 2023
@rhhayward
Copy link
Contributor Author

Thanks!

@rhhayward rhhayward deleted the videos-metadata branch February 5, 2023 17:08
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants