Skip to content

Offline subtitles for downloads, faster source search, Stremio add-ons - #15

Merged
Ivorisnoob merged 11 commits into
mainfrom
claude/offline-subtitles-gallery
Oct 3, 2026
Merged

Ivorisnoob merged 11 commits into
mainfrom
claude/offline-subtitles-gallery

Conversation

@Ivorisnoob

@Ivorisnoob Ivorisnoob commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Subtitles for downloads

  • Downloads sheet (CC button) for each finished movie or episode. It shows what's saved on the device (works offline), lets you import an SRT/VTT/ASS file, and lists results to tick and save. The video's own stream subtitles come first, then OpenSubtitles and SubSource. Results are grouped by language, can be filtered, and any language can be searched by name, with "More releases" per language and a "Hide SDH" filter.
  • Saved automatically with every download in the languages picked under Settings > Downloads > Subtitles (default English; none turns it off). This covers every subtitle in those languages: the stream's own, plus OpenSubtitles/SubSource unless that switch is off. Both settings are included in backups.
  • Storage: SavedSubtitleRepository keeps files in filesDir/subtitles/<download id>/ with index.json, plus stream.json recording the stream's own subtitles. The player lists saved subtitles first, online or offline, and never reloads the media item for them. SubtitleFetcher reads file: URLs only for .srt/.vtt/.ass inside that folder, because the cast proxy fetches any URL it is given.
  • Parser fix: WebVTT timestamps without hours (01:02.345) were dropped, so stream subtitles had no cues. This affected saving, sideloaded subtitles in the player and casting. HLS subtitle playlists are now joined into one file.

Source search

  • Cancelling a resolution (leaving the player, switching episodes) was recorded as a failure of every provider still running. Five of those turned a provider off until the app restarted. Cancellation now records nothing, and the breaker reopens after two minutes; if it would leave nothing to try, everything is tried.
  • The provider timeout couldn't interrupt OkHttp's blocking execute(), so one slow provider held up completion and the fallback stage. Providers now run in their own scope and are awaited with a 25 s deadline, and every provider yields an outcome.
  • The IMDb id lookup on TMDB ran first with no limit; it now gets 8 s, and the "searching" state is sent before it.
  • Fallbacks start after 8 s with nothing found, instead of waiting for the slowest direct provider.
  • AnimeEpisodeMapper locks per episode.

Stremio add-ons

  • New stremio engine (StremioAddonProvider). It reads the add-on manifest for types and id prefixes, then requests /stream/{movie|series}/{id}.json with IMDb ids, or tmdb: ids when the add-on accepts them. It plays direct-url streams with the add-on's request headers and subtitles; torrent, YouTube and external-link streams are skipped.
  • A Stremio manifest.json, stremio:// link or /configure link pasted into Add repository becomes a one-add-on repository, installed right away when it can play.
  • Official catalog: HdHub, yastream, Zeus, FrostStream, FenixFlix (Beta). On 2026-10-02 each returned direct streams with no account or key for The Matrix and/or Breaking Bad S1E1. Other popular add-ons were checked and left out: Torrentio, Comet, MediaFusion and AIOStreams are torrent/debrid only; PenguPlay needs sign-in; WebStreamr and NuvioStreams public instances are deprecated; several others were down or empty.

The "Save to gallery" feature from earlier commits was removed again, along with the media3-transformer dependency.

Risk / third-party behaviour relied on

  • OpenSubtitles legacy REST (sublanguageid-<ISO 639-2/B>), SubSource's site API: undocumented, keyless.
  • Re-resolving stream sources for older downloads runs the same providers as the player, including hidden WebViews.
  • Stremio add-ons are community-hosted and move often; catalog entries may need marking Down or retiring.
  • Not verified on a device. CI builds the release APK.

🤖 Generated with Claude Code

https://claude.ai/code/session_012Q3Wvy4u4xbBdt49QcBbkR

claude added 4 commits October 2, 2026 15:05
Downloads get a Subtitles sheet: tick any number of subtitles from
OpenSubtitles and SubSource (grouped by language, any language searchable,
SDH filter) or import an SRT/VTT/ASS file. They are kept per title and
episode in filesDir/subtitles and the player lists them first, online or
offline. SubtitleFetcher reads file: URLs only from that folder.

"Save to gallery" repackages a finished download into an MP4 in
Movies/OpenStream with Media3 Transformer, reading the download cache like
the offline player, without re-encoding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Q3Wvy4u4xbBdt49QcBbkR
The export never writes to or evicts the download cache, whatever the
shared CacheDataSource factory is set to; a failed or cancelled export only
removes its temp MP4 and the unfinished gallery entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Q3Wvy4u4xbBdt49QcBbkR
Removes GalleryExporter and the media3-transformer dependency.

The Downloads subtitle sheet only searched OpenSubtitles and SubSource,
so subtitles the player showed under the source's name never appeared
there. Downloads now record the stream's subtitles (stream.json next to
the saved ones); older downloads look the title up in the stream sources
again. They are listed first and saved with the stream's headers.
SubtitleFetcher only reads .srt/.vtt/.ass from the saved folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Q3Wvy4u4xbBdt49QcBbkR
@Ivorisnoob Ivorisnoob changed the title Offline subtitles for downloads, save downloads to the gallery Offline subtitles for downloads Oct 2, 2026
claude added 4 commits October 2, 2026 15:39
Saving a stream's subtitles failed with "no readable subtitles": the parser
only accepted hh:mm:ss.mmm, while WebVTT may write mm:ss.mmm. The player
never hit this because ExoPlayer parses stream subtitles itself. The same
parser feeds sideloaded subtitles in the player and the cast proxy.

