Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Preventing Google Photos API limit from being exceeded #92

Closed
MikeGawi opened this issue Jan 1, 2024 · 2 comments
Closed

Preventing Google Photos API limit from being exceeded #92

MikeGawi opened this issue Jan 1, 2024 · 2 comments
Assignees

Comments

@MikeGawi
Copy link
Owner

MikeGawi commented Jan 1, 2024

According to Google Photos API specification:

All requests sent to the Google Photos Library API are counted toward a quota. We put these limits in place to protect the system and its users.
...
The quota limit for requests to the Library API is 10,000 requests per project per day.

and
this issue(#89) I need to find a way how to minimize number of requests (currently the whole data is taken every frame refresh, 50 items every time /another Google limit/).

MikeGawi added a commit that referenced this issue Jan 1, 2024
Preventing Google Photos API limit from being exceeded #92
@MikeGawi MikeGawi pinned this issue Jan 1, 2024
@MikeGawi
Copy link
Owner Author

MikeGawi commented Jan 1, 2024

The solution is to store downloaded Google Photos API data once a day and then load it when needed. As we have Pandas on board I can use a simple DataFrame dump/load mechanism (Feather format seems to be fast and enough for this). The data will be downloaded at first run every day and then for the rest it will be loaded and reused. The problem is that photos download URLs are expiring but in that case I can refresh it when something like this happens (with two retries). With that refresh requests number will be maximum 2% of the 10k requests limit, leaving the rest for the initial download.

This setting controls this behavior:
https://github.com/MikeGawi/ePiframe/blob/master/config.cfg#L30

always = every frame refresh, once = once a day

@MikeGawi
Copy link
Owner Author

MikeGawi commented Jan 1, 2024

Fixed in #93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant