feat(streamio): add POST /api/nzb/stremio-streams endpoint - #372
Merged
Conversation
New public endpoint that accepts an NZB file upload, processes it
synchronously through the high-priority import queue, and returns
Stremio-compatible stream URLs for all media files in the NZB output.
Authentication is via download_key (SHA256 of user API key), matching
the existing stream handler auth model so Stremio addons can be
pre-configured without browser-based JWT auth.
Response format:
{
"streams": [{ "url": "...", "title": "file.mkv", "name": "AltMount" }],
"_queue_item_id": 123,
"_queue_status": "completed"
}
Parameters (multipart form):
- file: .nzb file (required)
- download_key: SHA256 of API key (required)
- base_url: server base URL for stream URLs (optional, auto-detected)
- category: NZB category (optional)
- timeout: processing timeout in seconds (optional, default 300)
https://claude.ai/code/session_01NBXpeHpXVJAU3VRy5qw6ZS
The Name field in the Stremio stream response now uses the uploaded NZB filename (without extension) instead of the hardcoded "AltMount" string. https://claude.ai/code/session_01NBXpeHpXVJAU3VRy5qw6ZS
Before saving and queuing an NZB, check the queue for an existing entry with the same filename: - Completed with storage path → return cached stream URLs immediately - Active (pending/processing/paused) → attach to the existing item and poll it, avoiding a duplicate queue entry Polling logic is extracted into pollAndRespond() to be shared by both the normal and the active-join paths. https://claude.ai/code/session_01NBXpeHpXVJAU3VRy5qw6ZS
New field: api.stremio_nzb_ttl_hours (default: 24). Controls how long a completed NZB result returned by POST /api/nzb/stremio-streams is considered valid. When the same NZB filename is uploaded again and the previous completion is within the TTL window, the cached stream URLs are returned immediately without re-processing. Set to 0 to disable expiry and cache results forever. https://claude.ai/code/session_01NBXpeHpXVJAU3VRy5qw6ZS
javi11
marked this pull request as draft
February 27, 2026 23:17
…riven completion
- Move Stremio config out of APIConfig into a new StremioConfig section
(enabled: false by default, nzb_ttl_hours: 24)
- POST /api/nzb/stremio-streams renamed to POST /api/nzb/streams
- Handler gates on Stremio.Enabled; returns 404 when disabled
- Replace the 2-second poll loop with broadcaster subscription:
- Add Status field and NotifyComplete() to ProgressBroadcaster
- Importer service calls NotifyComplete("completed"/"failed") on terminal states
- waitAndRespond() subscribes once and selects on the channel + timeout timer
- Add "stremio" to the config PATCH section switch
- Frontend: add StremioConfig interface, StremioConfigSection component,
wire into ConfigurationPage under the Automation group
https://claude.ai/code/session_01NBXpeHpXVJAU3VRy5qw6ZS
Add a dedicated Stremio integration guide covering the POST /api/nzb/streams endpoint, download_key derivation, configuration options (stremio.enabled, nzb_ttl_hours), response format, caching behaviour, and a full curl example. Also update the intro page (feature bullet + Next Steps link) and the API endpoints table to surface the new Stremio category. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
javi11
marked this pull request as ready for review
March 3, 2026 16:48
yoshitaka420
pushed a commit
to yoshitaka420/altmount
that referenced
this pull request
Jun 1, 2026
…#372) * add POST /api/nzb/stremio-streams endpoint New public endpoint that accepts an NZB file upload, processes it synchronously through the high-priority import queue, and returns Stremio-compatible stream URLs for all media files in the NZB output. Authentication is via download_key (SHA256 of user API key), matching the existing stream handler auth model so Stremio addons can be pre-configured without browser-based JWT auth. Response format: { "streams": [{ "url": "...", "title": "file.mkv", "name": "AltMount" }], "_queue_item_id": 123, "_queue_status": "completed" } Parameters (multipart form): - file: .nzb file (required) - download_key: SHA256 of API key (required) - base_url: server base URL for stream URLs (optional, auto-detected) - category: NZB category (optional) - timeout: processing timeout in seconds (optional, default 300)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New public endpoint that accepts an NZB file upload, processes it
synchronously through the high-priority import queue, and returns
Stremio-compatible stream URLs for all media files in the NZB output.
Authentication is via download_key (SHA256 of user API key), matching
the existing stream handler auth model so Stremio addons can be
pre-configured without browser-based JWT auth.
Response format:
{
"streams": [{ "url": "...", "title": "file.mkv", "name": "filename" }],
"_queue_item_id": 123,
"_queue_status": "completed"
}
Parameters (multipart form):