feat: add in-memory media info cache and YouTube search feature

- Add in-memory LRU cache (200 entries, 30 min TTL) to yt-dlp Client for
  GetMediaInfo and GetPlaylistInfo results, avoiding redundant yt-dlp calls
  for the same URL within a session
- Add YouTube (/search) and YouTube Music (/music) search with paginated
  results (5 per page), user selects a result to start the download flow
- Add SearchState type, new search.go handler, search results keyboard with
  < > navigation and New Search button
- Add Search button to main menu keyboard
- Update help text with new commands
This commit is contained in:
2026-06-25 22:58:20 +03:30
parent 66a8cd1128
commit 3290bb55c0
6 changed files with 246 additions and 3 deletions

View File

@@ -29,6 +29,7 @@ type stepState struct {
Container string
FormatIDs []string
PlaylistState *domain.PlaylistState
SearchState *domain.SearchState
}
func (h *Handler) getUserStepState(chatID int64) *stepState {