Skip to content

perf: cache video/playlist metadata, speed up yt-dlp retries - #3

Merged
AxalotLDev merged 1 commit into
mainfrom
feature/faster-metadata-fetch
Aug 19, 2026
Merged

perf: cache video/playlist metadata, speed up yt-dlp retries#3
AxalotLDev merged 1 commit into
mainfrom
feature/faster-metadata-fetch

Conversation

@AxalotLDev

Copy link
Copy Markdown
Owner

Adds a playlist/metadata cache and speeds up yt-dlp retries. Rebased onto main after the audio-quality-selector merge; cookie-retry logic in youtube.rs was hand-merged to combine both branches' improvements (upfront cached-cookie fast path + full multi-browser retry loop + WORKING_COOKIE_BROWSER caching on success).

- Add in-memory TTL cache (5 min) keyed by normalized video/playlist
  id for YouTube video, Twitch video, and playlist metadata lookups;
  skips repeated yt-dlp spawns on re-pasted/revisited URLs. Only
  complete results are cached (missing duration or live entries are
  excluded) to avoid locking in a transient fetch failure.
- Remove the artificial 1200ms delay between yt-dlp metadata retries.
- Skip the redundant fetch_duration spawn for live videos.
- Expand cookies-from-browser fallback to try every detected browser
  (was: first found only), Firefox first since it doesn't depend on
  the OS keyring like Chromium-family browsers do. Adds edge/whale on
  Linux and chromium/opera/whale on Windows to the detection list.
- Add parking_lot dependency for the cache mutex, per project
  convention (LazyLock + parking_lot over OnceLock/std Mutex).
@AxalotLDev
AxalotLDev merged commit 79a163b into main Aug 19, 2026
1 check failed
@AxalotLDev
AxalotLDev deleted the feature/faster-metadata-fetch branch August 19, 2026 15:21
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

Successfully merging this pull request may close these issues.

1 participant