feat: add YouTube engine with config file and env support

YouTube Data API v3 engine:
- Add YouTubeConfig to EnginesConfig with api_key field
- Add YOUTUBE_API_KEY env override
- Thread *config.Config through search service to factory
- Factory falls back to env vars if config fields are empty
- Update config.example.toml with youtube section

Also update default local_ported to include google and youtube.
This commit is contained in:
Franz Kafka 2026-03-22 01:57:13 +00:00
parent 1689cab9bd
commit a7f594b7fa
5 changed files with 47 additions and 12 deletions

View file

@ -22,7 +22,7 @@ url = ""
[engines]
# Comma-separated list of engines to execute locally in Go (env: LOCAL_PORTED_ENGINES)
# Engines not listed here will be proxied to the upstream instance.
local_ported = ["wikipedia", "arxiv", "crossref", "braveapi", "qwant", "duckduckgo", "github", "reddit", "bing"]
local_ported = ["wikipedia", "arxiv", "crossref", "braveapi", "qwant", "duckduckgo", "github", "reddit", "bing", "google", "youtube"]
[engines.brave]
# Brave Search API key (env: BRAVE_API_KEY)
@ -35,6 +35,10 @@ access_token = ""
category = "web-lite"
results_per_page = 10
[engines.youtube]
# YouTube Data API v3 key (env: YOUTUBE_API_KEY)
api_key = ""
[cache]
# Valkey/Redis cache for search results.
# Leave address empty to disable caching entirely.