Skip to content

Player: cache addon stream redirect URLs#77

Open
Aztup wants to merge 2 commits into
Stremio:mainfrom
Aztup:feat/streamurl-cache
Open

Player: cache addon stream redirect URLs#77
Aztup wants to merge 2 commits into
Stremio:mainfrom
Aztup:feat/streamurl-cache

Conversation

@Aztup

@Aztup Aztup commented May 24, 2026

Copy link
Copy Markdown
Contributor

Problem

When using third party addons Stremio passes the full addon URL but most of the time it's a redirect.
This means that on every seek or new segment fetch it goes through the original URL, adding latency and straining the addon server. If the addon server goes down mid-playback, it'll buffer even though the final server is perfectly fine.

Summary

  • resolves the redirect url on loadfile command
  • reduce load on addons server
  • make the streaming experience smoother and faster overall

Benchmark (100 requests)

Without cache With cache
Avg 366.0 ms 117.7 ms
Min 153.2 ms 17.7 ms
Max 6617.7 ms 317.4 ms
p50 261.8 ms 106.1 ms
p90 360.2 ms 157.0 ms
p99 3357.9 ms 218.6 ms

Verification

  • cargo fmt
  • git diff --check
  • does not break on local file / torrent
  • fallback to the original url if it fails
  • clear cache on every new loadfile command + has ttl (some URLs could expire)
  • was tested over multiple days with no issues found
  • PRs touching (player.rs) that could cause conflicts Feat/bump mpv libmpv2 #59

@Aztup
Aztup marked this pull request as draft May 25, 2026 13:52
@Aztup
Aztup marked this pull request as ready for review May 29, 2026 13:48
Follow HTTP redirects once to a stable URL before handing the file to
mpv, so the player loads the resolved address.
@Aztup
Aztup force-pushed the feat/streamurl-cache branch from 676cbc0 to 3642bec Compare June 17, 2026 21:24
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