fix: add optional Google Books API key to resolve rate-limited metadata fetching#1380
Open
seanjohnite wants to merge 1 commit into
Open
fix: add optional Google Books API key to resolve rate-limited metadata fetching#1380seanjohnite wants to merge 1 commit into
seanjohnite wants to merge 1 commit into
Conversation
…ta searches Google aggressively rate-limits unauthenticated requests to the Books API, causing empty results for many users. This adds a global config field for a Google Books API key (Admin → Configuration) that is appended to search requests when set, restoring reliable metadata results. - config_sql.py: add config_google_api_key column (auto-migrated on startup) - admin.py: persist the new field on config save - config_edit.html: add API key input with help text near Hardcover/Goodreads - google.py: append &key= to search URL when key is configured - tests: add unit tests covering key present, absent, and empty cases Fixes crocodilestick#993
f6e50cf to
9ac5ecc
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Google aggressively rate-limits unauthenticated requests to the Books API, causing empty results for many users. This adds a global config field for a Google Books API key (Admin → Configuration) that is appended to search requests when set, restoring reliable metadata results.
Example log: [2026-05-29 01:08:17,501] WARN {cps.metadata_provider.google:45} 429 Client Error: Too Many Requests for url: https://www.googleapis.com/books/v1/volumes?q=Harry+Potter
Fixes #993