AIOStreamsAIOStreams
Guides

Groups

Control when different sets of addons are queried using conditional group logic.

The Grouping feature lets you control when different sets of your addons are asked for streams. This is useful for making AIOStreams faster by only querying fallback addons when your primary sources don't find enough results.

Why use groups?

  • Make your fastest or most reliable addons run first.
  • Only query slower or backup addons when the primary ones don't deliver.
  • Avoid waiting for all addons every time when most results come from one or two.

How It Works

Parallel fetch start — AIOStreams begins fetching from all groups simultaneously.

Evaluate as results arrive — as soon as Group 1 responds, AIOStreams evaluates Group 2's condition:

  • If the condition is false, Group 2 (and all subsequent groups) are skipped immediately.
  • If true, Group 2's results are included and Group 3's condition is evaluated next.

Early exit — the moment a group's condition is false, all pending results beyond that point are discarded. See When a condition fails to keep results that already arrived.

Example: AIOStreams fires off fetches for Groups 1, 2, and 3 concurrently.

  • Group 1 returns 3 streams → check Group 2's condition.
  • If you set Group 2 to run only when Group 1 found fewer than 5 streams, and Group 1 returned 3: the condition is true → Group 2 runs.
  • If Group 1 returned 6: the condition is false → Groups 2 and 3 are skipped.

Building Group Conditions

Group conditions are written using the Stream Expression Language (SEL). The condition must evaluate to true or false.

Available constants

ConstantDescription
previousStreamsList of streams found by the last group that ran
totalStreamsList of all streams found by all groups so far
queryTypeWhat is being searched for ("movie", "series", "anime.series", "anime.movie")
previousGroupTimeTakenHow long the last group took (milliseconds)
totalTimeTakenTotal time spent across all groups so far (milliseconds)

The most useful function for group conditions is count(), which counts how many streams are in a list:

count(cached(previousStreams)) > 0

Examples

Run Group 2 if Group 1 found fewer than 3 streams:

count(previousStreams) < 3

Run Group 2 if Group 1 found no cached Real-Debrid streams:

count(cached(service(previousStreams, 'realdebrid'))) == 0

Run Group 3 for series only when all previous groups together found fewer than 2 1080p streams:

queryType == "series" and count(resolution(totalStreams, '1080p')) < 2

Run Group 2 if Group 1 found no 4K streams OR took longer than 5 seconds:

count(resolution(previousStreams, '2160p')) == 0 or previousGroupTimeTaken > 5000

When a condition fails

With Parallel behaviour every group is fetched at once, so a group can already have results by the time an earlier condition fails. When a Condition Fails decides what happens to them. It has no effect on Sequential, where later groups were never fetched in the first place.

OptionBehaviour
Stop (default)Discard this group and every group after it.
Skip group and keep checkingDiscard this group, then evaluate the remaining conditions as normal. A later group is included only if its condition passes and it has already finished.
Keep everything already finishedInclude this group and every group after it that has already finished, ignoring their conditions.

Neither of the last two ever waits on a group that is still fetching.

With Skip group and keep checking, a group that passes its condition but has not finished contributes nothing to previousStreams or totalStreams, so conditions further down the chain are evaluated without it. Use Stop if your conditions rely on every earlier group's results being present.


Tips

  • Always return true or false: A condition that evaluates to neither will cause the group (and subsequent groups) to be skipped.
  • previousStreams vs totalStreams: Use previousStreams for logic based on the immediately preceding group; use totalStreams for cumulative logic across all groups run so far.
  • Start simple: Begin with basic count() conditions and expand from there.
  • Errors skip groups: A malformed condition causes the group to be skipped as if the condition returned false.

For the complete list of available functions, see the SEL reference.

On this page