Subtitle URLs that turn out to be HLS playlists are now fetched segment by
segment and joined. A save that gets a web page back says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Q3Wvy4u4xbBdt49QcBbkR
Settings > Downloads > Subtitles picks any number of languages (English by
default; none turns it off) and whether OpenSubtitles and SubSource count
too. When a download starts, DownloadSubtitleSaver saves every subtitle in
those languages: the stream's own, then the sites' (languages the general
search leaves out are asked for by name). It stops when the download is
removed and cleans up if it was removed meanwhile. Both settings are in
backups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Q3Wvy4u4xbBdt49QcBbkR
… breaker

- Cancelling a resolution (leaving the player, switching episodes) was
  recorded as a failure of every provider still running; five of those
  turned a provider off until the app restarted. Cancellation now records
  nothing, and the breaker reopens after two minutes. If it would leave
  nothing to try, everything is tried.
- The 20 s provider timeout could not interrupt OkHttp's blocking execute(),
  so one slow provider held up completion and the fallback stage. Providers
  now run in their own scope and are awaited with a 25 s deadline (enough
  for the WebView path); every provider yields an outcome, so a resolution
  can't wait forever.
- The IMDb id lookup ran first with no limit on TMDB; it now gets 8 s, and
  the "searching" state is sent before it.
- Fallback providers start after 8 s if direct ones have found nothing yet,
  instead of waiting for the slowest direct provider.
- AnimeEpisodeMapper locks per episode, so a lookup stuck on the previous
  episode no longer blocks the next one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Q3Wvy4u4xbBdt49QcBbkR
- New `stremio` engine (StremioAddonProvider): reads the add-on manifest
  for content types and id prefixes, asks /stream/{movie|series}/{id}.json
  with IMDb ids (tmdb: ids when the add-on takes them), and plays streams
  that carry a direct url, with the add-on's request headers and
  subtitles. Torrent, YouTube and external-link streams are skipped.
- A Stremio manifest.json (or stremio:// link, or /configure page link)
  pasted into Add repository becomes a one-add-on repository and is
  installed right away when it serves streams without needing setup.
- Official catalog: HdHub, yastream, Zeus, FrostStream and FenixFlix,
  each checked to return direct streams for a movie and an episode with no
  account or key (status Beta). Bundled copy updated.
- Docs: engine tables, how Stremio add-ons map onto extensions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Q3Wvy4u4xbBdt49QcBbkR
@Ivorisnoob Ivorisnoob changed the title Offline subtitles for downloads Offline subtitles for downloads, faster source search, Stremio add-ons Oct 2, 2026
claude added 3 commits October 2, 2026 16:27
HdHub listed The Matrix 27 times: about a dozen releases, each on up to
four hosts, and 16 of those links could not play (12 hubcloud mirrors
redirect to a 404, 3 FSLv2 signed URLs had already expired, 1 PixelDrain
file wanted a captcha). The player failed over through them one by one,
which looked like it switching between qualities.

- Streams are grouped by release name and size; each release keeps the
  first mirror that answers a 16-byte range request with video bytes (or
  #EXTM3U for HLS). Releases are checked in parallel within 8 s.
- Labels read "add-on name · size · release" instead of the host and size
  tags, and keep two-line add-on names together.
- The player says a source "didn't play" rather than "stopped responding",
  which also covered links that were dead from the start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Q3Wvy4u4xbBdt49QcBbkR
- Marketplace > Installed shows each source's rank with arrows to move it.
  The order is stored per device; sources not ranked yet follow the
  catalog's priority. A provider's priority is now its position in it.
- Search order: "All at once" (default, unchanged behaviour: everything in
  parallel, streams sorted by quality, the order breaking ties) or "In my
  order": one source at a time from the top, stopping at the first that
  finds streams, ranked by the order before quality. When those streams all
  fail, or on Find more, everything else is searched as before.
- The mode is in AppSettings and in backups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Q3Wvy4u4xbBdt49QcBbkR
Add-ons label streams with host tags, emoji and scene file names
("HdHub VM 1080p · 1.98 GB · Matrix.1.The.Matrix.(1999).1080p.Dual.Audio.
(Hin.Eng).Vegamovies.is.mkv"). StremioStreamLabels rebuilds each name from
what the add-on says, in a fixed order: resolution, HDR, IMAX, source,
codec, 60fps, audio languages (or dual/multi audio), dubbed/subtitled, size
-- "1080p · BluRay · HEVC 10-bit · Hindi + English · 1.98 GB". Streams that
say too little lead with a cleaned remainder of their own text, minus the
film's title, years, episode markers and emoji ("kisskh", "Source 2 ·
Dubbed"). Same names within one add-on get numbered.

Also fixes mirror grouping: it keyed on the first title line only, so Zeus's
dubbed and subtitled streams (both "Fonte: Filme/Serie 02") were merged.
The key now uses every descriptive line except host footers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Q3Wvy4u4xbBdt49QcBbkR
@Ivorisnoob
Ivorisnoob merged commit c40f2f6 into main Oct 3, 2026
1 check passed
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.

2 participants