1. Custom Templates

​
Building Custom Templates

The recommended way to create a custom AIOStreams template is through the Core Builds Configurator. It generates a complete, valid template JSON from your selections — service, device, resolution, audio, scrapers, and filtering preferences.

Launch Configurator

Interactive template builder — generates optimised AIOStreams JSON through a guided UI.

​
Template JSON Structure

AIOStreams templates are JSON files with two top-level sections:

{
  "metadata": {
    "id": "my-template",
    "name": "My Template",
    "version": "1.0.0",
    "description": "What this template does"
  },
  "config": {
    "presets": [],
    "services": [],
    "sortCriteria": {},
    "excludedStreamExpressions": [],
    "includedStreamExpressions": [],
    "preferredStreamExpressions": [],
    "excludedRegexPatterns": [],
    "rankedRegexPatterns": [],
    "formatter": {},
    "deduplicator": {}
  }
}

​
Key Config Sections

SectionPurpose
presetsScraper addons (Torrentio, Comet, MediaFusion, etc.) with credentials and settings
servicesDebrid/usenet service credentials (TorBox, AllDebrid, Real-Debrid, EasyNews)
sortCriteriaMulti-key stable sort — global, movies, series, anime, plus cached/uncached variants
excludedStreamExpressionsESEs — filters that remove unwanted streams (SEL syntax)
includedStreamExpressionsISEs — filters that protect streams from exclusion (SEL syntax)
preferredStreamExpressionsPSEs — scoring tiers that rank streams by quality (SEL syntax)
formatterStream display format using the tamtaro or custom formatter DSL
deduplicatorDeduplication rules — hash, title similarity, tiebreakers

​
Sort Criteria

Each sort section is an array of { key, direction } objects. Position 1 is the primary sort; subsequent keys break ties.

{
  "sortCriteria": {
    "global": [
      { "key": "cached", "direction": "desc" },
      { "key": "streamExpressionMatched", "direction": "desc" },
      { "key": "streamExpressionScore", "direction": "desc" },
      { "key": "resolution", "direction": "desc" },
      { "key": "quality", "direction": "desc" },
      { "key": "bitrate", "direction": "desc" },
      { "key": "size", "direction": "desc" }
    ]
  }
}

Use "direction" — not "order". AIOStreams rejects templates that use "order".

​
Manual Editing Tips

  1. Start from an existing template — download one from the Template Directory and modify it
  2. Validate before import — use the Template Inspector to check for errors
  3. Never hardcode API keys — AIOStreams prompts for credentials on import
  4. Test on your target host — elfhosted and fortheweak have different regex and URL allowlists

The Configurator handles all expression architecture, regex scoring, sort criteria, and host compatibility automatically. Manual editing is only needed for advanced customisation beyond what the Configurator offers.

​
Next Steps