Fix photo filename collisions, video downloads, and EXIF dates
Photos in the same report with identical timestamps were overwriting each other due to missing image index in the filename. Videos failed to download because attached_video is a dict with resolution URLs, not a plain URL. Also read EXIF DateTimeOriginal before modifying the file and write the report date as fallback when the image has no original timestamp. Embed creation_time metadata in downloaded videos using ffmpeg.
This commit is contained in:
parent
0ada2d4858
commit
8413179b5f
4 changed files with 385 additions and 377 deletions
19
README.md
19
README.md
|
|
@ -1,22 +1,33 @@
|
|||
# Kidsnote backup photo extraction
|
||||
# Kidsnote backup
|
||||
|
||||
I found the original script here https://gist.github.com/Leuconoe/21f6a07f50389c4de1ec127944af7008
|
||||
|
||||
I'm adding info to be able to easier use it.
|
||||
|
||||
## What it does
|
||||
|
||||
- Downloads all reports (text, photos, and videos) from kidsnote.com
|
||||
- Organizes them into a `YYYY/MM/DD` folder structure
|
||||
- Writes EXIF metadata into photos (report content, GPS location, and date when missing)
|
||||
- Embeds report date into video files when missing (requires ffmpeg)
|
||||
- Skips already-downloaded reports for incremental backups
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
pipenv install
|
||||
```
|
||||
|
||||
Optional: install `ffmpeg` to embed date metadata into downloaded videos.
|
||||
Without it, videos are still saved but without creation date information.
|
||||
|
||||
## How to use:
|
||||
|
||||
1. Copy the env-sample file to .env
|
||||
2. Put in your username and password
|
||||
3. Put in the path where you want the pictures stored, it will create a YYYY/MM/DD structure there
|
||||
4. Run `pipenv run ./get_report.py` to get the report, it stores it in a file report.json
|
||||
5. Run `pipenv run ./report_json_down.py` to download all the reports and pictures
|
||||
3. Put in the path where you want the photos and videos stored, it will create a YYYY/MM/DD structure there
|
||||
4. Run `pipenv run python get_report.py` to get the report, it stores it in a file report.json
|
||||
5. Run `pipenv run python report_json_down.py` to download all the reports, photos, and videos
|
||||
|
||||
## Run automatically with a systemd timer
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue