[Skip to content](https://github.com/peterdsp/Magnetio#start-of-content)

You signed in with another tab or window. [Reload](https://github.com/peterdsp/Magnetio) to refresh your session.You signed out in another tab or window. [Reload](https://github.com/peterdsp/Magnetio) to refresh your session.You switched accounts on another tab or window. [Reload](https://github.com/peterdsp/Magnetio) to refresh your session.Dismiss alert

{{ message }}

[peterdsp](https://github.com/peterdsp)/ **[Magnetio](https://github.com/peterdsp/Magnetio)** Public

- [Notifications](https://github.com/login?return_to=%2Fpeterdsp%2FMagnetio) You must be signed in to change notification settings
- [Fork\\
3](https://github.com/login?return_to=%2Fpeterdsp%2FMagnetio)
- [Star\\
19](https://github.com/login?return_to=%2Fpeterdsp%2FMagnetio)


main

[**1** Branch](https://github.com/peterdsp/Magnetio/branches) [**6** Tags](https://github.com/peterdsp/Magnetio/tags)

[Go to Branches page](https://github.com/peterdsp/Magnetio/branches)[Go to Tags page](https://github.com/peterdsp/Magnetio/tags)

Go to file

Code

Open more actions menu

## Folders and files

| Name | Name | Last commit message | Last commit date |
| --- | --- | --- | --- |
| ## Latest commit<br>[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4&size=40)](https://github.com/apps/dependabot)[dependabot\[bot\]](https://github.com/peterdsp/Magnetio/commits?author=dependabot%5Bbot%5D)<br>[Bump redis from 6.0.1 to 6.1.0 in /addon in the addon-minor-patch gro…](https://github.com/peterdsp/Magnetio/commit/3300bf1c96c1fc49207e45e234d8d7389eedfc53)<br>Open commit details<br>2 days agoJul 2, 2026<br>[3300bf1](https://github.com/peterdsp/Magnetio/commit/3300bf1c96c1fc49207e45e234d8d7389eedfc53) · 2 days agoJul 2, 2026<br>## History<br>[74 Commits](https://github.com/peterdsp/Magnetio/commits/main/) <br>Open commit details<br>[View commit history for this file.](https://github.com/peterdsp/Magnetio/commits/main/) 74 Commits |
| [.github](https://github.com/peterdsp/Magnetio/tree/main/.github ".github") | [.github](https://github.com/peterdsp/Magnetio/tree/main/.github ".github") | [Bump actions/checkout from 6 to 7 in the actions group (](https://github.com/peterdsp/Magnetio/commit/e92dda5c3eb1a42ea1d77c0ff987eb862046e61a "Bump actions/checkout from 6 to 7 in the actions group (#94)  Bumps the actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).   Updates `actions/checkout` from 6 to 7 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7)  --- updated-dependencies: - dependency-name: actions/checkout   dependency-version: '7'   dependency-type: direct:production   update-type: version-update:semver-major   dependency-group: actions ...  Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>") [#94](https://github.com/peterdsp/Magnetio/pull/94) [)](https://github.com/peterdsp/Magnetio/commit/e92dda5c3eb1a42ea1d77c0ff987eb862046e61a "Bump actions/checkout from 6 to 7 in the actions group (#94)  Bumps the actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).   Updates `actions/checkout` from 6 to 7 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7)  --- updated-dependencies: - dependency-name: actions/checkout   dependency-version: '7'   dependency-type: direct:production   update-type: version-update:semver-major   dependency-group: actions ...  Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>") | last weekJun 25, 2026 |
| [README\_assets](https://github.com/peterdsp/Magnetio/tree/main/README_assets "README_assets") | [README\_assets](https://github.com/peterdsp/Magnetio/tree/main/README_assets "README_assets") | [Apply Magnetio SVG branding across addon and README](https://github.com/peterdsp/Magnetio/commit/bd14408e080c92a29eb636ef05ede90be294952f "Apply Magnetio SVG branding across addon and README  Use the self-hosted Magnetio SVG assets for the addon manifest, landing page logo, favicon, social image tags, and README header so Stremio, the site, and the repo all share the same branding.") | last monthJun 4, 2026 |
| [addon](https://github.com/peterdsp/Magnetio/tree/main/addon "addon") | [addon](https://github.com/peterdsp/Magnetio/tree/main/addon "addon") | [Bump redis from 6.0.1 to 6.1.0 in /addon in the addon-minor-patch gro…](https://github.com/peterdsp/Magnetio/commit/3300bf1c96c1fc49207e45e234d8d7389eedfc53 "Bump redis from 6.0.1 to 6.1.0 in /addon in the addon-minor-patch group (#97)  Bumps the addon-minor-patch group in /addon with 1 update: [redis](https://github.com/redis/node-redis).   Updates `redis` from 6.0.1 to 6.1.0 - [Release notes](https://github.com/redis/node-redis/releases) - [Changelog](https://github.com/redis/node-redis/blob/master/CHANGELOG.md) - [Commits](https://github.com/redis/node-redis/compare/redis@6.0.1...redis@6.1.0)  --- updated-dependencies: - dependency-name: redis   dependency-version: 6.1.0   dependency-type: direct:production   update-type: version-update:semver-minor   dependency-group: addon-minor-patch ...  Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>") | 2 days agoJul 2, 2026 |
| [scraper](https://github.com/peterdsp/Magnetio/tree/main/scraper "scraper") | [scraper](https://github.com/peterdsp/Magnetio/tree/main/scraper "scraper") | [Bump the scraper-minor-patch group across 1 directory with 2 updates (](https://github.com/peterdsp/Magnetio/commit/c5dfb24bb5a51e9ffb99bda9eeba0f25825176e7 "Bump the scraper-minor-patch group across 1 directory with 2 updates (#95)  Bumps the scraper-minor-patch group with 2 updates in the /scraper directory: [axios](https://github.com/axios/axios) and [node-cron](https://github.com/node-cron/node-cron).   Updates `axios` from 1.18.0 to 1.18.1 - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v1.18.0...v1.18.1)  Updates `node-cron` from 4.4.1 to 4.5.0 - [Release notes](https://github.com/node-cron/node-cron/releases) - [Changelog](https://github.com/node-cron/node-cron/blob/main/CHANGELOG.md) - [Commits](https://github.com/node-cron/node-cron/compare/v4.4.1...v4.5.0)  --- updated-dependencies: - dependency-name: axios   dependency-version: 1.18.1   dependency-type: direct:production   update-type: version-update:semver-patch   dependency-group: scraper-minor-patch - dependency-name: node-cron   dependency-version: 4.5.0   dependency-type: direct:production   update-type: version-update:semver-minor   dependency-group: scraper-minor-patch ...  Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>") [#…](https://github.com/peterdsp/Magnetio/pull/95) | last weekJun 25, 2026 |
| [site](https://github.com/peterdsp/Magnetio/tree/main/site "site") | [site](https://github.com/peterdsp/Magnetio/tree/main/site "site") | [Apply Magnetio SVG branding across addon and README](https://github.com/peterdsp/Magnetio/commit/bd14408e080c92a29eb636ef05ede90be294952f "Apply Magnetio SVG branding across addon and README  Use the self-hosted Magnetio SVG assets for the addon manifest, landing page logo, favicon, social image tags, and README header so Stremio, the site, and the repo all share the same branding.") | last monthJun 4, 2026 |
| [.env.example](https://github.com/peterdsp/Magnetio/blob/main/.env.example ".env.example") | [.env.example](https://github.com/peterdsp/Magnetio/blob/main/.env.example ".env.example") | [Add Torznab, Jackett, Prowlarr, TMDB recommendations, and marketing r…](https://github.com/peterdsp/Magnetio/commit/b00700b48713ed88978d8faf86ec852acdeab039 "Add Torznab, Jackett, Prowlarr, TMDB recommendations, and marketing redesign (#40)  * Add Torznab provider and optional Jackett/Prowlarr containers  Add a Torznab scraper provider that queries any Torznab-compatible endpoint (Jackett, Prowlarr, or standalone). Users configure the Torznab URL and API key in the configure page; the provider is conditionally active only when a URL is set.  Add Jackett and Prowlarr as optional Docker Compose services using profiles. Start them with --profile jackett or --profile prowlarr.   * Fix Torznab URL input missing dark background styling  Wrap the Torznab URL input in a password-wrap div to match the styling of all other input fields on the configure page.   * Redesign configure page with split layout and editorial typography  Inspired by Figma community design #45. Split layout with sticky hero panel (Bitter serif headings, Space Mono body, numbered feature callouts) and scrollable form panel. Warm peach accent (#ffcfaa) replacing the previous green. Pill-shaped buttons, responsive mobile layout with collapsible hero.   * Remove broken logo image from hero panel   * Update README with Torznab, Jackett, and Prowlarr documentation  Add Torznab provider to the provider tables, document Jackett and Prowlarr as optional Docker Compose services with profiles, add torznabUrl/torznabKey to the configuration parameters table, and update Quick Start with profile commands.   * Forward client IP to Real-Debrid API calls  Use AsyncLocalStorage to capture the Stremio client IP from the Express request and pass it as the `ip` parameter on every RD POST call (addMagnet, selectFiles, unrestrict/link). This lets RD associate the unrestricted download with the end user device instead of the server, preventing IP mismatch errors when streaming outside the home network.   * Restyle hero panel with Figma-inspired editorial layout  Update the configure page hero panel with mixed serif/italic headline typography, a 2x2 glassmorphic stats grid with real feature counts, and refined spacing. Keeps all form functionality intact.   * Add similar content recommendations via TMDB API  When a TMDB API key is configured, Magnetio shows a \"Similar\" catalog for every movie and series in Stremio. Recommendations are fetched from TMDB, enriched with IMDb IDs, and cached for 24 hours.  New files: addon/lib/similar.js (TMDB recommendation engine) Modified: manifest.js (register similar catalogs), addon.js (route catalog handler), configuration.js (parse tmdb key), landingTemplate.js (add Recommendations section with TMDB API key field).   * Redesign landing page as full marketing showcase  Dark cinematic theme with gradient accents, glass-morphism cards, and animated floating orbs. Full page sections: hero with gradient headline, stats bar (22+ providers, 8 debrid, 500+ indexers), 6-card feature grid, how-it-works flow, configure form, install bar, and footer. All form IDs and JS logic preserved.   * Add SEO meta tags, structured data, sitemap, and robots.txt  Add comprehensive SEO to the landing page: title tag with keywords, meta description, Open Graph tags, Twitter Card, JSON-LD structured data (SoftwareApplication schema), canonical URL.  Add /robots.txt and /sitemap.xml endpoints to serverless.js.  Update GitHub repo: description, homepage URL, and 20 topic tags covering all key search terms (stremio, debrid, jackett, prowlarr, torznab, self-hosted, etc.).  Update README with additional badges and links to magnetio.peterdsp.dev.   * Address Copilot review: security, caching, encoding, and docs  - Include torznab API key hash in cache keys (scraper + addon) - Validate torznab URL scheme (http/https only) to reduce SSRF risk - Redact full URL from logs, show only origin - Coerce NaN to 0 for parsed numeric torznab fields - Wrap decodeURIComponent in try/catch for malformed encoding - URL-encode torznabKey in config string builder - Use TorrentProvider.TORZNAB constant instead of hardcoded string - Update scrapeAll JSDoc for context parameter") | last monthJun 1, 2026 |
| [.gitignore](https://github.com/peterdsp/Magnetio/blob/main/.gitignore ".gitignore") | [.gitignore](https://github.com/peterdsp/Magnetio/blob/main/.gitignore ".gitignore") | [Ignore macOS .DS\_Store files](https://github.com/peterdsp/Magnetio/commit/aad0cd69548174aaae8354a3a1154114729c6474 "Ignore macOS .DS_Store files  Add .DS_Store and a recursive **/.DS_Store pattern to .gitignore to prevent committing macOS metadata files. Also include a small formatting/spacing addition for clarity.") | 4 months agoMar 14, 2026 |
| [ADDON\_DOCS.md](https://github.com/peterdsp/Magnetio/blob/main/ADDON_DOCS.md "ADDON_DOCS.md") | [ADDON\_DOCS.md](https://github.com/peterdsp/Magnetio/blob/main/ADDON_DOCS.md "ADDON_DOCS.md") | [Add addon documentation for Stremio community catalog submission (](https://github.com/peterdsp/Magnetio/commit/ff6501c1ca22aa12c0c59f7face80ea7645c976f "Add addon documentation for Stremio community catalog submission (#44)  Structured documentation with feature sections, debrid service table, quick start guide, and configuration instructions.") [#44](https://github.com/peterdsp/Magnetio/pull/44) [)](https://github.com/peterdsp/Magnetio/commit/ff6501c1ca22aa12c0c59f7face80ea7645c976f "Add addon documentation for Stremio community catalog submission (#44)  Structured documentation with feature sections, debrid service table, quick start guide, and configuration instructions.") | last monthJun 1, 2026 |
| [LICENSE](https://github.com/peterdsp/Magnetio/blob/main/LICENSE "LICENSE") | [LICENSE](https://github.com/peterdsp/Magnetio/blob/main/LICENSE "LICENSE") | [Initial commit](https://github.com/peterdsp/Magnetio/commit/83120d5e0e81f356f2f0f7e18ab71432a5e71f50 "Initial commit") | 4 months agoMar 14, 2026 |
| [README.md](https://github.com/peterdsp/Magnetio/blob/main/README.md "README.md") | [README.md](https://github.com/peterdsp/Magnetio/blob/main/README.md "README.md") | [Fix scraper 429 rotation, add Debrid catalog toggle, document HTTPS/O…](https://github.com/peterdsp/Magnetio/commit/797dfb4886d061906069c51e344f4ec5ecaea99e "Fix scraper 429 rotation, add Debrid catalog toggle, document HTTPS/Oracle setup (#91)  * Scraper resilience, Debrid catalog toggle, HTTPS/Oracle deploy docs  Scraper (#65): - Rotate domains on HTTP 429 (previously bubbled up as an unhandled   status, never tried sibling domains) - Longer cooldown when a domain is rate-limited vs hard-failed - Bumped per-provider timeout from 15s to 25s; the hard scrape budget   is now provider+2s so per-provider timeouts can fire cleanly first - All windows tunable via SCRAPER_* env vars  Addon (#64): - New debridCatalogs config flag (default true); decouples \"Debrid key   set\" from \"Debrid cloud catalog enabled\" - Configure page exposes the toggle inside the Debrid Services card - Manifest skips Debrid catalogs when the flag is off  Docs (#63, #66): - README \"Exposing to the Internet\" rewritten with Caddy and Cloudflare   Tunnel snippets and a why-HTTPS-is-needed note - New \"Oracle Cloud / Free Tier VPS notes\" subsection covering VCN   security list + iptables rules  Generated with Claude Code  * Mention the hosted instance in the self-hosting section  Self-hosting is a choice, not a requirement. Call out magnetio.peterdsp.dev as the \"I just want it working\" path before diving into reverse proxies and Oracle VCN rules.  Generated with Claude Code") | 2 weeks agoJun 18, 2026 |
| [SECURITY.md](https://github.com/peterdsp/Magnetio/blob/main/SECURITY.md "SECURITY.md") | [SECURITY.md](https://github.com/peterdsp/Magnetio/blob/main/SECURITY.md "SECURITY.md") | [Use home directory deploy path (](https://github.com/peterdsp/Magnetio/commit/e8043882f7e83d44efb0100cb1620c3eb3aa4821 "Use home directory deploy path (#19)") [#19](https://github.com/peterdsp/Magnetio/pull/19) [)](https://github.com/peterdsp/Magnetio/commit/e8043882f7e83d44efb0100cb1620c3eb3aa4821 "Use home directory deploy path (#19)") | 2 months agoMay 28, 2026 |
| [docker-compose.yml](https://github.com/peterdsp/Magnetio/blob/main/docker-compose.yml "docker-compose.yml") | [docker-compose.yml](https://github.com/peterdsp/Magnetio/blob/main/docker-compose.yml "docker-compose.yml") | [Security hardening (](https://github.com/peterdsp/Magnetio/commit/530f2d9ad4147a7961cce404b7d5f86736e63a44 "Security hardening (#48)  - Block private IP ranges in Torznab URL validation (SSRF) - Upgrade axios to latest (CVE-2026-40175) - Add Redis authentication via REDIS_PASSWORD - Add global rate limiter (120 req/min per IP) - Protect /stats with basic auth (METRICS_USER/PASSWORD) - Remove debrid service names from logs (privacy) - Add security headers (X-Content-Type-Options, X-Frame-Options,   Referrer-Policy, Permissions-Policy) - Add /.well-known/security.txt") [#48](https://github.com/peterdsp/Magnetio/pull/48) [)](https://github.com/peterdsp/Magnetio/commit/530f2d9ad4147a7961cce404b7d5f86736e63a44 "Security hardening (#48)  - Block private IP ranges in Torznab URL validation (SSRF) - Upgrade axios to latest (CVE-2026-40175) - Add Redis authentication via REDIS_PASSWORD - Add global rate limiter (120 req/min per IP) - Protect /stats with basic auth (METRICS_USER/PASSWORD) - Remove debrid service names from logs (privacy) - Add security headers (X-Content-Type-Options, X-Frame-Options,   Referrer-Policy, Permissions-Policy) - Add /.well-known/security.txt") | last monthJun 1, 2026 |
| View all files |

## Repository files navigation

[![Magnetio logo](https://github.com/peterdsp/Magnetio/raw/main/README_assets/magnetio-logo.svg)](https://github.com/peterdsp/Magnetio/blob/main/README_assets/magnetio-logo.svg)

[![Magnetio](https://github.com/peterdsp/Magnetio/raw/main/README_assets/magnetio-wordmark.svg)](https://github.com/peterdsp/Magnetio/blob/main/README_assets/magnetio-wordmark.svg)

![Magnetio Version](https://camo.githubusercontent.com/6ad1c0d7f69f96ea45d2a0d8b379eb543216f9b0b3a1d98d8a9de5d7f3fd95eb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61676e6574696f2d76312e312e352d3130623938313f7374796c653d666f722d7468652d6261646765266c6162656c436f6c6f723d316131613265)![License](https://camo.githubusercontent.com/e023f8fa136e5ea54ee7ce4326726f9f6b1f7de5085d0ce955e57d5b3b04f830/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4170616368652d2d322e302d626c75653f7374796c653d666f722d7468652d6261646765266c6162656c436f6c6f723d316131613265)![Node.js](https://camo.githubusercontent.com/0c19da63416d8aa384f98d02fe9df3e86eb671077766af26c51ff3bc31de8f97/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6e6f64652d25334525334431382d627269676874677265656e3f7374796c653d666f722d7468652d6261646765266c6f676f3d6e6f64652e6a73266c6162656c436f6c6f723d316131613265)![Docker](https://camo.githubusercontent.com/0ead0bfcc7865be59b49253e8202f525927d722a49612942e0c42a170dcaddc8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f636b65722d72656164792d3234393665643f7374796c653d666f722d7468652d6261646765266c6f676f3d646f636b6572266c6162656c436f6c6f723d316131613265)![Stremio Addon](https://camo.githubusercontent.com/6803d72ff6863610ac63b85c9d2fe4fb2d4253daf284eebd6fb3104b05bdf115/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737472656d696f2d6164646f6e2d3762356266353f7374796c653d666f722d7468652d6261646765266c6162656c436f6c6f723d316131613265)![Debrid Services](https://camo.githubusercontent.com/dd33eb08f09cb48eeec10d5a7e98c1df842fd2211933d224c4d9a16cb471f17d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6465627269642d3825323073657276696365732d6666366236623f7374796c653d666f722d7468652d6261646765266c6162656c436f6c6f723d316131613265)![Torznab Jackett Prowlarr](https://camo.githubusercontent.com/fadeb73a40b1de952e5b8bfa2ea93462b0ae958f1311c27394bdf0d78158a4aa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f746f727a6e61622d4a61636b65747425323025324625323050726f776c6172722d6635613632333f7374796c653d666f722d7468652d6261646765266c6162656c436f6c6f723d316131613265)

**A fully self-hosted Stremio addon with 22+ torrent providers, 8 debrid services, Torznab/Jackett/Prowlarr integration, and TMDB recommendations.**

No external scraper dependency. No third-party backend. Your API keys never leave your server.

[magnetio.peterdsp.dev](https://magnetio.peterdsp.dev/) \| [Configure and Install](https://magnetio.peterdsp.dev/configure)

* * *

## What is Magnetio?

[Permalink: What is Magnetio?](https://github.com/peterdsp/Magnetio#what-is-magnetio)

Magnetio is an open-source, self-hostable **Stremio addon** that comes with its own **built-in torrent scraper**. It queries 22 torrent providers in parallel (including Torznab-compatible indexers via Jackett or Prowlarr), deduplicates results, and optionally resolves them into **instant direct-download streams** through your debrid service of choice.

Everything runs on your own hardware (a Raspberry Pi is enough). No cloud subscriptions, no external scraper APIs, no data leaving your network.

### Why Magnetio?

[Permalink: Why Magnetio?](https://github.com/peterdsp/Magnetio#why-magnetio)

|  | Magnetio | Typical Stremio addons |
| :-- | :-: | :-: |
| Fully in-house scraping | Yes | Depends on external APIs |
| Self-hosted, private | Yes | Often cloud-hosted |
| 22 torrent providers + Torznab | Yes | Varies |
| Jackett / Prowlarr support | Yes | Rare |
| 8 debrid services | Yes | 1-3 typically |
| Background prewarm | Yes | No |
| Per-user config (providers, quality, language) | Yes | Limited |
| Subtitle sync pipeline | Yes | No |
| Redis caching with stale-while-revalidate | Yes | Basic or none |
| Prometheus metrics | Yes | Rare |
| Docker Compose one-command deploy | Yes | Varies |

* * *

## How It Works

[Permalink: How It Works](https://github.com/peterdsp/Magnetio#how-it-works)

```
                          You open a movie in Stremio
                                     |
                                     v
                    +---------------------------------+
                    |     Magnetio Addon (:7000)      |
                    |  Receives stream/catalog/meta   |
                    |  request from Stremio client    |
                    +---------------------------------+
                                     |
                         Calls internal scraper
                                     |
                                     v
                    +---------------------------------+
                    |    Magnetio Scraper (:8080)     |
                    |  Queries up to 21 providers     |
                    |  in parallel (max 4 concurrent) |
                    |  22s timeout per provider       |
                    +---------------------------------+
                                     |
                    Deduplicates by infoHash (keeps
                    highest-seeder entry per hash)
                                     |
                    Content-filters results against
                    the actual requested title/season
                                     |
                                     v
                    +---------------------------------+
                    |     Back to Addon               |
                    |  Applies quality/language/size   |
                    |  filters from user config       |
                    |  Sorts by chosen strategy       |
                    +---------------------------------+
                                     |
                          If debrid keys present:
                      check instant availability
                      on each configured service
                                     |
                          +---------+---------+
                          |                   |
                       Cached              Not cached
                     Resolve to           Keep as P2P
                     direct HTTP          magnet fallback
                     stream URL           (or prewarm it)
                          |                   |
                          +---------+---------+
                                     |
                                     v
                       Return sorted stream list
                       to Stremio for playback
```

When a torrent is already cached on your debrid service, Stremio plays it as a direct HTTP stream at full speed. No buffering, no seeding wait, no port forwarding.

* * *

## Supported Torrent Providers

[Permalink: Supported Torrent Providers](https://github.com/peterdsp/Magnetio#supported-torrent-providers)

Magnetio ships with **22 providers** covering movies, TV series, and anime, plus Torznab support for connecting external indexer managers.

### Movies and TV

[Permalink: Movies and TV](https://github.com/peterdsp/Magnetio#movies-and-tv)

| Provider | ID | Content | Method |
| :-- | :-- | :-- | :-- |
| YTS | `yts` | Movies only | JSON API |
| EZTV | `eztv` | Series only | JSON API |
| The Pirate Bay | `thepiratebay` | Movies, Series | JSON API (apibay.org) |
| TorrentGalaxy | `torrentgalaxy` | Movies, Series | HTML scraper |
| 1337x | `leetx` | Movies, Series | HTML scraper (detail pages) |
| KickassTorrents | `kickasstorrents` | Movies, Series | HTML scraper |
| LimeTorrents | `limetorrents` | Movies, Series | HTML scraper |
| Bitsearch | `bitsearch` | Movies, Series | HTML scraper |
| BT4G | `bt4g` | Movies, Series | HTML scraper |
| BTDig | `btdig` | Movies, Series | HTML scraper |
| GloTorrents | `glotorrents` | Movies, Series | HTML scraper |
| TorLock | `torlock` | Movies, Series | HTML scraper |
| TorrentDownloads | `torrentdownloads` | Movies, Series | HTML scraper |
| TheRarBG | `therarbg` | Movies, Series | HTML scraper (RARBG successor) |
| Rutor | `rutor` | Movies, Series | HTML scraper (Russian) |
| Rutracker | `rutracker` | Movies, Series | HTML scraper (Russian) |

### Anime

[Permalink: Anime](https://github.com/peterdsp/Magnetio#anime)

| Provider | ID | Method |
| :-- | :-- | :-- |
| Nyaa | `nyaa` | Atom RSS feed |
| AnimeSaturn | `animesaturn` | HTML scraper (Italian) |
| SubsPlease | `subsplease` | JSON API (fansubs) |
| AnimeTosho | `animetosho` | RSS feed (aggregator) |
| nekoBT | `nekobt` | Torznab API (fansubs) |

### Torznab / Jackett / Prowlarr

[Permalink: Torznab / Jackett / Prowlarr](https://github.com/peterdsp/Magnetio#torznab--jackett--prowlarr)

| Provider | ID | Method |
| :-- | :-- | :-- |
| Torznab | `torznab` | Torznab XML API (any compatible endpoint) |

The Torznab provider is a universal connector that works with any Torznab-compatible indexer manager. Configure the API URL and key on the configure page. Magnetio will search all indexers you have set up in your Jackett or Prowlarr instance.

- **[Jackett](https://github.com/Jackett/Jackett)** \- translates queries to 500+ tracker-specific requests. Free, open-source (MIT).
- **[Prowlarr](https://github.com/Prowlarr/Prowlarr)** \- newer indexer manager with tighter \*arr integration. Free, open-source (GPL-3.0).

Both are available as optional Docker Compose services (see [Quick Start](https://github.com/peterdsp/Magnetio#quick-start)).

All providers run in parallel with a concurrency limit of 4 and a 22-second timeout. Results are deduplicated by `infoHash`, keeping the entry with the highest seeder count.

* * *

## Debrid Services

[Permalink: Debrid Services](https://github.com/peterdsp/Magnetio#debrid-services)

Debrid services cache torrents server-side and serve them as direct HTTP links, giving you instant, full-speed streams with no seeding required.

| Service | Code | Cache Check | Catalog | Prewarm |
| :-- | :-: | :-: | :-: | :-: |
| [Real-Debrid](https://real-debrid.com/) | `RD` | Yes | Yes | Yes |
| [Premiumize](https://premiumize.me/) | `PM` | Yes | Yes | No |
| [AllDebrid](https://alldebrid.com/) | `AD` | Yes | No | Yes |
| [DebridLink](https://debrid-link.com/) | `DL` | No | Yes | Yes |
| [EasyDebrid](https://easydebrid.com/) | `ED` | Yes | No | No |
| [Offcloud](https://offcloud.com/) | `OC` | No | No | Yes |
| [TorBox](https://torbox.app/) | `TB` | Yes | Yes | Yes |
| [Put.io](https://put.io/) | `PU` | No | Yes | Yes |

You can configure multiple debrid services simultaneously. Each one is checked independently for cached content.

* * *

## Quick Start

[Permalink: Quick Start](https://github.com/peterdsp/Magnetio#quick-start)

### Docker Compose (recommended)

[Permalink: Docker Compose (recommended)](https://github.com/peterdsp/Magnetio#docker-compose-recommended)

```
git clone https://github.com/peterdsp/Magnetio.git
cd Magnetio

# Start all three services (scraper + addon + redis)
docker compose up -d

# Optional: include Jackett for 500+ additional indexers
docker compose --profile jackett up -d

# Optional: include Prowlarr instead (or alongside)
docker compose --profile prowlarr up -d

# Open in browser
open http://localhost:7000
```

That is it. The addon runs on port 7000, the scraper on 8080, and Redis on 6379. Jackett runs on 9117 and Prowlarr on 9696 (both optional). All services share a Docker bridge network.

### Node.js (manual, two terminals)

[Permalink: Node.js (manual, two terminals)](https://github.com/peterdsp/Magnetio#nodejs-manual-two-terminals)

**Terminal 1 (Scraper):**

```
cd scraper
npm install
cp .env.example .env    # edit if needed
node index.js            # listens on :8080
```

**Terminal 2 (Addon):**

```
cd addon
npm install
cp .env.example .env    # set SCRAPER_URL=http://localhost:8080
node index.js            # listens on :7000
```

Open `http://localhost:7000` to access the configuration page.

* * *

## Configuration

[Permalink: Configuration](https://github.com/peterdsp/Magnetio#configuration)

### Visual Configuration Page

[Permalink: Visual Configuration Page](https://github.com/peterdsp/Magnetio#visual-configuration-page)

Navigate to `http://your-server:7000` in a browser. The configuration page lets you:

1. **Set quality filters** (4K, 1080p, 720p, 480p, CAM)
2. **Set language preferences** for streams and subtitles
3. **Connect Torznab indexers** (Jackett, Prowlarr, or any Torznab endpoint)
4. **Enter debrid API keys** (with show/hide toggle)
5. **Configure sort order and result limits**
6. **Enable or disable background prewarm**
7. **Copy the manifest URL** or click **Install in Stremio**

The generated URL encodes your preferences in a pipe-delimited config string that becomes part of the manifest path. No server-side storage of user settings.

### Manual URL Format

[Permalink: Manual URL Format](https://github.com/peterdsp/Magnetio#manual-url-format)

```
https://your-server:7000/providers=yts,eztv,1337x|sort=qualityseeders|limit=10|RD=YOUR_KEY/manifest.json
```

### All Configuration Parameters

[Permalink: All Configuration Parameters](https://github.com/peterdsp/Magnetio#all-configuration-parameters)

| Parameter | Values | Default | Description |
| :-- | :-- | :-- | :-- |
| `providers` | Comma-separated provider IDs | All 21 | Which torrent providers to query |
| `sort` | `qualityseeders`, `qualitysize`, `seeders`, `size` | `qualityseeders` | How to rank streams |
| `limit` | `1` to `50` | `10` | Max streams returned per request |
| `qualities` | `4k`, `1080p`, `720p`, `480p`, `cam` | All | Quality whitelist |
| `languages` | ISO codes (`en`, `es`, `pt`, `fr`, `de`, `it`, `ja`, `ru`, ...) | All | Stream language filter |
| `subtitleLanguages` | ISO codes | `en` | Subtitle language preference |
| `torznabUrl` | Full Torznab API URL | - | Torznab endpoint (Jackett/Prowlarr) |
| `torznabKey` | API key | - | Torznab API key |
| `prewarm` | `1`, `0`, `true`, `false` | `1` | Background-add top uncached torrents to debrid |
| `prewarmLimit` | `0` to `10` | `3` | How many uncached results to prewarm per service |
| `debridCatalogs` | `1`, `0`, `true`, `false` | `1` | Expose debrid cloud catalogs (Movies/Series) when a key is set |
| `excludeSizes` | Size thresholds like `1GB,2GB` | None | Exclude streams below these sizes |
| `maxSize` | Bytes | None | Maximum file size |
| `RD` | API key | - | Real-Debrid |
| `PM` | API key | - | Premiumize |
| `AD` | API key | - | AllDebrid |
| `DL` | API key | - | DebridLink |
| `ED` | API key | - | EasyDebrid |
| `OC` | API key | - | Offcloud |
| `TB` | API key | - | TorBox |
| `PU` | API key | - | Put.io |

### Presets

[Permalink: Presets](https://github.com/peterdsp/Magnetio#presets)

Quick-start configurations for common use cases:

| Preset | What it does |
| :-- | :-- |
| `lite` | English-only, no CAM/screener, 3 providers, limit 5 |
| `brazuca` | Portuguese-focused, 4 providers, limit 10 |

Use a preset: `https://your-server:7000/lite/manifest.json`

* * *

## Architecture

[Permalink: Architecture](https://github.com/peterdsp/Magnetio#architecture)

Magnetio is a three-service stack, each with a clear responsibility:

```
magnetio/
|
|   docker-compose.yml             # Orchestrates all three services
|
+-- scraper/                       # Torrent scraper backend
|   |   index.js                   # Express server (:8080)
|   |   package.json
|   +-- lib/
|   |   |   cache.js               # Redis/in-memory cache (Keyv)
|   |   |   catalog.js             # Cinemeta top-content fetcher for prewarm
|   |   |   cinemeta.js            # IMDb ID to title/year/season/episode resolver
|   |   |   cron.js                # Scheduled prewarm job (node-cron)
|   |   |   httpClient.js          # Throttled Axios client with retries (Bottleneck)
|   |   |   logger.js              # Winston structured logging
|   |   |   magnetHelper.js        # Shared infoHash extraction, base32, size parsing
|   |   |   prewarm.js             # Prewarm orchestrator (scrapes top content into cache)
|   |   +-- titleHelper.js         # Quality/codec/source/language/HDR parser
|   +-- providers/
|       |   index.js               # Parallel aggregator, deduplication, content filter
|       |   yts.js                 # ...21 built-in provider modules
|       |   torznab.js             # Universal Torznab provider (Jackett/Prowlarr)
|       +-- ...
|
+-- addon/                         # Stremio addon frontend
|   |   index.js                   # Express server (:7000) + Prometheus metrics
|   |   serverless.js              # Stremio SDK router + configure + subtitle proxy
|   |   addon.js                   # Stremio resource handlers (stream/catalog/meta/subtitles)
|   |   package.json
|   +-- lib/
|   |   |   manifest.js            # Dynamic Stremio manifest generation
|   |   |   configuration.js       # Config URL parser + presets
|   |   |   repository.js          # HTTP client to call the scraper service
|   |   |   sort.js                # Quality-tiered stream sorting
|   |   |   filter.js              # Quality/language/size stream filtering
|   |   |   streamInfo.js          # Torrent record to Stremio stream object mapper
|   |   |   subtitles.js           # OpenSubtitles search integration
|   |   |   subtitleProxy.js       # Subtitle download + sync pipeline
|   |   |   cache.js               # Redis/in-memory cache (Keyv)
|   |   |   languages.js           # Language codes, names, flag emojis
|   |   |   magnetHelper.js        # Best-tracker list + magnet URI builder
|   |   |   namedQueue.js          # Request deduplication (prevents duplicate in-flight)
|   |   |   landingTemplate.js     # HTML/CSS/JS for the visual config page
|   |   |   types.js               # Shared enums and type definitions
|   |   +-- logger.js              # Winston structured logging
|   +-- moch/                      # Debrid service integrations
|       |   moch.js                # Debrid orchestrator (cache check + resolve)
|       |   mochHelper.js          # Shared utils, per-key blacklisting
|       |   options.js             # Debrid service registry
|       |   static.js              # Static stream injections
|       |   realdebrid.js          # Real-Debrid API client
|       |   premiumize.js          # Premiumize API client
|       |   alldebrid.js           # AllDebrid API client
|       |   debridlink.js          # DebridLink API client
|       |   easydebrid.js          # EasyDebrid API client
|       |   offcloud.js            # Offcloud API client
|       |   torbox.js              # TorBox API client
|       +-- putio.js               # Put.io API client
|
+-- .github/workflows/
    +-- deploy.yml                 # CI/CD: validate, test, deploy via GitHub Actions
```

### Service Communication

[Permalink: Service Communication](https://github.com/peterdsp/Magnetio#service-communication)

```
+------------------+         +-------------------+         +--------+
|  Stremio Client  | ------> |  Addon (:7000)    | ------> | Redis  |
|  (your TV/phone) |  HTTP   |  stream/catalog   |  cache  | (:6379)|
+------------------+         |  debrid resolve   | <------ +--------+
                              +--------+----------+              ^
                                       |                         |
                                       | HTTP :8080              |
                                       v                         |
                              +-------------------+              |
                              | Scraper (:8080)   | ------------>+
                              | provider queries  |    cache
                              | dedup + filter    |
                              +-------------------+
```

* * *

## API Reference

[Permalink: API Reference](https://github.com/peterdsp/Magnetio#api-reference)

### Addon Endpoints (`:7000`)

[Permalink: Addon Endpoints (:7000)](https://github.com/peterdsp/Magnetio#addon-endpoints-7000)

| Method | Path | Description |
| :-- | :-- | :-- |
| `GET` | `/` | Visual configuration page |
| `GET` | `/configure` | Stremio configuration endpoint |
| `GET` | `/manifest.json` | Root addon manifest (default config) |
| `GET` | `/:config/manifest.json` | User-configured addon manifest |
| `GET` | `/:config/stream/:type/:id.json` | Stream results for a title |
| `GET` | `/:config/catalog/:type/:id.json` | Debrid catalog (library browsing) |
| `GET` | `/:config/meta/:type/:id.json` | Title metadata |
| `GET` | `/:config/subtitles/:type/:id.json` | Subtitle results |
| `GET` | `/proxy/subtitle/:id.srt` | Subtitle proxy with optional sync |
| `GET` | `/health` | Health check (`{ status: "ok" }`) |
| `GET` | `/stats` | Analytics dashboard (request counts, unique users) |
| `GET` | `/swagger` | Prometheus metrics UI (auth required) |

### Scraper Endpoints (`:8080`)

[Permalink: Scraper Endpoints (:8080)](https://github.com/peterdsp/Magnetio#scraper-endpoints-8080)

| Method | Path | Description |
| :-- | :-- | :-- |
| `GET` | `/health` | Health check |
| `GET` | `/providers` | List all available provider IDs and names |
| `GET` | `/streams/:type/:id` | Scrape all providers for a title |
| `GET` | `/streams/:type/:id?providers=yts,eztv` | Scrape specific providers only |
| `POST` | `/prewarm` | Manually trigger cache prewarm |
| `GET` | `/prewarm/status` | Check prewarm job status |

### Stream Record Shape

[Permalink: Stream Record Shape](https://github.com/peterdsp/Magnetio#stream-record-shape)

Each torrent result from the scraper follows this structure:

```
{
  "infoHash":  "a1b2c3d4e5f6...",
  "title":     "Movie.Name.2024.1080p.BluRay.x264-GROUP",
  "seeders":   248,
  "leechers":  12,
  "size":      8589934592,
  "provider":  "1337x",
  "quality":   "1080p",
  "codec":     "AVC",
  "source":    "BluRay",
  "languages": ["en"],
  "hdr":       null,
  "imdbId":    "tt1234567"
}
```

* * *

## Caching Strategy

[Permalink: Caching Strategy](https://github.com/peterdsp/Magnetio#caching-strategy)

Both services use **Keyv** backed by Redis (falls back to in-memory if Redis is unavailable).

| What | TTL | Notes |
| :-- | :-- | :-- |
| Scraper stream results | 1 hour | Per title, deduplicated |
| Addon stream responses | 1 hour | Stale-while-revalidate: 1h, stale-on-error: 4h |
| Empty results | Never cached | Prevents cache poisoning from transient failures |
| Prewarm scraper cache | 4 hours | Pre-populated by scheduled job |
| Debrid prewarm flags | 6 hours | Prevents re-adding already-prewarmed torrents |
| Addon router instances | 5 min | LRU with max 64 entries |
| Subtitle proxy cache | 1 hour | Per stream-specific subtitle |

* * *

## Special Features

[Permalink: Special Features](https://github.com/peterdsp/Magnetio#special-features)

### Background Prewarm

[Permalink: Background Prewarm](https://github.com/peterdsp/Magnetio#background-prewarm)

Magnetio can proactively warm the cache and your debrid accounts:

- **Scraper prewarm**: A cron job (default: daily at 4 AM) fetches the top 50 movies and 20 series from Cinemeta, scrapes all providers for each, and stores results in Redis. When a user later requests one of these titles, the response is instant.
- **Debrid prewarm**: After filtering and sorting streams for a user request, Magnetio background-adds the top uncached torrents (configurable, default 3) to your debrid account. This is non-blocking. By the time you click play, the torrent may already be downloading or fully cached.

### Subtitle Sync Pipeline

[Permalink: Subtitle Sync Pipeline](https://github.com/peterdsp/Magnetio#subtitle-sync-pipeline)

For debrid/direct HTTP streams, Magnetio can serve stream-specific subtitles:

1. Fingerprints the media file (filename, size, OpenSubtitles hash via byte-range)
2. Searches OpenSubtitles for the best match
3. Downloads the subtitle
4. Optionally runs `ffsubsync` (audio-based alignment) or `alass` (split/framerate correction)
5. Caches and serves the corrected `.srt`

This works reliably for debrid streams where the addon has access to the final HTTP URL.

### Content Filtering

[Permalink: Content Filtering](https://github.com/peterdsp/Magnetio#content-filtering)

The scraper validates that returned torrents actually match the requested content:

- For movies: title must contain at least part of the movie name
- For series: title must contain a matching season/episode marker (S01E02, 1x02, "Season 1", etc.)
- Word matching with a 50% threshold for multi-word titles
- Prevents unrelated results from polluting the stream list

### Analytics

[Permalink: Analytics](https://github.com/peterdsp/Magnetio#analytics)

Redis-backed, best-effort usage tracking:

- Daily request counts and per-type breakdowns (stream, catalog, subtitle, page views)
- Unique users via HyperLogLog (privacy-preserving, no PII stored)
- 7-day rolling history
- Available at `/stats`

### Request Deduplication

[Permalink: Request Deduplication](https://github.com/peterdsp/Magnetio#request-deduplication)

A `NamedQueue` system prevents duplicate in-flight requests. If 10 users request the same movie at the same instant, the scraper runs once and all 10 get the same result.

* * *

## Deployment

[Permalink: Deployment](https://github.com/peterdsp/Magnetio#deployment)

### Production with Docker Compose

[Permalink: Production with Docker Compose](https://github.com/peterdsp/Magnetio#production-with-docker-compose)

```
# Clone and configure
git clone https://github.com/peterdsp/Magnetio.git
cd Magnetio
cp .env.example .env

# Edit .env with your settings (at minimum):
# ADDON_PUBLIC_URL=https://your-domain.com
# METRICS_PASSWORD=your-secure-password

# Launch
docker compose up -d
```

### GitHub Actions CI/CD

[Permalink: GitHub Actions CI/CD](https://github.com/peterdsp/Magnetio#github-actions-cicd)

The included workflow (`.github/workflows/deploy.yml`) handles automated deployment:

1. **Validate**: `npm ci` \+ `npm test` on Node 22
2. **Deploy**: `rsync` to your server, preserving `.env` files
3. **Build**: `docker compose up -d --build --remove-orphans` on the target
4. **Health check**: Optional ping to your `/health` endpoint

The workflow runs on a self-hosted GitHub Actions runner. Push to `main` triggers automatic deployment.

### Exposing to the Internet

[Permalink: Exposing to the Internet](https://github.com/peterdsp/Magnetio#exposing-to-the-internet)

> **Don't want to self-host?** There's a public hosted instance at [magnetio.peterdsp.dev](https://magnetio.peterdsp.dev/) (configure and install at [magnetio.peterdsp.dev/configure](https://magnetio.peterdsp.dev/configure)). Your Debrid keys still stay between your browser and your Debrid provider, the manifest URL just points at the hosted addon. The rest of this section is only relevant if you're running your own instance on a VPS or home server.

Stremio's clients (web, desktop, mobile) refuse to install an addon over plain `http://`. This is a Stremio-side restriction, not something the addon can opt out of. If you can hit the configure page on `http://YOUR_IP:7000/configure` but Stremio fails to install, HTTPS is almost always the reason.

The fix is to put any HTTPS-terminating reverse proxy in front of the addon. The `ADDON_PUBLIC_URL` env var controls the base URL that appears inside manifests; the landing page uses `location.origin` so it picks up your public domain automatically when accessed through the proxy.

#### Caddy (recommended, auto Let's Encrypt)

[Permalink: Caddy (recommended, auto Let's Encrypt)](https://github.com/peterdsp/Magnetio#caddy-recommended-auto-lets-encrypt)

```
magnetio.example.com {
  reverse_proxy localhost:7000
}
```

Caddy handles the certificate, the renewals, and HTTP-to-HTTPS redirect by itself. One file, restart, done.

#### Cloudflare Tunnel (no open ports)

[Permalink: Cloudflare Tunnel (no open ports)](https://github.com/peterdsp/Magnetio#cloudflare-tunnel-no-open-ports)

```
cloudflared tunnel create magnetio
cloudflared tunnel route dns magnetio magnetio.example.com
cloudflared tunnel run --url http://localhost:7000 magnetio
```

Useful when you don't want to open inbound ports on your firewall at all.

#### Nginx + certbot, Tailscale, WireGuard

[Permalink: Nginx + certbot, Tailscale, WireGuard](https://github.com/peterdsp/Magnetio#nginx--certbot-tailscale-wireguard)

Also fine. Anything that gives the addon a real `https://` URL on a public domain works.

#### Oracle Cloud / Free Tier VPS notes

[Permalink: Oracle Cloud / Free Tier VPS notes](https://github.com/peterdsp/Magnetio#oracle-cloud--free-tier-vps-notes)

Oracle's free-tier VMs block inbound traffic in **two** places by default. If you set up the addon, `:7000` works locally on the box, but install from Stremio (or even `curl` from your laptop) fails, you almost certainly need to open both:

1. **VCN security list** (web console): add an ingress rule for TCP `443` (and `7000` if you're testing without a proxy), source `0.0.0.0/0`.

2. **Host iptables** (Oracle Linux ships a strict default):



```
sudo iptables -I INPUT 6 -p tcp --dport 443 -j ACCEPT
sudo iptables -I INPUT 6 -p tcp --dport 7000 -j ACCEPT
sudo netfilter-persistent save   # or: sudo service iptables save
```







On Ubuntu images use `ufw allow 443/tcp` and `ufw allow 7000/tcp` instead.


Combined with the HTTPS step above, that's enough to install Magnetio on an Oracle VPS.

* * *

## Environment Variables

[Permalink: Environment Variables](https://github.com/peterdsp/Magnetio#environment-variables)

### Addon (`addon/.env`)

[Permalink: Addon (addon/.env)](https://github.com/peterdsp/Magnetio#addon-addonenv)

| Variable | Default | Description |
| :-- | :-- | :-- |
| `PORT` | `7000` | HTTP port |
| `REDIS_URI` | In-memory | Redis connection string |
| `SCRAPER_URL` | `http://localhost:8080` | Internal scraper service URL |
| `ADDON_PUBLIC_URL` | Auto-detected | Public URL for manifest and subtitle links |
| `METRICS_USER` | `admin` | Username for `/swagger` metrics |
| `METRICS_PASSWORD` | `magnetio` | Password for `/swagger` metrics |
| `OPENSUBTITLES_API_KEY` | - | Enables subtitle resource |
| `OPENSUBTITLES_USERNAME` | - | OpenSubtitles account (for downloads) |
| `OPENSUBTITLES_PASSWORD` | - | OpenSubtitles account password |
| `OPENSUBTITLES_USER_AGENT` | `Magnetio v1.0.0` | User-Agent for OpenSubtitles API |
| `FFSUBSYNC_PATH` | Auto-detected | Path to `ffsubsync` binary |
| `ALASS_PATH` | Auto-detected | Path to `alass` binary |
| `SUBTITLE_SYNC_MAX_OFFSET_SECONDS` | `300` | Max offset for ffsubsync |
| `ALASS_SPLIT_PENALTY` | `10` | Split penalty for alass |
| `LOG_LEVEL` | `info` | Winston log level |

### Scraper (`scraper/.env`)

[Permalink: Scraper (scraper/.env)](https://github.com/peterdsp/Magnetio#scraper-scraperenv)

| Variable | Default | Description |
| :-- | :-- | :-- |
| `PORT` | `8080` | HTTP port |
| `REDIS_URI` | In-memory | Redis connection string |
| `CACHE_TTL_STREAMS` | `3600` | Stream result cache TTL (seconds) |
| `PREWARM_CRON` | `0 4 * * *` | Cron schedule for prewarm job |
| `PREWARM_MOVIES` | `50` | Number of top movies to prewarm |
| `PREWARM_SERIES` | `20` | Number of top series to prewarm |
| `SCRAPER_PROVIDER_TIMEOUT_MS` | `25000` | Per-provider timeout (raise if slow providers keep firing `timed out`) |
| `SCRAPER_HARD_TIMEOUT_MS` | `provider + 2000` | Overall scrape budget |
| `SCRAPER_EARLY_RETURN_MS` | `6000` | Return early once enough results land |
| `SCRAPER_MIN_EARLY_RESULTS` | `10` | Minimum results before early return kicks in |
| `SCRAPER_DOMAIN_COOLDOWN_MS` | `300000` | Cooldown when a domain returns 403/5xx/timeout |
| `SCRAPER_RATELIMIT_COOLDOWN_MS` | `600000` | Longer cooldown when a domain returns 429 |
| `LOG_LEVEL` | `info` | Winston log level |

### Optional Services

[Permalink: Optional Services](https://github.com/peterdsp/Magnetio#optional-services)

| Variable | Default | Description |
| :-- | :-- | :-- |
| `JACKETT_PORT` | `9117` | Exposed port for Jackett UI (profile: `jackett`) |
| `PROWLARR_PORT` | `9696` | Exposed port for Prowlarr UI (profile: `prowlarr`) |
| `TZ` | `Etc/UTC` | Timezone for Jackett/Prowlarr containers |

Start optional services with Docker Compose profiles:

```
docker compose --profile jackett up -d                    # Jackett only
docker compose --profile prowlarr up -d                   # Prowlarr only
docker compose --profile jackett --profile prowlarr up -d # Both
```

* * *

## Tech Stack

[Permalink: Tech Stack](https://github.com/peterdsp/Magnetio#tech-stack)

| Layer | Technology |
| :-- | :-- |
| Runtime | Node.js >= 18 (CI runs on 22) |
| Module system | ES Modules throughout |
| HTTP framework | Express 4 |
| Stremio integration | stremio-addon-sdk |
| HTML parsing | Cheerio |
| HTTP client | Axios |
| Rate limiting | Bottleneck (scraper), p-limit + p-queue (addon) |
| Caching | Redis 7 Alpine via Keyv |
| Monitoring | swagger-stats + prom-client (Prometheus) |
| Scheduling | node-cron |
| Logging | Winston |
| Subtitle sync | ffsubsync, alass (optional) |
| Containerization | Docker Compose v3.9 |
| CI/CD | GitHub Actions (self-hosted runner) |

* * *

## Development

[Permalink: Development](https://github.com/peterdsp/Magnetio#development)

```
# Start Redis (or use in-memory fallback)
docker run -d --name redis -p 6379:6379 redis:7-alpine

# Terminal 1: Scraper
cd scraper && npm install && npm run dev

# Terminal 2: Addon
cd addon && npm install && npm run dev
```

### Running Tests

[Permalink: Running Tests](https://github.com/peterdsp/Magnetio#running-tests)

```
cd addon && npm test
```

* * *

## Disclaimer

[Permalink: Disclaimer](https://github.com/peterdsp/Magnetio#disclaimer)

Magnetio does not host, store, or distribute any copyrighted content. It aggregates publicly available metadata (torrent hashes, magnet links) from third-party indexers. Users are solely responsible for complying with copyright laws in their jurisdiction.

Debrid service integrations are convenience features. API keys are passed through configuration URLs and are never stored server-side beyond the caching TTL.

* * *

## License

[Permalink: License](https://github.com/peterdsp/Magnetio#license)

[Apache License 2.0](https://github.com/peterdsp/Magnetio/blob/main/LICENSE)

## About

Self-hosted Stremio addon with 22+ torrent providers, 8 debrid services (Real-Debrid, Premiumize, AllDebrid, TorBox), Jackett/Prowlarr/Torznab support, TMDB recommendations, and subtitle sync. Docker ready.


[magnetio.peterdsp.dev](https://magnetio.peterdsp.dev/ "https://magnetio.peterdsp.dev")

### Topics

[docker](https://github.com/topics/docker "Topic: docker") [raspberry-pi](https://github.com/topics/raspberry-pi "Topic: raspberry-pi") [torrent](https://github.com/topics/torrent "Topic: torrent") [streaming](https://github.com/topics/streaming "Topic: streaming") [movies](https://github.com/topics/movies "Topic: movies") [anime](https://github.com/topics/anime "Topic: anime") [tmdb](https://github.com/topics/tmdb "Topic: tmdb") [self-hosted](https://github.com/topics/self-hosted "Topic: self-hosted") [series](https://github.com/topics/series "Topic: series") [subtitles](https://github.com/topics/subtitles "Topic: subtitles") [debrid](https://github.com/topics/debrid "Topic: debrid") [torznab](https://github.com/topics/torznab "Topic: torznab") [jackett](https://github.com/topics/jackett "Topic: jackett") [stremio](https://github.com/topics/stremio "Topic: stremio") [torbox](https://github.com/topics/torbox "Topic: torbox") [stremio-addon](https://github.com/topics/stremio-addon "Topic: stremio-addon") [premiumize](https://github.com/topics/premiumize "Topic: premiumize") [alldebrid](https://github.com/topics/alldebrid "Topic: alldebrid") [real-debrid](https://github.com/topics/real-debrid "Topic: real-debrid") [prowlarr](https://github.com/topics/prowlarr "Topic: prowlarr")

### Resources

[Readme](https://github.com/peterdsp/Magnetio#readme-ov-file)

### License

[Apache-2.0 license](https://github.com/peterdsp/Magnetio#Apache-2.0-1-ov-file)

### Security policy

[Security policy](https://github.com/peterdsp/Magnetio#security-ov-file)

### Uh oh!

There was an error while loading. [Please reload this page](https://github.com/peterdsp/Magnetio).

[Activity](https://github.com/peterdsp/Magnetio/activity)

### Stars

[**19**\\
stars](https://github.com/peterdsp/Magnetio/stargazers)

### Watchers

[**1**\\
watching](https://github.com/peterdsp/Magnetio/watchers)

### Forks

[**3**\\
forks](https://github.com/peterdsp/Magnetio/forks)

[Report repository](https://github.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Fpeterdsp%2FMagnetio&report=peterdsp+%28user%29)

## [Releases\  6](https://github.com/peterdsp/Magnetio/releases)

[Magnetio v1.1.5\\
Latest\\
\\
on May 27May 27, 2026](https://github.com/peterdsp/Magnetio/releases/tag/v1.1.5)

[\+ 5 releases](https://github.com/peterdsp/Magnetio/releases)

## [Packages\  0](https://github.com/users/peterdsp/packages?repo_name=Magnetio)

No packages published

### Uh oh!

There was an error while loading. [Please reload this page](https://github.com/peterdsp/Magnetio).

## [Contributors\  3](https://github.com/peterdsp/Magnetio/graphs/contributors)

- [![@peterdsp](https://avatars.githubusercontent.com/u/45949870?s=64&v=4)](https://github.com/peterdsp)[**peterdsp** Petros Dhespollari](https://github.com/peterdsp)
- [![@claude](https://avatars.githubusercontent.com/u/81847?s=64&v=4)](https://github.com/claude)[**claude** Claude](https://github.com/claude)
- [![@dependabot[bot]](https://avatars.githubusercontent.com/in/29110?s=64&v=4)](https://github.com/apps/dependabot)[**dependabot\[bot\]**](https://github.com/apps/dependabot)

## Languages

- [JavaScript97.8%](https://github.com/peterdsp/Magnetio/search?l=javascript)
- Other2.2%

You can’t perform that action at this time.