Skip to content

argontv: the shared line, and whether there is room to sell - #61

Merged
ralyodio merged 1 commit into
masterfrom
argontv-cli
Sep 7, 2026
Merged

argontv: the shared line, and whether there is room to sell#61
ralyodio merged 1 commit into
masterfrom
argontv-cli

Conversation

@ralyodio

@ralyodio ralyodio commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Live TV passes are sold against one shared IPTV line, and nothing here could see it. Checking whether the line was healthy, how many connections were in use, or when it expired meant opening a browser — which is not a thing that can gate a sale.

$ argontv
status       Active
connections  6 free of 6
sellable     5 passes  (1 connection held back)
expires      2026-10-07 00:04  (30 days)
formats      ts, m3u8, rtmp

At most 6 streams at once across every site, so 5 active passes and 1 spare for us.

$ argontv slots --json
{"capacity":6,"free":6,"sellable":5,"reserved":1,"status":"Active"}

slots is the one with a job. A shared line permits a fixed number of simultaneous streams, so how many passes may exist is bounded by hardware rather than demand — sell one too many and the buyer who paid is the one told to come back later. The exit code is the interface: 0 room, 3 full, 4 unreachable. A sale webhook checks it before taking money rather than discovering the problem after.

Two APIs, kept apart deliberately. The panel (player_api.php) answers about an existing line and authenticates with that line's own credentials. The reseller API creates and extends lines, authenticates with an account-wide key, and spends money. Everything that reads is on the panel; everything that spends is on the reseller API, marked as such, and refuses without an explicit key. A tool that could quietly provision a line because a variable happened to be set is a tool that bills you for a typo.

Sellable is not capacity. The panel reports what the line permits; this reports one fewer, because selling to the full number means the first person opening a stream to check a complaint takes the slot a paying customer is using — and the customer is the one who sees it fail. ARGONTV_MAX_PASSES overrides the reserve.

Verified against a real line: 6 connections, 5 sellable, 30 days remaining.

Two findings worth recording:

  • The panel answers 200 with auth: 0 for a wrong password rather than 401, so a check reading only the HTTP status would report a dead line as healthy with every field null. Treated as a refusal here.
  • get_series counts shows; the M3U counts episodes, ~26 per show. That is why one line reports 44,790 series while its playlist has 1,152,848 entries for the same catalogue — the numbers look like they disagree and don't.

Tests: 13 new, covering the reserve arithmetic, the auth: 0 refusal, epoch conversion, per-kind counts and config precedence. Suite 757 pass, 1 pre-existing failure in root-ubuntu.test.ts (untouched here).

🤖 Generated with Claude Code

https://claude.ai/code/session_0172JWTmsEEEcdAxPdn3UZnm

Live TV passes are sold against one shared IPTV line, and nothing here could see
it. Checking whether the line was healthy, how many of its connections were in
use, or when it expired meant opening a browser and reading a panel, which is not
a thing that can gate a sale.

  argontv                 status, expiry and free connections
  argontv slots [--json]  free now; exit 3 when full
  argontv catalogue       live / films / series counts
  argontv templates       reseller templates (needs the account key)

`slots` is the one with a job. A shared line permits a fixed number of
simultaneous streams, so how many passes may exist is bounded by hardware rather
than by demand -- sell one too many and the buyer who paid is the one told to come
back later. The exit code is the interface: 0 there is room, 3 the line is full,
4 it could not be reached. A sale webhook checks that before taking money rather
than discovering it afterwards.

**Two APIs, kept apart on purpose.** The panel (player_api.php on the line's own
server) answers about a line that exists and authenticates with the line's own
username and password. The reseller API creates and extends lines, authenticates
with an account-wide key, and spends money. Everything that reads is on the panel;
everything that spends is on the reseller API, is marked as such, and refuses
without an explicit key. A tool that could quietly provision a line because a
variable happened to be set is a tool that bills you for a typo.

**Sellable is not capacity.** The panel reports what the line permits; the tool
reports one fewer as sellable, because selling to the full number means the first
person to open a stream to check a complaint takes the slot a paying customer is
using -- and the customer is the one who sees it fail. ARGONTV_MAX_PASSES
overrides the reserve.

Verified against a real line: 6 connections reported, 5 sellable, 1 held back,
30 days remaining, formats ts/m3u8/rtmp.

Two things worth recording that came out of building it. The panel answers 200
with `auth: 0` for a wrong password rather than 401, so a check that only read the
HTTP status would report a dead line as healthy with every field null; that is a
refusal here. And `get_series` counts SHOWS while the M3U counts EPISODES, about
twenty-six per show, which is why one line reports 44,790 series and its playlist
has 1,152,848 entries for the same catalogue -- the numbers look like they
disagree and do not.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172JWTmsEEEcdAxPdn3UZnm
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

12 finding(s)

HIGH/CRITICAL: 4 | MEDIUM: 4 | LOW: 4

Severity Rule Location
HIGH sh-remote-script-execution root-ubuntu.sh:3227
HIGH sh-remote-script-execution root-ubuntu.sh:3228
HIGH sh-remote-script-execution root-ubuntu.sh:4840
HIGH sh-remote-script-execution root-ubuntu.sh:4844
MEDIUM sh-remote-script-execution root-ubuntu.sh:4993
MEDIUM sh-remote-script-execution root-ubuntu.sh:6055
MEDIUM redos-nested-quantifier src/domain-free.ts:56
MEDIUM redos-nested-quantifier src/mail.ts:1042
LOW secret-generic-credential src/credentials.ts:36
LOW secret-generic-api-key test/credentials.test.ts:208
LOW secret-generic-credential test/mail.test.ts:135
LOW secret-generic-credential test/shorten.test.ts:36

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 8d5df4b into master Sep 7, 2026
5 checks 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.

1 participant