openapi: 3.1.0
info:
  title: XC_VM Stalker Portal (MAG) API
  version: 2.7.3
  summary: Stalker Portal (MAG) of the Xtream Codes compatible HTTP surface, as implemented by XC_VM.
  description: |
    A source-level reference for the **Xtream Codes (XC) API**: the de facto standard HTTP interface
    between IPTV panels and player apps. The reference implementation is
    [XC_VM](https://github.com/Vateron-Media/XC_VM) 2.7.3, an open-source continuation of Xtream UI / XC.
    Each operation cites the XC_VM source file and line it was traced from (`src/...:line`).

    ## Authentication models

    The panel has several independent auth schemes. Each endpoint states which one it uses.

    | Who | How |
    |---|---|
    | Line (subscriber) | `username` + `password` query parameters, or `token` (32-char line access token). Also in path form: `/player_api/{u}/{p}`, `/live/{u}/{p}/...` |
    | Activation code | The code typed as `username` (or `token`) is activated on first use and becomes a line |
    | MAG / Stalker box | MAC address cookie + bearer token from `handshake` (`/c/portal.php`, `/stalker_portal/...`) |
    | Enigma2 box | MAC/device registration (`enigma2.php`) |
    | Admin / reseller REST | `api_key` query parameter (named `xct_` token or legacy per-user key) on `/{access_code}/?action=...`; the access code's IP whitelist is enforced by nginx |
    | Load-balancer nodes | Shared cluster secret (`/cluster/v1`); signed `node.rpc` (legacy `api.php` on nodes older than 2.7.0) |

    ## Notation

    OpenAPI cannot express query-string multiplexing, so action-based endpoints are written as separate
    literal paths such as `/player_api.php?action=get_live_streams`. The request is still a single
    `GET /player_api.php` with `action` as an ordinary query parameter.

    The admin and reseller REST APIs share one URL shape, `/{access_code}/?action=...`. Each access code has a type
    (3 = Admin API, 4 = Reseller API) and nginx routes it to that API, so `/{access_code}/...` and `/{reseller_access_code}/...` are the
    same URL and differ only in which kind of code is used.
  contact:
    name: XC_VM project
    url: https://github.com/Vateron-Media/XC_VM
  license:
    name: AGPL-3.0 (XC_VM source); this document describes its public interface
    identifier: AGPL-3.0-only
servers:
  - url: '{protocol}://{host}:{port}'
    description: Any XC compatible panel or load-balancer node
    variables:
      protocol:
        default: http
        enum:
          - http
          - https
      host:
        default: tv.example.com
      port:
        default: '80'
        description: HTTP broadcast port (often 80, 8080, 8000, 25461); HTTPS often 443 or 25463.
externalDocs:
  description: XC_VM source
  url: https://github.com/Vateron-Media/XC_VM
components:
  parameters:
    Stalker_Authorization:
      name: Authorization
      in: header
      required: false
      schema:
        type: string
        example: Bearer kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
      description: '`Bearer <token>` from stb/handshake (matched case-insensitively, also `REDIRECT_HTTP_AUTHORIZATION`) (src/Ministra/portal.php:96-115). NOTE: OpenAPI tooling ignores header params named Authorization; master file may map this to an http bearer securityScheme.'
    Stalker_TokenQuery:
      name: token
      in: query
      required: false
      schema:
        type: string
      description: Fallback for the Bearer token when no Authorization header is sent (used by browser emulation `?auth_via_query=1`).
    Stalker_MacQuery:
      name: mac
      in: query
      required: false
      schema:
        type: string
        example: 00:1A:79:12:34:56
      description: Device MAC; takes precedence over the `mac` cookie. Used by handshake to find the device and echoed by account_info.
    Stalker_MacCookie:
      name: mac
      in: cookie
      required: false
      schema:
        type: string
        example: 00:1A:79:12:34:56
      description: Device MAC (URL-encoded by firmware). The firmware also sends `stb_lang`, `timezone`, `adid` cookies; `stb_lang` and `adid` are ignored by the server.
    Stalker_TimezoneCookie:
      name: timezone
      in: cookie
      required: false
      schema:
        type: string
        example: Europe/London
      description: IANA zone for EPG/now-playing times. Missing, `undefined` or invalid -> `default_timezone` setting (src/Ministra/portal.php:478-486).
    Stalker_LocaleCookie:
      name: locale
      in: cookie
      required: false
      schema:
        type: string
        example: en_GB.utf8
      description: Used only when the device has no stored locale.
    Stalker_XUserAgent:
      name: X-User-Agent
      in: header
      required: false
      schema:
        type: string
        example: 'Model: MAG250; Link: Ethernet'
      description: Sent by MAG firmware/JsHttpRequest. Read into `$rUserAgent` but not used for any decision (src/Ministra/portal.php:81).
    Stalker_JsHttpRequest:
      name: JsHttpRequest
      in: query
      required: false
      schema:
        type: string
        example: 1-xml
      description: Cache-buster/transport marker added by the JsHttpRequest client. Ignored.
    Stalker_Page:
      name: p
      in: query
      required: false
      schema:
        type: integer
        minimum: 0
        default: 0
      description: 1-based page. 0/absent = "default page" (server chooses; `cur_page` then reports the chosen page). With an explicit page, `cur_page` is reported as 0 in most lists.
  responses:
    Stalker_FloodBlocked:
      description: 'Client IP has a flood/ban block file (e.g. after MAGSCAN or bruteforce): empty body (`src/Infrastructure/Bootstrap/StreamingRequestBootstrap.php:40-45`).'
    Stalker_LegacyDisabled:
      description: 'Request path is `/c/portal.php` or `/portal.php` and `mag_legacy_redirect` is off: empty body (src/Ministra/portal.php:43-49; nginx also 404s `/c/` and `/portal.php` in that case, `src/bin/nginx/conf/nginx.conf:482-526`).'
    Stalker_Maintenance:
      description: 'Maintenance mode: plain-text message, optional `Retry-After` header (`src/Core/Config/Maintenance.php:44`, src/Ministra/portal.php:52).'
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        text/plain:
          schema:
            type: string
          example: Service temporarily unavailable for maintenance.
  schemas:
    Stalker_AuthFailedText:
      type: string
      const: Authorization failed.
      description: 'Plain body (still `Content-type: text/javascript`) for any non-public action without a verified device. Stalker clients treat it as a cue to handshake again.'
    Stalker_JsTrue:
      type: object
      required:
        - js
      properties:
        js:
          type: boolean
          const: true
    Stalker_DataTrue:
      type: object
      required:
        - data
      properties:
        data:
          type: boolean
          const: true
      description: Non-standard envelope used by set_volume/set_modern/set_legacy.
    Stalker_JsEmptyArray:
      type: object
      required:
        - js
      properties:
        js:
          type: array
          maxItems: 0
          items: {}
    Stalker_JsObject:
      type: object
      required:
        - js
      properties:
        js: {}
      description: 'Standard Stalker envelope `{"js": ...}`.'
    Stalker_JsAny:
      type: object
      properties:
        js:
          type:
            - string
            - boolean
    Stalker_JsArray:
      type: object
      required:
        - js
      properties:
        js:
          type: array
          items:
            type: object
            additionalProperties: true
    Stalker_JsStringArray:
      type: object
      required:
        - js
      properties:
        js:
          type: array
          items:
            type: string
    Stalker_HandshakeResponse:
      type: object
      required:
        - js
      properties:
        js:
          type: object
          required:
            - token
          properties:
            token:
              type: string
              description: 'Opaque base64url token (AES/sealed igbinary payload). Use as `Authorization: Bearer <token>`.'
    Stalker_ProfileResponse:
      type: object
      required:
        - js
      properties:
        js:
          type: object
          additionalProperties: true
          description: Default profile (src/Ministra/portal.php:288-439) overlaid with the device `get_profile_vars` when verified (src/Ministra/portal.php:1442-1521), plus server settings (src/Ministra/PortalHandler.php:176-214).
          properties:
            id:
              type:
                - string
                - integer
              description: '`mag_id`; int 0 when unverified.'
            name:
              type:
                - string
                - integer
            mac:
              type: string
            ip:
              type: string
            locale:
              type: string
            stb_type:
              type: string
            image_version:
              type: string
            hw_version:
              type: string
            parent_password:
              type: string
            volume:
              type: string
            screensaver_delay:
              type: string
            status:
              type: integer
              enum:
                - 0
                - 1
              description: 0 = verified/authorised, 1 = not.
            last_itv_id:
              type:
                - string
                - integer
            default_timezone:
              type: string
            default_locale:
              type: string
            allowed_stb_types:
              type: array
              items:
                type: string
            allowed_stb_types_for_local_recording:
              type: array
              items:
                type: string
            storages:
              type: array
              items: {}
            tv_channel_default_aspect:
              type: string
            playback_limit:
              type:
                - boolean
                - integer
            enable_playback_limit:
              type: boolean
            show_tv_channel_logo:
              type: boolean
            show_channel_logo_in_preview:
              type: boolean
            enable_connection_problem_indication:
              type: boolean
            hls_fast_start:
              type: string
            check_ssl_certificate:
              type: integer
            enable_buffering_indication:
              type: integer
            watchdog_timeout:
              type: integer
              minimum: 80
              maximum: 120
            update_url:
              type: string
            test_download_url:
              type: string
            aspect:
              type: string
    Stalker_Category:
      type: object
      properties:
        id:
          type: string
          description: Category id as string, or `*` for All.
        title:
          type: string
        alias:
          type: string
        censored:
          type: integer
          enum:
            - 0
            - 1
        number:
          type: string
          description: itv only.
        modified:
          type: string
          description: itv only, always "".
        active_sub:
          type: boolean
          description: itv "All" entry only.
    Stalker_CategoryList:
      type: object
      properties:
        js:
          type: array
          items:
            $ref: '#/components/schemas/Stalker_Category'
      description: 'Quirk: if there are no categories and "All" is off, itv/get_genres emits `[]` (no `js` key at all).'
    Stalker_PageMeta:
      type: object
      required:
        - total_items
        - max_page_items
        - selected_item
        - cur_page
        - data
      properties:
        total_items:
          type: integer
        max_page_items:
          type: integer
        selected_item:
          type: number
        cur_page:
          type: number
          description: May be emitted as a float (e.g. `2.0`) when computed via floor().
        data:
          type: array
    Stalker_Channel:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
        name:
          type: string
        number:
          type: string
        snumber:
          type: string
        censored:
          type: integer
          enum:
            - 0
            - 1
        cmd:
          type: string
          description: '`<player> <url>`'
        cost:
          type: string
        count:
          type: string
        status:
          type: string
        tv_genre_id:
          type: string
        hd:
          type: integer
          enum:
            - 0
            - 1
        xmltv_id:
          type: string
        use_http_tmp_link:
          type: string
          enum:
            - '0'
            - '1'
        enable_tv_archive:
          type: integer
          enum:
            - 0
            - 1
        logo:
          type: string
        allow_pvr:
          type: integer
          enum:
            - 0
            - 1
        allow_local_pvr:
          type: integer
          enum:
            - 0
            - 1
        allow_remote_pvr:
          type: integer
          enum:
            - 0
            - 1
        nginx_secure_link:
          type: string
          enum:
            - '0'
            - '1'
        tv_archive_duration:
          type: string
          description: Hours.
        locked:
          type: integer
          enum:
            - 0
            - 1
        lock:
          type: integer
          enum:
            - 0
            - 1
        fav:
          type: integer
          enum:
            - 0
            - 1
        archive:
          type: integer
          enum:
            - 0
            - 1
        cur_playing:
          type: string
        epg:
          type: array
          maxItems: 0
        open:
          type: integer
          enum:
            - 0
            - 1
        cmds:
          type: array
          items:
            type: object
            additionalProperties: true
        use_load_balancing:
          type: integer
          enum:
            - 0
            - 1
        pvr:
          type: integer
          enum:
            - 0
            - 1
    Stalker_ChannelPage:
      type: object
      properties:
        js:
          allOf:
            - $ref: '#/components/schemas/Stalker_PageMeta'
            - type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/Stalker_Channel'
    Stalker_VodItem:
      type: object
      additionalProperties: true
      description: Stalker "video" record. Exactly one of `today`/`yesterday`/`week_and_more` keys is present.
      properties:
        id:
          type: string
        name:
          type: string
        o_name:
          type: string
        tmdb_id:
          type:
            - integer
            - string
            - 'null'
        description:
          type: string
        time:
          type:
            - integer
            - string
          description: Minutes (movies) or "N/a" (series).
        path:
          type: string
        censored:
          type: integer
          enum:
            - 0
            - 1
        series:
          type: array
          items:
            type: integer
        category_id:
          type:
            - integer
            - string
        cat_genre_id_1:
          type:
            - integer
            - string
        hd:
          type: integer
          enum:
            - 0
            - 1
        director:
          type: string
        actors:
          type: string
        year:
          type: string
        added:
          type: string
        rating_im:
          type: string
        rating_kinopoisk:
          type: string
        age:
          type: string
        is_series:
          type: integer
          enum:
            - 0
            - 1
        is_movie:
          type: integer
          enum:
            - 0
            - 1
        lock:
          type:
            - integer
            - string
        fav:
          type: integer
          enum:
            - 0
            - 1
        screenshot_uri:
          type: string
        genres_str:
          type: string
        cmd:
          type: string
          description: base64(JSON) for vod/create_link; "" for series-level items.
        today:
          type: string
        yesterday:
          type: string
        week_and_more:
          type: string
        has_files:
          type: integer
          enum:
            - 0
            - 1
    Stalker_VodPage:
      type: object
      properties:
        js:
          allOf:
            - $ref: '#/components/schemas/Stalker_PageMeta'
            - type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/Stalker_VodItem'
    Stalker_RadioPage:
      type: object
      properties:
        js:
          allOf:
            - $ref: '#/components/schemas/Stalker_PageMeta'
            - type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      number:
                        type: integer
                      cmd:
                        type: string
                      count:
                        type: integer
                      open:
                        type: integer
                      status:
                        type: integer
                      volume_correction:
                        type: integer
                      use_http_tmp_link:
                        type: string
                        enum:
                          - '0'
                          - '1'
                      fav:
                        type: integer
                        enum:
                          - 0
                          - 1
    Stalker_ItvCreateLink:
      type: object
      properties:
        js:
          type: object
          properties:
            id:
              type: string
            cmd:
              type: string
        streamer_id:
          type: integer
        link_id:
          type: integer
        load:
          type: integer
        error:
          type: string
    Stalker_VodCreateLink:
      type: object
      properties:
        js:
          type: object
          properties:
            id:
              type:
                - string
                - integer
                - 'null'
            cmd:
              type: string
            load:
              type: string
            subtitles:
              type: array
              maxItems: 0
            error:
              type: string
              enum:
                - ''
                - player_file_missing
    Stalker_ShortEpg:
      type: object
      properties:
        js:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              ch_id:
                type: string
              correct:
                type: string
              time:
                type: string
              time_to:
                type: string
              duration:
                type: integer
              name:
                type: string
              descr:
                type: string
              real_id:
                type: string
                description: '`<ch_id>_<start_ts>`'
              category:
                type: string
              director:
                type: string
              actor:
                type: string
              start_timestamp:
                type: integer
              stop_timestamp:
                type: integer
              t_time:
                type: string
              t_time_to:
                type: string
              mark_memo:
                type: integer
              mark_archive:
                type: integer
    Stalker_WatchdogEvents:
      type: object
      properties:
        js:
          type: object
          properties:
            data:
              type: object
              additionalProperties: true
              properties:
                msgs:
                  type:
                    - integer
                    - string
                id:
                  type: string
                event:
                  type: string
                  example: send_msg
                need_confirm:
                  type: string
                msg:
                  type: string
                reboot_after_ok:
                  type: string
                auto_hide_timeout:
                  type: string
                send_time:
                  type: string
                additional_services_on:
                  type:
                    - integer
                    - string
                updated:
                  type: object
tags:
  - name: Stalker Portal (MAG)
    description: |-
      Stalker/Ministra middleware emulation for MAG and other Stalker-compatible set-top boxes (`src/Ministra/portal.php`, `src/Ministra/PortalHandler.php`).

      **Endpoints / routing.** Real entry points (all run the same script):
      - `/<code>/portal.php` and `/<code>/server/load.php` for an access code of type `ministra` (2) or `ministra/new` (5); load.php is served directly, no redirect (`src/bin/nginx/conf/codes/template_ministra`, `src/Core/Auth/AuthRepository.php:115`). Static portal JS/HTML is served from the same prefix.
      - `/c/portal.php` (legacy) and `/portal.php` (302 -> `/c/portal.php`) only when setting `mag_legacy_redirect` is on; otherwise 404 (`src/bin/nginx/conf/nginx.conf:481-526`, `src/Ministra/portal.php:43-49`).
      - `/server/load.php` -> 302 `/c/portal.php?$args` (`src/bin/nginx/conf/nginx.conf:163`).
      Paths below are written as `/portal.php?type=..&action=..`; substitute the real prefix. `type`/`action` may be sent by GET or POST (form or JSON body; POST overrides GET).

      **Auth flow.** 1) `stb/handshake` with `mac` -> `js.token`. 2) `stb/get_profile` with `Authorization: Bearer <token>` + device identifiers (`sn`, `stb_type`, ...) -> `js.status` 0 when verified; the token becomes the device token. 3) Every other call sends the same Bearer token (or `token` param). The device is resolved from the token, not from the `mac` cookie. A newer handshake+get_profile for the same MAC invalidates the previous token. Unverified callers get `Authorization failed.` (plain text, HTTP 200) for non-public actions.

      **Request phases** (`src/Ministra/portal.php`): (1) pre-init stubs answered without DB or auth (`src/Ministra/PortalHandler.php:46`); (2) bootstrap: flood-blocked IP -> 403; (3) legacy-path gate -> 404; (4) maintenance -> 503; (5) `disable_ministra` on -> HTTP 200 empty body for everything not stubbed; (6) token/device resolution; (7) public stb actions; (8) authenticated dispatch; unknown/unhandled type/action pairs for a verified device (e.g. `tv_archive/update_played_end_time`, `series/create_link`) -> HTTP 200 empty body.

      **Responses.** JSON with header `Content-type: text/javascript`, plus `Cache-Control: no-store, no-cache, must-revalidate` and `Pragma: no-cache`. Envelope is `{"js": ...}` (exceptions: `{"data":true}` for set_volume/set_modern/set_legacy; itv/create_link adds top-level keys; get_tv_aspects is raw). Lists use `js.{total_items,max_page_items,selected_item,cur_page,data}`; `max_page_items` is 10 for the `xc_vm` theme, 14 for the legacy theme (7/10 for EPG tables).

      **Playback.** `cmd` values are `<player> <url>` where player is the device `mag_player` or `ffmpeg`, and url is `<site_url>play/<token>` (nginx rewrites `/play/<token>` to `/stream/auth?token=..&extension=ts`). Tokens embed the line username/password, stream id, container and the device token, so links die when the device re-authenticates.
paths:
  /server/load.php:
    get:
      operationId: Stalker_server_load_redirect
      tags:
        - Stalker Portal (MAG)
      summary: Legacy Stalker loader alias (redirect)
      description: |-
        Root-level `/server/load.php` is answered by nginx with `302 /c/portal.php?$args` (`src/bin/nginx/conf/nginx.conf:163`). The target is then subject to the `mag_legacy_redirect` gate (`src/Ministra/portal.php:43-49`). Under an access code (`/<code>/server/load.php`) nginx runs portal.php directly with no redirect (`src/bin/nginx/conf/codes/template_ministra:17`). All query args are forwarded unchanged; see the `/portal.php?type=...&action=...` operations for semantics.

        Auth: none at this hop.
      parameters:
        - name: type
          in: query
          required: false
          schema:
            type: string
          description: Forwarded.
        - name: action
          in: query
          required: false
          schema:
            type: string
          description: Forwarded.
      responses:
        '302':
          description: Redirect to `/c/portal.php` with the original query string.
          headers:
            Location:
              schema:
                type: string
              example: /c/portal.php?type=stb&action=handshake&token=&JsHttpRequest=1-xml
  /portal.php?type=stb&action=handshake:
    get:
      operationId: Stalker_stb_handshake
      tags:
        - Stalker Portal (MAG)
      summary: 'Handshake: obtain a portal Bearer token for a MAC'
      description: |-
        Step 1 of login. MAC is taken from the `mac` request field, else the `mac` cookie (src/Ministra/portal.php:76-80). For a registered MAC the token wraps `igbinary({id: mag_id, token: <32 hex: 16 random + 16 HMAC>})`, sealed/encrypted with `live_streaming_pass` and base64url-encoded (src/Ministra/PortalHandler.php:1962-2015, :1887). This handshake token is accepted ONLY by `stb/get_profile`, only for that device, and only within the current or previous 600 s period (10-20 min) (src/Ministra/PortalHandler.php:1876, :1904). Nothing is written for a known device (it keeps its current token until get_profile verifies the box).

        Unknown MAC: answered with a same-shaped decoy token (id starts with `0`, random inner token) so registration cannot be probed; the attempt is counted by `BruteforceGuard` (may block the IP) and logged as `INVALID_CREDENTIALS` (src/Ministra/PortalHandler.php:1986-2012).

        Quirks: unlike stock Stalker there is no `random` field in the reply; `prehash`, `token` and `JsHttpRequest` request fields are ignored. Any `Authorization` header sent with handshake is ignored (the token block is skipped for stb/handshake, src/Ministra/portal.php:89).

        Source: `src/Ministra/PortalHandler.php:1962`, `src/Ministra/portal.php:89`, `src/Ministra/portal.php:981`.

        Auth: none required (handled in handleStbPublic before the auth gate, src/Ministra/PortalHandler.php:162), but token/device state still influences the answer.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - handshake
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: prehash
          in: query
          required: false
          schema:
            type: string
          description: Sent by firmware; ignored by XC_VM.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_HandshakeResponse'
              examples:
                ok:
                  value:
                    js:
                      token: kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=get_profile:
    get:
      operationId: Stalker_stb_get_profile
      tags:
        - Stalker Portal (MAG)
      summary: Get (and verify) the STB profile
      description: |-
        Step 2 of login. With a Bearer token from handshake (or the device's current token) the device is loaded and verified (src/Ministra/portal.php:119-276):
        - `stb_type` (lower-cased) must be in `allowed_stb_types` when that list is set;
        - if the device has `lock_device`, stored `sn`, `device_id`, `device_id2`, `hw_version` must match;
        - `ver` must be in `stalker_lock_images` when that list is set;
        - `enable_debug_stalker` bypasses all checks.

        On success the handshake token becomes the device's token (`mag_devices.token` updated, previous token invalidated, line cache signal sent; one verification per device at a time via file lock) and the box identifiers are saved (src/Ministra/PortalHandler.php:1936, src/Ministra/portal.php:234-263). Response `js.status` is `0` when verified, `1` when not (`status = intval(!authenticated)`, src/Ministra/PortalHandler.php:179).

        Unverified requests still get HTTP 200 with a default profile and `status: 1`, but are counted by `BruteforceGuard` (keyed by sha256(MAC)) and flood check, and logged `INVALID_CREDENTIALS` (src/Ministra/PortalHandler.php:170-174).

        MAGSCAN protection (only when the token resolved to a device, and debug off): missing `sn`, or `sn` differing from the stored one, inserts the client IP into `blocked_ips`, writes a flood block file and returns **HTTP 404 empty** (src/Ministra/portal.php:162-195).

        Types: most profile values are strings (`"200"`, `"0"`), but several are numbers/booleans (`hdmi_event_reaction`, `last_itv_id`, `record_max_length`, `timeslot`, `watchdog_timeout`, `status`, `check_ssl_certificate`); `playback_limit` is `false` or an integer. `watchdog_timeout` is random 80-120. `aspect` is set to `"16"` only when the server protocol is https and unset. Extra firmware fields (`hd`, `num_banks`, `signature`, `metrics`, `auth_second_step`, `not_valid_token`, `hw_version_2`, `client_type`, `video_out`) are ignored.

        Source: `src/Ministra/PortalHandler.php:166`, `src/Ministra/portal.php:145`, `src/Ministra/portal.php:288`.

        Auth: none required (handled in handleStbPublic before the auth gate, src/Ministra/PortalHandler.php:162), but token/device state still influences the answer.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_profile
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - $ref: '#/components/parameters/Stalker_TimezoneCookie'
        - $ref: '#/components/parameters/Stalker_LocaleCookie'
        - name: sn
          in: query
          required: false
          schema:
            type: string
          description: 'Serial number. REQUIRED in practice: absent/mismatched -> IP ban + 404 (unless debug).'
        - name: stb_type
          in: query
          required: false
          schema:
            type: string
            example: MAG250
          description: Box model; checked against `allowed_stb_types` (lower-case compare).
        - name: ver
          in: query
          required: false
          schema:
            type: string
          description: Firmware version string; checked against `stalker_lock_images` when set.
        - name: image_version
          in: query
          required: false
          schema:
            type: string
            example: '218'
          description: Stored on the device.
        - name: device_id
          in: query
          required: false
          schema:
            type: string
          description: Checked when `lock_device` is on.
        - name: device_id2
          in: query
          required: false
          schema:
            type: string
          description: Checked when `lock_device` is on.
        - name: hw_version
          in: query
          required: false
          schema:
            type: string
            example: 1.7-BD-00
          description: Checked when `lock_device` is on.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_ProfileResponse'
              examples:
                verified:
                  summary: Verified device (status 0), abridged
                  value:
                    js:
                      id: '17'
                      name: '17'
                      sname: ''
                      pass: ''
                      parent_password: '0000'
                      bright: '200'
                      contrast: '127'
                      saturation: '127'
                      video_out: ''
                      volume: '70'
                      playback_buffer_bytes: '0'
                      playback_buffer_size: '0'
                      audio_out: '1'
                      mac: 00:1A:79:12:34:56
                      ip: 203.0.113.7
                      ls: ''
                      version: ''
                      lang: ''
                      locale: en_GB.utf8
                      city_id: '0'
                      hd: '1'
                      main_notify: '1'
                      fav_itv_on: '0'
                      now_playing_start: '2026-10-17 18:02:11'
                      now_playing_type: '1'
                      now_playing_content: ''
                      image_version: '218'
                      stb_type: MAG250
                      hw_version: 1.7-BD-00
                      screensaver_delay: '10'
                      last_itv_id: '1452'
                      hdmi_event_reaction: 1
                      stb_lang: en
                      record_max_length: 180
                      timeslot: 40
                      status: 0
                      update_url: ''
                      test_download_url: ''
                      default_timezone: Europe/London
                      default_locale: en_GB.utf8
                      allowed_stb_types:
                        - mag250
                        - mag254
                        - mag256
                      allowed_stb_types_for_local_recording:
                        - mag250
                        - mag254
                        - mag256
                      storages: []
                      tv_channel_default_aspect: fit
                      playback_limit: false
                      enable_playback_limit: false
                      show_tv_channel_logo: true
                      show_channel_logo_in_preview: true
                      enable_connection_problem_indication: true
                      hls_fast_start: '1'
                      check_ssl_certificate: 0
                      enable_buffering_indication: 1
                      watchdog_timeout: 97
                unverified:
                  summary: No/invalid token or failed checks (status 1), abridged
                  value:
                    js:
                      id: 0
                      name: 0
                      mac: 00:1A:79:12:34:56
                      ip: 127.0.0.1
                      locale: en_GB.utf8
                      status: 1
                      default_timezone: Europe/London
                      allowed_stb_types: []
                      storages: []
                      watchdog_timeout: 113
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=get_localization:
    get:
      operationId: Stalker_stb_get_localization
      tags:
        - Stalker Portal (MAG)
      summary: UI string table for the device locale
      description: |-
        Returns `$rLanguage[locale]` (src/Ministra/portal.php:498-947). Only `en_GB.utf8` exists. The locale is the `locale` cookie only when the cached device has no locale; otherwise it is forced to `en_GB.utf8` (src/Ministra/portal.php:281-285), so in practice the English table is always returned. Strings differ by theme: the non-`xc_vm` (legacy) theme overrides ~35 keys (src/Ministra/portal.php:904-947). A locale with no table would yield `{"js":null}`.

        Source: `src/Ministra/PortalHandler.php:230`.

        Auth: none required (handled in handleStbPublic before the auth gate, src/Ministra/PortalHandler.php:162), but token/device state still influences the answer.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_localization
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - $ref: '#/components/parameters/Stalker_LocaleCookie'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsObject'
              examples:
                ok:
                  value:
                    js:
                      layer_page: Page
                      layer_from: of
                      layer_found: Total
                      layer_records: items
                      tv_title: Live TV
                      vclub_title: Movies
                      sclub_title: TV Series
                      month_arr:
                        - JANUARY
                        - FEBRUARY
                      date_format: '{0}, {2} {1}, {3}'
                      time_format: '{0}:{1}'
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=get_modules:
    get:
      operationId: Stalker_stb_get_modules
      tags:
        - Stalker Portal (MAG)
      summary: Enabled portal modules and template
      description: |-
        Static module list. `template` is `xc_vm` when the device theme_type is 0 (or `mag_default_type` for unauthenticated boxes), else `stalker_theme` setting or `default` (src/Ministra/portal.php:488-496). Note the typo `vlub` in `switchable_modules` is emitted as-is.

        Source: `src/Ministra/PortalHandler.php:236`.

        Auth: none required (handled in handleStbPublic before the auth gate, src/Ministra/PortalHandler.php:162), but token/device state still influences the answer.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_modules
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsObject'
              examples:
                ok:
                  value:
                    js:
                      all_modules:
                        - media_browser
                        - vclub
                        - tv
                        - sclub
                        - radio
                        - dvb
                        - tv_archive
                        - time_shift
                        - time_shift_local
                        - epg.reminder
                        - epg.recorder
                        - epg
                        - epg.simple
                        - downloads_dialog
                        - downloads
                        - records
                        - pvr_local
                        - settings.parent
                        - settings.localization
                        - settings.update
                        - settings.playback
                        - settings.common
                        - settings.network_status
                        - settings
                        - account
                        - internet
                        - logout
                        - account_menu
                      switchable_modules:
                        - sclub
                        - vlub
                      disabled_modules:
                        - records
                        - downloads
                        - settings.update
                        - settings.common
                        - pvr_local
                        - media_browser
                      restricted_modules: []
                      template: xc_vm
                      launcher_url: ''
                      launcher_profile_url: ''
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=get_types_list:
    get:
      operationId: Stalker_stb_get_types_list
      tags:
        - Stalker Portal (MAG)
      summary: Allowed STB types
      description: |-
        Returns `allowed_stb_types` (re-indexed) and `strict_stb_type_check` (`""` when unset).

        Source: `src/Ministra/PortalHandler.php:218`.

        Auth: none required (handled in handleStbPublic before the auth gate, src/Ministra/PortalHandler.php:162), but token/device state still influences the answer.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_types_list
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsObject'
              examples:
                ok:
                  value:
                    js:
                      allowed_stb_types:
                        - mag250
                        - mag254
                        - mag256
                      strict_stb_type_check: ''
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=log:
    get:
      operationId: Stalker_stb_log
      tags:
        - Stalker Portal (MAG)
      summary: Client log sink (no-op)
      description: |-
        Swallowed; also duplicated in handleStbPublic (src/Ministra/PortalHandler.php:233) but the pre-init stub answers first.

        Source: `src/Ministra/PortalHandler.php:57`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - log
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsTrue'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=stb&action=get_ad:
    get:
      operationId: Stalker_stb_get_ad
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: get_ad (always empty)'
      description: |-
        Hard-coded empty list.

        Source: `src/Ministra/PortalHandler.php:51`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_ad
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsEmptyArray'
              examples:
                ok:
                  value:
                    js: []
  /portal.php?type=stb&action=get_storages:
    get:
      operationId: Stalker_stb_get_storages
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: get_storages (always empty)'
      description: |-
        Hard-coded empty list.

        Source: `src/Ministra/PortalHandler.php:54`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_storages
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsEmptyArray'
              examples:
                ok:
                  value:
                    js: []
  /portal.php?type=stb&action=get_countries:
    get:
      operationId: Stalker_stb_get_countries
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: get_countries (always empty)'
      description: |-
        Hard-coded empty list.

        Source: `src/Ministra/PortalHandler.php:60`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_countries
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsEmptyArray'
              examples:
                ok:
                  value:
                    js: []
  /portal.php?type=stb&action=get_timezones:
    get:
      operationId: Stalker_stb_get_timezones
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: get_timezones (always empty)'
      description: |-
        Hard-coded empty list.

        Source: `src/Ministra/PortalHandler.php:63`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_timezones
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsEmptyArray'
              examples:
                ok:
                  value:
                    js: []
  /portal.php?type=stb&action=get_cities:
    get:
      operationId: Stalker_stb_get_cities
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: get_cities (always empty)'
      description: |-
        Hard-coded empty list.

        Source: `src/Ministra/PortalHandler.php:66`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_cities
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsEmptyArray'
              examples:
                ok:
                  value:
                    js: []
  /portal.php?type=stb&action=search_cities:
    get:
      operationId: Stalker_stb_search_cities
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: search_cities (always empty)'
      description: |-
        Hard-coded empty list.

        Source: `src/Ministra/PortalHandler.php:69`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - search_cities
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsEmptyArray'
              examples:
                ok:
                  value:
                    js: []
  /portal.php?type=stb&action=get_preload_images:
    get:
      operationId: Stalker_stb_get_preload_images
      tags:
        - Stalker Portal (MAG)
      summary: Theme images to pre-cache
      description: |-
        Relative image paths `template/<theme>/<i|i_<gmode>>/<file>.png`, filtered to files that exist on disk. `gmode` (int) selects the resolution folder.

        Source: `src/Ministra/PortalHandler.php:391`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_preload_images
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: gmode
          in: query
          required: false
          schema:
            type: integer
            example: 720
          description: Graphic mode; folder `i_<gmode>` when numeric, else `i`.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsStringArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - template/xc_vm/i_720/bg.png
                      - template/xc_vm/i_720/logo.png
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=get_settings_profile:
    get:
      operationId: Stalker_stb_get_settings_profile
      tags:
        - Stalker Portal (MAG)
      summary: Settings-menu profile
      description: |-
        Static `modules` tree plus device settings read from `mag_devices` (DB strings). Subtitle languages are blanked unless `always_enabled_subtitles` = 1.

        Source: `src/Ministra/PortalHandler.php:440`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_settings_profile
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsObject'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      modules:
                        - name: lock
                        - name: lang
                        - name: net_info
                          sub:
                            - name: wired
                        - name: reboot
                      parent_password: '0000'
                      update_url: ''
                      test_download_url: ''
                      playback_buffer_size: '0'
                      screensaver_delay: '10'
                      plasma_saving: '0'
                      spdif_mode: '1'
                      ts_enabled: '0'
                      ts_enable_icon: '1'
                      ts_path: ''
                      ts_max_length: '3600'
                      ts_buffer_use: cyclic
                      ts_action_on_exit: no_save
                      ts_delay: on_pause
                      hdmi_event_reaction: '1'
                      pri_audio_lang: ''
                      show_after_loading: ''
                      sec_audio_lang: ''
                      sec_subtitle_lang: ''
                      pri_subtitle_lang: ''
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=get_locales:
    get:
      operationId: Stalker_stb_get_locales
      tags:
        - Stalker Portal (MAG)
      summary: Available UI locales
      description: |-
        Two fixed locales (English `en_GB.utf8`, Greek `el_GR.utf8`). Quirk: the loop overwrites the DB row variable with the flag, so only the first entry can ever be `selected: 1` (src/Ministra/PortalHandler.php:547-550).

        Source: `src/Ministra/PortalHandler.php:539`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_locales
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - label: English
                        value: en_GB.utf8
                        selected: 1
                      - label: Ελληνικά
                        value: el_GR.utf8
                        selected: 0
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=get_tv_aspects:
    get:
      operationId: Stalker_stb_get_tv_aspects
      tags:
        - Stalker Portal (MAG)
      summary: Per-channel aspect overrides
      description: |-
        Not wrapped: echoes the raw stored `mag_devices.aspect` JSON text (`{"js":{"<ch_id>":"<aspect>"}}`) when set, else `json_encode` of the empty value (`""` or `null`).

        Source: `src/Ministra/PortalHandler.php:554`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_tv_aspects
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - type:
                      - object
                      - 'null'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                stored:
                  value:
                    js:
                      '1452': '16'
                none:
                  value: null
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=set_volume:
    get:
      operationId: Stalker_stb_set_volume
      tags:
        - Stalker Portal (MAG)
      summary: Save volume
      description: |-
        Updates `mag_devices.volume`. Quirk: replies `{"data":true}` (not `js`). Empty/0 `vol` -> nothing written, empty 200 body.

        Source: `src/Ministra/PortalHandler.php:561`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_volume
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: vol
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
          description: Volume.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_DataTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    data: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=set_aspect:
    get:
      operationId: Stalker_stb_set_aspect
      tags:
        - Stalker Portal (MAG)
      summary: Save aspect for a channel
      description: |-
        Merges `{ch_id: aspect}` into `mag_devices.aspect` JSON.

        Source: `src/Ministra/PortalHandler.php:578`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_aspect
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: ch_id
          in: query
          required: false
          schema:
            type: string
          description: Channel id.
        - name: aspect
          in: query
          required: false
          schema:
            type: string
          description: Aspect code.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=set_stream_error:
    get:
      operationId: Stalker_stb_set_stream_error
      tags:
        - Stalker Portal (MAG)
      summary: Report stream error (no-op)
      description: |-
        Acknowledged only.

        Source: `src/Ministra/PortalHandler.php:605`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_stream_error
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=set_screensaver_delay:
    get:
      operationId: Stalker_stb_set_screensaver_delay
      tags:
        - Stalker Portal (MAG)
      summary: Save screensaver delay
      description: |-
        Written only when the request carries any Cookie header.

        Source: `src/Ministra/PortalHandler.php:608`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_screensaver_delay
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: screensaver_delay
          in: query
          required: false
          schema:
            type: integer
          description: Minutes.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=set_playback_buffer:
    get:
      operationId: Stalker_stb_set_playback_buffer
      tags:
        - Stalker Portal (MAG)
      summary: Save playback buffer
      description: |-
        Written only when the request carries any Cookie header.

        Source: `src/Ministra/PortalHandler.php:622`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_playback_buffer
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: playback_buffer_bytes
          in: query
          required: false
          schema:
            type: integer
          description: ''
        - name: playback_buffer_size
          in: query
          required: false
          schema:
            type: integer
          description: ''
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=set_plasma_saving:
    get:
      operationId: Stalker_stb_set_plasma_saving
      tags:
        - Stalker Portal (MAG)
      summary: Save plasma saving flag
      description: |-
        Updates `mag_devices.plasma_saving`.

        Source: `src/Ministra/PortalHandler.php:639`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_plasma_saving
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: plasma_saving
          in: query
          required: false
          schema:
            type: integer
            enum:
              - 0
              - 1
          description: ''
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=set_parent_password:
    get:
      operationId: Stalker_stb_set_parent_password
      tags:
        - Stalker Portal (MAG)
      summary: Change parental PIN
      description: |-
        Saves `pass` when `parent_password`, `pass`, `repeat_pass` are all present and `pass == repeat_pass`. Quirk: the CURRENT password is NOT checked, and mismatches also return `{"js":true}`.

        Source: `src/Ministra/PortalHandler.php:651`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_parent_password
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: parent_password
          in: query
          required: false
          schema:
            type: string
          description: Current PIN (presence only).
        - name: pass
          in: query
          required: false
          schema:
            type: string
          description: New PIN.
        - name: repeat_pass
          in: query
          required: false
          schema:
            type: string
          description: Must equal `pass`.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=set_locale:
    get:
      operationId: Stalker_stb_set_locale
      tags:
        - Stalker Portal (MAG)
      summary: Save locale
      description: |-
        Updates `mag_devices.locale` when non-empty. Replies `{"js":[]}`.

        Source: `src/Ministra/PortalHandler.php:670`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_locale
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: locale
          in: query
          required: false
          schema:
            type: string
            example: en_GB.utf8
          description: ''
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsEmptyArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: []
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=set_hdmi_reaction:
    get:
      operationId: Stalker_stb_set_hdmi_reaction
      tags:
        - Stalker Portal (MAG)
      summary: Save HDMI event reaction
      description: |-
        Written only when a Cookie header is present and `data` is set.

        Source: `src/Ministra/PortalHandler.php:683`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_hdmi_reaction
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: data
          in: query
          required: false
          schema:
            type: string
          description: Reaction value.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=set_modern:
    get:
      operationId: Stalker_stb_set_modern
      tags:
        - Stalker Portal (MAG)
      summary: Switch to modern (xc_vm) theme
      description: |-
        Sets `theme_type = 0`. Replies `{"data":true}`.

        Source: `src/Ministra/PortalHandler.php:371`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_modern
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_DataTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    data: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=stb&action=set_legacy:
    get:
      operationId: Stalker_stb_set_legacy
      tags:
        - Stalker Portal (MAG)
      summary: Switch to legacy Stalker theme
      description: |-
        Sets `theme_type = 1`. Replies `{"data":true}`.

        Source: `src/Ministra/PortalHandler.php:381`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - stb
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_legacy
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_DataTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    data: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=watchdog&action=get_events:
    get:
      operationId: Stalker_watchdog_get_events
      tags:
        - Stalker Portal (MAG)
      summary: Poll for pending device events (keep-alive)
      description: |-
        Every watchdog call first updates `mag_devices.last_watchdog` (src/Ministra/PortalHandler.php:709-715). Returns the oldest unread `mag_events` row. Events `reboot`, `reload_portal`, `play_channel`, `cut_off` are auto-marked read; others wait for `confirm_event`. With no event: `{"js":{"data":{"msgs":0,"additional_services_on":1}}}` (ints). With an event, DB values are strings and `send_time` is `d-m-Y H:i:s`.

        Source: `src/Ministra/PortalHandler.php:718`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - watchdog
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_events
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: init
          in: query
          required: false
          schema:
            type: integer
          description: Sent by firmware; ignored.
        - name: cur_play_type
          in: query
          required: false
          schema:
            type: integer
          description: Ignored.
        - name: event_active_id
          in: query
          required: false
          schema:
            type: integer
          description: Ignored here.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_WatchdogEvents'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                none:
                  value:
                    js:
                      data:
                        msgs: 0
                        additional_services_on: 1
                message:
                  value:
                    js:
                      data:
                        msgs: '1'
                        id: '88'
                        event: send_msg
                        need_confirm: '1'
                        msg: Your subscription expires tomorrow.
                        reboot_after_ok: '0'
                        auto_hide_timeout: '0'
                        send_time: 17-10-2026 18:00:00
                        additional_services_on: '1'
                        updated:
                          anec: '0'
                          vclub: '0'
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=watchdog&action=confirm_event:
    get:
      operationId: Stalker_watchdog_confirm_event
      tags:
        - Stalker Portal (MAG)
      summary: Mark an event as read
      description: |-
        Sets `mag_events.status = 1` for `event_active_id` (not scoped to the device). Missing id -> empty 200 body.

        Source: `src/Ministra/PortalHandler.php:757`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - watchdog
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - confirm_event
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: event_active_id
          in: query
          required: true
          schema:
            type: integer
          description: Event id from get_events.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsObject'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      data: ok
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=itv&action=get_genres:
    get:
      operationId: Stalker_itv_get_genres
      tags:
        - Stalker Portal (MAG)
      summary: Live TV categories
      description: |-
        Live categories in the device bouquets, optionally preceded by `{"id":"*","title":"All","alias":"All","active_sub":true,"censored":0}` when `show_all_category_mag` = 1. Adult categories get alias `for adults` so the PIN is asked once per genre (src/Ministra/PortalHandler.php:37). `censored` is an int (issue #393).

        Source: `src/Ministra/PortalHandler.php:1018`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - itv
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_genres
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_CategoryList'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - id: '*'
                        title: All
                        alias: All
                        active_sub: true
                        censored: 0
                      - id: '12'
                        title: UK Entertainment
                        modified: ''
                        number: '1'
                        alias: uk entertainment
                        censored: 0
                      - id: '40'
                        title: XXX
                        modified: ''
                        number: '2'
                        alias: for adults
                        censored: 1
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=itv&action=get_ordered_list:
    get:
      operationId: Stalker_itv_get_ordered_list
      tags:
        - Stalker Portal (MAG)
      summary: Paged live channel list
      description: |-
        Paged with `max_page_items` = 10 (xc_vm theme) or 14 (legacy theme). When `p` is 0/absent the page containing `last_itv_id` is chosen and `selected_item` is its 1-based position on that page (src/Ministra/portal.php:2141-2170). Channel ints are stringified for C firmware (ids, numbers, `status`, `use_http_tmp_link`, `tv_archive_duration`...) while 0/1 flags (`censored`, `lock`, `locked`, `fav`, `archive`, `pvr`, `hd`, `open`, `enable_tv_archive`, `allow_*pvr`, `use_load_balancing`) stay integers (src/Ministra/portal.php:2348-2371). `cmd` is `<player> <url>`: player = device `mag_player` or `ffmpeg`. With `mag_security` = 0 the URL is a ready signed link `<site_url>play/<token>[?ext=.<mag_container>]`; otherwise `http://localhost/ch/<id>_` and the box must call `itv/create_link`. `tv_archive_duration` is in hours (days*24). `cur_playing` is "HH:MM - HH:MM: title" in the `timezone` cookie zone or "No channel information is available...". `sortby`: `name`, `number` (default: bouquet/manual order), `top`/`rating`, `added`. `fav=1` restricts to favourites; `search` matches `stream_display_name` LIKE.

        Source: `src/Ministra/PortalHandler.php:915`, `src/Ministra/portal.php:2122`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - itv
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_ordered_list
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - $ref: '#/components/parameters/Stalker_TimezoneCookie'
        - name: genre
          in: query
          required: false
          schema:
            type: string
            example: '12'
          description: Category id; `*` or non-numeric = all. `-1` = all channels only if `mag_load_all_channels`, else a hard-coded empty page.
        - $ref: '#/components/parameters/Stalker_Page'
        - name: sortby
          in: query
          required: false
          schema:
            type: string
            enum:
              - number
              - name
              - added
              - top
              - rating
          description: Sort order.
        - name: fav
          in: query
          required: false
          schema:
            type: integer
            enum:
              - 0
              - 1
          description: Favourites only.
        - name: search
          in: query
          required: false
          schema:
            type: string
          description: Name substring.
        - name: hd
          in: query
          required: false
          schema:
            type: integer
          description: Sent by firmware; ignored.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_ChannelPage'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      total_items: 245
                      max_page_items: 10
                      selected_item: 3
                      cur_page: 1
                      data:
                        - id: '1452'
                          name: BBC One HD
                          number: '3'
                          snumber: '3'
                          censored: 0
                          cmd: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
                          cost: '0'
                          count: '0'
                          status: '1'
                          tv_genre_id: '12'
                          base_ch: '1'
                          hd: 1
                          xmltv_id: bbc1.uk
                          service_id: ''
                          bonus_ch: '0'
                          volume_correction: '0'
                          use_http_tmp_link: '0'
                          mc_cmd: ''
                          enable_tv_archive: 1
                          wowza_tmp_link: '0'
                          wowza_dvr: '0'
                          monitoring_status: '1'
                          enable_monitoring: '0'
                          enable_wowza_load_balancing: '0'
                          cmd_1: ''
                          cmd_2: ''
                          cmd_3: ''
                          logo: http://line.example.com:80/images/bbc1.png
                          correct_time: '0'
                          nimble_dvr: '0'
                          allow_pvr: 0
                          allow_local_pvr: 0
                          allow_remote_pvr: 0
                          modified: ''
                          allow_local_timeshift: '1'
                          nginx_secure_link: '0'
                          tv_archive_duration: '168'
                          locked: 0
                          lock: 0
                          fav: 1
                          archive: 1
                          genres_str: ''
                          cur_playing: '18:00 - 18:30: BBC News at Six'
                          epg: []
                          open: 1
                          cmds:
                            - id: '1452'
                              ch_id: '1452'
                              priority: '0'
                              url: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
                              status: '1'
                              use_http_tmp_link: '0'
                              wowza_tmp_link: '0'
                              user_agent_filter: ''
                              use_load_balancing: '0'
                              changed: ''
                              enable_monitoring: '0'
                              enable_balancer_monitoring: '0'
                              nginx_secure_link: '0'
                              flussonic_tmp_link: '0'
                          use_load_balancing: 0
                          pvr: 0
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=itv&action=get_all_channels:
    get:
      operationId: Stalker_itv_get_all_channels
      tags:
        - Stalker Portal (MAG)
      summary: All live channels (unpaged)
      description: |-
        Paged with `max_page_items` = 10 (xc_vm theme) or 14 (legacy theme). When `p` is 0/absent the page containing `last_itv_id` is chosen and `selected_item` is its 1-based position on that page (src/Ministra/portal.php:2141-2170). Channel ints are stringified for C firmware (ids, numbers, `status`, `use_http_tmp_link`, `tv_archive_duration`...) while 0/1 flags (`censored`, `lock`, `locked`, `fav`, `archive`, `pvr`, `hd`, `open`, `enable_tv_archive`, `allow_*pvr`, `use_load_balancing`) stay integers (src/Ministra/portal.php:2348-2371). `cmd` is `<player> <url>`: player = device `mag_player` or `ffmpeg`. With `mag_security` = 0 the URL is a ready signed link `<site_url>play/<token>[?ext=.<mag_container>]`; otherwise `http://localhost/ch/<id>_` and the box must call `itv/create_link`. `tv_archive_duration` is in hours (days*24). `cur_playing` is "HH:MM - HH:MM: title" in the `timezone` cookie zone or "No channel information is available...". Returns every channel (no LIMIT); `cur_page` is always 0 but `total_items`/`max_page_items` are still set.

        Source: `src/Ministra/PortalHandler.php:907`, `src/Ministra/portal.php:2122`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - itv
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_all_channels
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - $ref: '#/components/parameters/Stalker_TimezoneCookie'
        - name: genre
          in: query
          required: false
          schema:
            type: string
            example: '12'
          description: Category id; `*` or non-numeric = all. `-1` = all channels only if `mag_load_all_channels`, else a hard-coded empty page.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_ChannelPage'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      total_items: 245
                      max_page_items: 10
                      selected_item: 0
                      cur_page: 0
                      data:
                        - id: '1452'
                          name: BBC One HD
                          number: '3'
                          snumber: '3'
                          censored: 0
                          cmd: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
                          cost: '0'
                          count: '0'
                          status: '1'
                          tv_genre_id: '12'
                          base_ch: '1'
                          hd: 1
                          xmltv_id: bbc1.uk
                          service_id: ''
                          bonus_ch: '0'
                          volume_correction: '0'
                          use_http_tmp_link: '0'
                          mc_cmd: ''
                          enable_tv_archive: 1
                          wowza_tmp_link: '0'
                          wowza_dvr: '0'
                          monitoring_status: '1'
                          enable_monitoring: '0'
                          enable_wowza_load_balancing: '0'
                          cmd_1: ''
                          cmd_2: ''
                          cmd_3: ''
                          logo: http://line.example.com:80/images/bbc1.png
                          correct_time: '0'
                          nimble_dvr: '0'
                          allow_pvr: 0
                          allow_local_pvr: 0
                          allow_remote_pvr: 0
                          modified: ''
                          allow_local_timeshift: '1'
                          nginx_secure_link: '0'
                          tv_archive_duration: '168'
                          locked: 0
                          lock: 0
                          fav: 1
                          archive: 1
                          genres_str: ''
                          cur_playing: '18:00 - 18:30: BBC News at Six'
                          epg: []
                          open: 1
                          cmds:
                            - id: '1452'
                              ch_id: '1452'
                              priority: '0'
                              url: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
                              status: '1'
                              use_http_tmp_link: '0'
                              wowza_tmp_link: '0'
                              user_agent_filter: ''
                              use_load_balancing: '0'
                              changed: ''
                              enable_monitoring: '0'
                              enable_balancer_monitoring: '0'
                              nginx_secure_link: '0'
                              flussonic_tmp_link: '0'
                          use_load_balancing: 0
                          pvr: 0
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=itv&action=get_all_fav_channels:
    get:
      operationId: Stalker_itv_get_all_fav_channels
      tags:
        - Stalker Portal (MAG)
      summary: All favourite live channels (unpaged)
      description: |-
        Paged with `max_page_items` = 10 (xc_vm theme) or 14 (legacy theme). When `p` is 0/absent the page containing `last_itv_id` is chosen and `selected_item` is its 1-based position on that page (src/Ministra/portal.php:2141-2170). Channel ints are stringified for C firmware (ids, numbers, `status`, `use_http_tmp_link`, `tv_archive_duration`...) while 0/1 flags (`censored`, `lock`, `locked`, `fav`, `archive`, `pvr`, `hd`, `open`, `enable_tv_archive`, `allow_*pvr`, `use_load_balancing`) stay integers (src/Ministra/portal.php:2348-2371). `cmd` is `<player> <url>`: player = device `mag_player` or `ffmpeg`. With `mag_security` = 0 the URL is a ready signed link `<site_url>play/<token>[?ext=.<mag_container>]`; otherwise `http://localhost/ch/<id>_` and the box must call `itv/create_link`. `tv_archive_duration` is in hours (days*24). `cur_playing` is "HH:MM - HH:MM: title" in the `timezone` cookie zone or "No channel information is available...". Same as get_all_channels restricted to `fav_channels.live`.

        Source: `src/Ministra/PortalHandler.php:926`, `src/Ministra/portal.php:2122`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - itv
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_all_fav_channels
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - $ref: '#/components/parameters/Stalker_TimezoneCookie'
        - name: genre
          in: query
          required: false
          schema:
            type: string
            example: '12'
          description: Category id; `*` or non-numeric = all. `-1` = all channels only if `mag_load_all_channels`, else a hard-coded empty page.
        - name: fav
          in: query
          required: false
          schema:
            type: integer
          description: Ignored (always favourites).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_ChannelPage'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      total_items: 1
                      max_page_items: 10
                      selected_item: 0
                      cur_page: 0
                      data:
                        - id: '1452'
                          name: BBC One HD
                          number: '3'
                          snumber: '3'
                          censored: 0
                          cmd: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
                          cost: '0'
                          count: '0'
                          status: '1'
                          tv_genre_id: '12'
                          base_ch: '1'
                          hd: 1
                          xmltv_id: bbc1.uk
                          service_id: ''
                          bonus_ch: '0'
                          volume_correction: '0'
                          use_http_tmp_link: '0'
                          mc_cmd: ''
                          enable_tv_archive: 1
                          wowza_tmp_link: '0'
                          wowza_dvr: '0'
                          monitoring_status: '1'
                          enable_monitoring: '0'
                          enable_wowza_load_balancing: '0'
                          cmd_1: ''
                          cmd_2: ''
                          cmd_3: ''
                          logo: http://line.example.com:80/images/bbc1.png
                          correct_time: '0'
                          nimble_dvr: '0'
                          allow_pvr: 0
                          allow_local_pvr: 0
                          allow_remote_pvr: 0
                          modified: ''
                          allow_local_timeshift: '1'
                          nginx_secure_link: '0'
                          tv_archive_duration: '168'
                          locked: 0
                          lock: 0
                          fav: 1
                          archive: 1
                          genres_str: ''
                          cur_playing: '18:00 - 18:30: BBC News at Six'
                          epg: []
                          open: 1
                          cmds:
                            - id: '1452'
                              ch_id: '1452'
                              priority: '0'
                              url: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
                              status: '1'
                              use_http_tmp_link: '0'
                              wowza_tmp_link: '0'
                              user_agent_filter: ''
                              use_load_balancing: '0'
                              changed: ''
                              enable_monitoring: '0'
                              enable_balancer_monitoring: '0'
                              nginx_secure_link: '0'
                              flussonic_tmp_link: '0'
                          use_load_balancing: 0
                          pvr: 0
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=itv&action=create_link:
    get:
      operationId: Stalker_itv_create_link
      tags:
        - Stalker Portal (MAG)
      summary: Resolve a channel cmd to a playable URL
      description: |-
        Parses `cmd` after `http://localhost/ch/` as `<stream_id>_<value>`. Empty `<value>` -> a signed link is minted from `ministra::live/<username>/<password>/<stream_id>/<mag_container>/<device token>` (`live_streaming_pass`, sealed when `secure_stream_tokens`) as `<site_url|http_url>play/<token>[?ext=.<mag_container>]` (http_url when `mag_disable_ssl`). Non-empty `<value>` is returned verbatim prefixed with the player (no validation). No bouquet check here: entitlement is enforced when `/play/<token>` is fetched.

        Quirk: `streamer_id`, `link_id`, `load`, `error` sit at the TOP level beside `js`, not inside it. `js.id` is the parsed id as a string.

        Source: `src/Ministra/PortalHandler.php:822`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - itv
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_link
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: cmd
          in: query
          required: true
          schema:
            type: string
            example: ffmpeg http://localhost/ch/1452_
          description: Channel `cmd` from the list.
        - name: series
          in: query
          required: false
          schema:
            type: string
          description: Ignored.
        - name: forced_storage
          in: query
          required: false
          schema:
            type: string
          description: Ignored.
        - name: disable_ad
          in: query
          required: false
          schema:
            type: string
          description: Ignored.
        - name: download
          in: query
          required: false
          schema:
            type: string
          description: Ignored.
        - name: force_ch_link_check
          in: query
          required: false
          schema:
            type: string
          description: Ignored.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_ItvCreateLink'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      id: '1452'
                      cmd: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
                    streamer_id: 0
                    link_id: 0
                    load: 0
                    error: ''
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=itv&action=get_short_epg:
    get:
      operationId: Stalker_itv_get_short_epg
      tags:
        - Stalker Portal (MAG)
      summary: Now/next EPG for a channel
      description: |-
        Current and upcoming programmes from the EPG file cache. Times are shifted to the `timezone` cookie zone. `size` caps the count (default 4) - quirk: the cap is implemented by not advancing the index, so the last slot is overwritten by later programmes instead of stopping (src/Ministra/PortalHandler.php:993). Missing `ch_id` -> `{"js":[]}`.

        Source: `src/Ministra/PortalHandler.php:937`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - itv
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_short_epg
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - $ref: '#/components/parameters/Stalker_TimezoneCookie'
        - name: ch_id
          in: query
          required: true
          schema:
            type: string
          description: Stream id.
        - name: size
          in: query
          required: false
          schema:
            type: integer
            default: 4
          description: Max items.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_ShortEpg'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - id: 9c1f0e
                        ch_id: '1452'
                        correct: '2026-10-17 18:00:00'
                        time: '2026-10-17 18:00:00'
                        time_to: '2026-10-17 18:30:00'
                        duration: 1800
                        name: BBC News at Six
                        descr: The latest national and international news.
                        real_id: 1452_1760720400
                        category: ''
                        director: ''
                        actor: ''
                        start_timestamp: 1760720400
                        stop_timestamp: 1760722200
                        t_time: '18:00'
                        t_time_to: '18:30'
                        mark_memo: 0
                        mark_archive: 0
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=itv&action=get_epg_info:
    get:
      operationId: Stalker_itv_get_epg_info
      tags:
        - Stalker Portal (MAG)
      summary: Multi-channel EPG (stub)
      description: |-
        Always empty.

        Source: `src/Ministra/PortalHandler.php:934`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - itv
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_epg_info
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsObject'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      data: []
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=itv&action=set_fav:
    get:
      operationId: Stalker_itv_set_fav
      tags:
        - Stalker Portal (MAG)
      summary: Replace live favourites
      description: |-
        Replaces `fav_channels.live` with the comma-separated ids (ints, zeros dropped).

        Source: `src/Ministra/PortalHandler.php:887`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - itv
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_fav
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: fav_ch
          in: query
          required: false
          schema:
            type: string
            example: 1452,1460,2001
          description: Comma-separated stream ids; empty clears.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=itv&action=get_fav_ids:
    get:
      operationId: Stalker_itv_get_fav_ids
      tags:
        - Stalker Portal (MAG)
      summary: Live favourite ids
      description: |-
        String ids in a JSON array (re-indexed so never an object).

        Source: `src/Ministra/PortalHandler.php:900`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - itv
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_fav_ids
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsStringArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - '1452'
                      - '1460'
                      - '2001'
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=itv&action=set_last_id:
    get:
      operationId: Stalker_itv_set_last_id
      tags:
        - Stalker Portal (MAG)
      summary: Remember last watched channel
      description: |-
        Saves `last_itv_id` when `id` > 0 (used to pick the default page).

        Source: `src/Ministra/PortalHandler.php:1003`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - itv
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_last_id
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: id
          in: query
          required: false
          schema:
            type: integer
          description: Stream id.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=itv&action=set_claim:
    get:
      operationId: Stalker_itv_set_claim
      tags:
        - Stalker Portal (MAG)
      summary: Report a problem with a channel
      description: |-
        Inserts into `mag_claims` when `id` and `real_type` are present.

        Source: `src/Ministra/PortalHandler.php:871`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - itv
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_claim
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: id
          in: query
          required: false
          schema:
            type: integer
          description: Stream id.
        - name: real_type
          in: query
          required: false
          schema:
            type: string
            example: video
          description: Claim kind.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=itv&action=set_fav_status:
    get:
      operationId: Stalker_itv_set_fav_status
      tags:
        - Stalker Portal (MAG)
      summary: Stub
      description: |-
        No-op.

        Source: `src/Ministra/PortalHandler.php:143`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - itv
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_fav_status
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsEmptyArray'
              examples:
                ok:
                  value:
                    js: []
  /portal.php?type=itv&action=set_played:
    get:
      operationId: Stalker_itv_set_played
      tags:
        - Stalker Portal (MAG)
      summary: Stub
      description: |-
        No-op.

        Source: `src/Ministra/PortalHandler.php:146`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - itv
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_played
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsTrue'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=vod&action=get_categories:
    get:
      operationId: Stalker_vod_get_categories
      tags:
        - Stalker Portal (MAG)
      summary: VOD categories
      description: |-
        Movie categories in the bouquets; optional leading `{"id":"*","title":"All","alias":"*","censored":0}` when `show_all_category_mag` = 1. Here alias is the category NAME (clients filter by it).

        Source: `src/Ministra/PortalHandler.php:1119`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - vod
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_categories
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_CategoryList'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - id: '*'
                        title: All
                        alias: '*'
                        censored: 0
                      - id: '5'
                        title: Movies 2024
                        alias: Movies 2024
                        censored: 0
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=vod&action=get_genres_by_category_alias:
    get:
      operationId: Stalker_vod_get_genres_by_category_alias
      tags:
        - Stalker Portal (MAG)
      summary: VOD "genres" (= categories) for the picker
      description: |-
        Always starts with `{"id":"*","title":"*"}`, then every movie category; the `cat_alias` argument is ignored.

        Source: `src/Ministra/PortalHandler.php:1147`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - vod
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_genres_by_category_alias
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: cat_alias
          in: query
          required: false
          schema:
            type: string
          description: Ignored.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - id: '*'
                        title: '*'
                      - id: '5'
                        title: Movies 2024
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=vod&action=get_years:
    get:
      operationId: Stalker_vod_get_years
      tags:
        - Stalker Portal (MAG)
      summary: Year picker values
      description: |-
        `*` then every year 1900..current. `id`/`title` are ints except the `*` entry.

        Source: `src/Ministra/PortalHandler.php:1164`, `src/Ministra/portal.php:442`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - vod
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_years
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - id: '*'
                        title: '*'
                      - id: 1900
                        title: 1900
                      - id: 2026
                        title: 2026
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=vod&action=get_abc:
    get:
      operationId: Stalker_vod_get_abc
      tags:
        - Stalker Portal (MAG)
      summary: Letter picker values
      description: |-
        Static `*`, A..Z. Quirk: the list contains `G` twice (instead of J) and `W` twice (instead of Y) (src/Ministra/portal.php:459, :474).

        Source: `src/Ministra/PortalHandler.php:1275`, `src/Ministra/portal.php:447`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - vod
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_abc
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - id: '*'
                        title: '*'
                      - id: A
                        title: A
                      - id: G
                        title: G
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=vod&action=get_ordered_list:
    get:
      operationId: Stalker_vod_get_ordered_list
      tags:
        - Stalker Portal (MAG)
      summary: Paged movie list
      description: |-
        Movies in the device bouquets (src/Ministra/portal.php:1614). `category` must be numeric to filter. `sortby` default `added`. Page size as for channels (10/14). `cur_page` is the page number when `p` was 0/absent (default page) and **0** when an explicit `p` was given; `selected_item` is always 0.

        Item `cmd` is base64 of JSON `{"type":"movie","stream_id":"<id>","target_container":"<ext>"}` to pass to `vod/create_link`. One of the keys `today`/`yesterday`/`week_and_more` is present (dynamic key) with a human date. DB columns arrive as strings (`id`, `year`, `tmdb_id` may be int or string per metadata JSON); `category_id` is an int from the category JSON (or the requested string).

        Source: `src/Ministra/PortalHandler.php:1167`, `src/Ministra/portal.php:1614`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - vod
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_ordered_list
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: category
          in: query
          required: false
          schema:
            type: string
            example: '5'
          description: Numeric category id; `*` = all.
        - $ref: '#/components/parameters/Stalker_Page'
        - name: sortby
          in: query
          required: false
          schema:
            type: string
            enum:
              - added
              - name
              - top
              - rating
              - number
            default: added
          description: ''
        - name: fav
          in: query
          required: false
          schema:
            type: integer
            enum:
              - 0
              - 1
          description: Favourites only.
        - name: search
          in: query
          required: false
          schema:
            type: string
          description: Name substring.
        - name: abc
          in: query
          required: false
          schema:
            type: string
            default: '*'
          description: First letter filter.
        - name: genre
          in: query
          required: false
          schema:
            type: string
            default: '*'
          description: Category id filter (from get_genres_by_category_alias).
        - name: years
          in: query
          required: false
          schema:
            type: string
            default: '*'
          description: Year filter.
        - name: not_ended
          in: query
          required: false
          schema:
            type: integer
          description: Ignored.
        - name: hd
          in: query
          required: false
          schema:
            type: integer
          description: Ignored.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_VodPage'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      total_items: 1243
                      max_page_items: 10
                      selected_item: 0
                      cur_page: 1
                      data:
                        - id: '2301'
                          owner: ''
                          name: 'Dune: Part Two'
                          tmdb_id: 693134
                          old_name: ''
                          o_name: 'Dune: Part Two'
                          fname: ''
                          description: Paul Atreides unites with the Fremen...
                          pic: ''
                          cost: 0
                          time: 166
                          file: ''
                          path: Dune:_Part_Two
                          protocol: ''
                          rtsp_url: ''
                          censored: 0
                          series: []
                          volume_correction: 0
                          category_id: 5
                          genre_id: 0
                          genre_id_1: 0
                          genre_id_2: 0
                          genre_id_3: 0
                          hd: 1
                          genre_id_4: 0
                          cat_genre_id_1: 5
                          cat_genre_id_2: 0
                          cat_genre_id_3: 0
                          cat_genre_id_4: 0
                          director: Denis Villeneuve
                          actors: Timothée Chalamet, Zendaya
                          year: '2024'
                          accessed: 1
                          status: 1
                          disable_for_hd_devices: 0
                          added: '2026-10-10 09:12:44'
                          count: 0
                          count_first_0_5: 0
                          count_second_0_5: 0
                          vote_sound_good: 0
                          vote_sound_bad: 0
                          vote_video_good: 0
                          vote_video_bad: 0
                          rate: ''
                          last_rate_update: ''
                          last_played: ''
                          for_sd_stb: 0
                          rating_im: '8.2'
                          rating_count_im: ''
                          rating_last_update: '1899-11-30T00:00:00.000Z'
                          age: 12+
                          high_quality: 0
                          rating_kinopoisk: '8.2'
                          comments: ''
                          low_quality: 0
                          is_series: 0
                          year_end: 0
                          autocomplete_provider: im
                          screenshots: ''
                          is_movie: 1
                          lock: 0
                          fav: 0
                          for_rent: 0
                          screenshot_uri: https://image.tmdb.org/t/p/w600_and_h900_bestv2/poster.jpg
                          genres_str: Science Fiction, Adventure
                          cmd: eyJ0eXBlIjoibW92aWUiLCJzdHJlYW1faWQiOiIyMzAxIiwidGFyZ2V0X2NvbnRhaW5lciI6Im1rdiJ9
                          week_and_more: Oct 10th 2026
                          has_files: 0
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=vod&action=create_link:
    get:
      operationId: Stalker_vod_create_link
      tags:
        - Stalker Portal (MAG)
      summary: Resolve a movie or episode to a playable URL
      description: |-
        Used for BOTH movies and series episodes (the client always sends `type=vod`). `cmd` is either base64 JSON (`{"type":"movie","stream_id","target_container"}` from vod lists, or `{"series_id","season_num","type":"series"}` from series season items) or a path containing `/media/` (`/media/<series_id>:<season_num>.mpg`) which is treated as series. A non-zero `series` forces series mode and selects the N-th episode (1-based, ordered by `episode_num`) of that season. URL = `<player> <site_url|http_url>play/<token>[?ext=.<container>]` minted from `ministra::<movie|series>/<username>/<password>/<stream_id>/<container>/<device token>`.

        Quirks: the entitlement result (`$rValid`) is computed but never used (src/Ministra/PortalHandler.php:1197-1232) - a link is minted for any id; access is enforced later by `/play/` auth. Episode not found (incl. series mode with `series` = 0 -> `LIMIT -1`) sets `js.error = "player_file_missing"` but a (useless) `cmd` is still returned. `js.load` is `""` here (int 0 in itv).

        Source: `src/Ministra/PortalHandler.php:1182`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - vod
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_link
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: cmd
          in: query
          required: true
          schema:
            type: string
            example: eyJ0eXBlIjoibW92aWUiLCJzdHJlYW1faWQiOiIyMzAxIiwidGFyZ2V0X2NvbnRhaW5lciI6Im1rdiJ9
          description: Item cmd (base64 JSON) or `/media/<series_id>:<season>.mpg`.
        - name: series
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
          description: Episode number within the season (series mode).
        - name: forced_storage
          in: query
          required: false
          schema:
            type: string
          description: Ignored.
        - name: disable_ad
          in: query
          required: false
          schema:
            type: string
          description: Ignored.
        - name: download
          in: query
          required: false
          schema:
            type: string
          description: Ignored.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_VodCreateLink'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                movie:
                  value:
                    js:
                      id: '2301'
                      cmd: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As?ext=.mkv
                      load: ''
                      subtitles: []
                      error: ''
                missing_episode:
                  value:
                    js:
                      id: null
                      cmd: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
                      load: ''
                      subtitles: []
                      error: player_file_missing
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=vod&action=set_fav:
    get:
      operationId: Stalker_vod_set_fav
      tags:
        - Stalker Portal (MAG)
      summary: Add movie to favourites
      description: |-
        Appends `video_id` to `fav_channels.movie` if absent.

        Source: `src/Ministra/PortalHandler.php:1084`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - vod
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_fav
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: video_id
          in: query
          required: false
          schema:
            type: integer
          description: Movie stream id.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=vod&action=del_fav:
    get:
      operationId: Stalker_vod_del_fav
      tags:
        - Stalker Portal (MAG)
      summary: Remove movie from favourites
      description: |-
        Removes `video_id` from `fav_channels.movie`.

        Source: `src/Ministra/PortalHandler.php:1100`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - vod
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - del_fav
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: video_id
          in: query
          required: false
          schema:
            type: integer
          description: Movie stream id.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=vod&action=set_claim:
    get:
      operationId: Stalker_vod_set_claim
      tags:
        - Stalker Portal (MAG)
      summary: Report a problem with a movie
      description: |-
        Inserts into `mag_claims`.

        Source: `src/Ministra/PortalHandler.php:1068`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - vod
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_claim
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: id
          in: query
          required: false
          schema:
            type: integer
          description: ''
        - name: real_type
          in: query
          required: false
          schema:
            type: string
          description: ''
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=vod&action=set_not_ended:
    get:
      operationId: Stalker_vod_set_not_ended
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: set_not_ended'
      description: |-
        No-op (shared with type=series). Replies `{"js":true}`.

        Source: `src/Ministra/PortalHandler.php:98`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - vod
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_not_ended
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsObject'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=vod&action=del_link:
    get:
      operationId: Stalker_vod_del_link
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: del_link'
      description: |-
        No-op (shared with type=series). Replies `{"js":true}`.

        Source: `src/Ministra/PortalHandler.php:101`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - vod
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - del_link
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsObject'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=vod&action=log:
    get:
      operationId: Stalker_vod_log
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: log'
      description: |-
        No-op (shared with type=series). Replies `{"js":1}`.

        Source: `src/Ministra/PortalHandler.php:104`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - vod
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - log
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsObject'
              examples:
                ok:
                  value:
                    js: 1
  /portal.php?type=series&action=get_categories:
    get:
      operationId: Stalker_series_get_categories
      tags:
        - Stalker Portal (MAG)
      summary: Series categories
      description: |-
        As vod/get_categories but for `series` categories.

        Source: `src/Ministra/PortalHandler.php:1346`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - series
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_categories
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_CategoryList'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - id: '*'
                        title: All
                        alias: '*'
                        censored: 0
                      - id: '31'
                        title: Drama Series
                        alias: Drama Series
                        censored: 0
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=series&action=get_genres_by_category_alias:
    get:
      operationId: Stalker_series_get_genres_by_category_alias
      tags:
        - Stalker Portal (MAG)
      summary: Series "genres" (= categories)
      description: |-
        `*` then every series category.

        Source: `src/Ministra/PortalHandler.php:1374`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - series
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_genres_by_category_alias
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: cat_alias
          in: query
          required: false
          schema:
            type: string
          description: Ignored.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - id: '*'
                        title: '*'
                      - id: '31'
                        title: Drama Series
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=series&action=get_years:
    get:
      operationId: Stalker_series_get_years
      tags:
        - Stalker Portal (MAG)
      summary: Year picker values
      description: |-
        Same as vod/get_years.

        Source: `src/Ministra/PortalHandler.php:1391`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - series
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_years
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - id: '*'
                        title: '*'
                      - id: 2026
                        title: 2026
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=series&action=get_abc:
    get:
      operationId: Stalker_series_get_abc
      tags:
        - Stalker Portal (MAG)
      summary: Letter picker values
      description: |-
        Same as vod/get_abc (duplicate G/W quirk).

        Source: `src/Ministra/PortalHandler.php:1410`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - series
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_abc
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - id: '*'
                        title: '*'
                      - id: A
                        title: A
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=series&action=get_ordered_list:
    get:
      operationId: Stalker_series_get_ordered_list
      tags:
        - Stalker Portal (MAG)
      summary: Series list, or seasons of one series
      description: |-
        Without `movie_id`: series in the bouquets (sorted by `sortby`, default newest episode), items have `is_series: 1`, `has_files: 1`, `cmd: ""`, `series: []`. With `movie_id` (a series id): one item per season (`name` = `Season N` or `Specials` for 0), `series` = `[1..episode_count]`, `cmd` = base64 `{"series_id":<id>,"season_num":<n>,"type":"series"}` and `has_files: 0`; play an episode via `vod/create_link` with that `cmd` and `series=<episode>` (src/Ministra/portal.php:1796-2007).

        Quirks: `getSeries()` reads `$rRequest` without `global`, so `p` is IGNORED - always page 1 (`cur_page` 1, `selected_item` 0) (src/Ministra/portal.php:1808). `total_items` is the unfiltered count minus non-favourites on the current page only when `fav=1`. `time` is the string `"N/a"`; `year` is `release_date`; `is_movie` is 1 even for series.

        Source: `src/Ministra/PortalHandler.php:1394`, `src/Ministra/portal.php:1796`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - series
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_ordered_list
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: movie_id
          in: query
          required: false
          schema:
            type: integer
          description: 'Series id: list its seasons instead.'
        - name: category
          in: query
          required: false
          schema:
            type: string
          description: Numeric category id.
        - $ref: '#/components/parameters/Stalker_Page'
        - name: sortby
          in: query
          required: false
          schema:
            type: string
            enum:
              - added
              - name
              - top
              - rating
              - number
            default: added
          description: ''
        - name: fav
          in: query
          required: false
          schema:
            type: integer
            enum:
              - 0
              - 1
          description: ''
        - name: search
          in: query
          required: false
          schema:
            type: string
          description: Title substring.
        - name: abc
          in: query
          required: false
          schema:
            type: string
            default: '*'
          description: First letter filter.
        - name: genre
          in: query
          required: false
          schema:
            type: string
            default: '*'
          description: Category id filter (from get_genres_by_category_alias).
        - name: years
          in: query
          required: false
          schema:
            type: string
            default: '*'
          description: Year filter.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_VodPage'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                series:
                  value:
                    js:
                      total_items: 87
                      max_page_items: 10
                      selected_item: 0
                      cur_page: 1
                      data:
                        - id: '412'
                          owner: ''
                          name: Slow Horses
                          tmdb_id: '95480'
                          old_name: ''
                          o_name: Slow Horses
                          fname: ''
                          description: Paul Atreides unites with the Fremen...
                          pic: ''
                          cost: 0
                          time: N/a
                          file: ''
                          path: Slow_Horses
                          protocol: ''
                          rtsp_url: ''
                          censored: 0
                          series: []
                          volume_correction: 0
                          category_id: '31'
                          genre_id: 0
                          genre_id_1: 0
                          genre_id_2: 0
                          genre_id_3: 0
                          hd: 1
                          genre_id_4: 0
                          cat_genre_id_1: '31'
                          cat_genre_id_2: 0
                          cat_genre_id_3: 0
                          cat_genre_id_4: 0
                          director: Denis Villeneuve
                          actors: Timothée Chalamet, Zendaya
                          year: '2022-04-01'
                          accessed: 1
                          status: 1
                          disable_for_hd_devices: 0
                          added: '2026-10-10 09:12:44'
                          count: 0
                          count_first_0_5: 0
                          count_second_0_5: 0
                          vote_sound_good: 0
                          vote_sound_bad: 0
                          vote_video_good: 0
                          vote_video_bad: 0
                          rate: ''
                          last_rate_update: ''
                          last_played: ''
                          for_sd_stb: 0
                          rating_im: '8.2'
                          rating_count_im: ''
                          rating_last_update: '1899-11-30T00:00:00.000Z'
                          age: 12+
                          high_quality: 0
                          rating_kinopoisk: '8.2'
                          comments: ''
                          low_quality: 0
                          is_series: 1
                          year_end: 0
                          autocomplete_provider: im
                          screenshots: ''
                          is_movie: 1
                          lock: 0
                          fav: 0
                          for_rent: 0
                          screenshot_uri: https://image.tmdb.org/t/p/w600_and_h900_bestv2/poster.jpg
                          genres_str: Science Fiction, Adventure
                          cmd: ''
                          has_files: 1
                          today: Today
                seasons:
                  value:
                    js:
                      total_items: 4
                      max_page_items: 10
                      selected_item: 0
                      cur_page: 1
                      data:
                        - id: '412'
                          owner: ''
                          name: Season 4
                          tmdb_id: 693134
                          old_name: ''
                          o_name: Season 4
                          fname: ''
                          description: Paul Atreides unites with the Fremen...
                          pic: ''
                          cost: 0
                          time: N/a
                          file: ''
                          path: Slow_Horses
                          protocol: ''
                          rtsp_url: ''
                          censored: 0
                          series:
                            - 1
                            - 2
                            - 3
                            - 4
                            - 5
                            - 6
                          volume_correction: 0
                          category_id: 5
                          genre_id: 0
                          genre_id_1: 0
                          genre_id_2: 0
                          genre_id_3: 0
                          hd: 1
                          genre_id_4: 0
                          cat_genre_id_1: 5
                          cat_genre_id_2: 0
                          cat_genre_id_3: 0
                          cat_genre_id_4: 0
                          director: Denis Villeneuve
                          actors: Timothée Chalamet, Zendaya
                          year: '2024'
                          accessed: 1
                          status: 1
                          disable_for_hd_devices: 0
                          added: '2026-10-10 09:12:44'
                          count: 0
                          count_first_0_5: 0
                          count_second_0_5: 0
                          vote_sound_good: 0
                          vote_sound_bad: 0
                          vote_video_good: 0
                          vote_video_bad: 0
                          rate: ''
                          last_rate_update: ''
                          last_played: ''
                          for_sd_stb: 0
                          rating_im: '8.2'
                          rating_count_im: ''
                          rating_last_update: '1899-11-30T00:00:00.000Z'
                          age: 12+
                          high_quality: 0
                          rating_kinopoisk: '8.2'
                          comments: ''
                          low_quality: 0
                          is_series: 1
                          year_end: 0
                          autocomplete_provider: im
                          screenshots: ''
                          is_movie: 1
                          lock: 0
                          fav: 0
                          for_rent: 0
                          screenshot_uri: https://image.tmdb.org/t/p/w600_and_h900_bestv2/poster.jpg
                          genres_str: Science Fiction, Adventure
                          cmd: eyJzZXJpZXNfaWQiOjQxMiwic2Vhc29uX251bSI6NCwidHlwZSI6InNlcmllcyJ9
                          week_and_more: October 2026
                          has_files: 0
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=series&action=set_fav:
    get:
      operationId: Stalker_series_set_fav
      tags:
        - Stalker Portal (MAG)
      summary: Add series to favourites
      description: |-
        Appends `video_id` to `fav_channels.series`.

        Source: `src/Ministra/PortalHandler.php:1311`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - series
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_fav
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: video_id
          in: query
          required: false
          schema:
            type: integer
          description: Series id.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=series&action=del_fav:
    get:
      operationId: Stalker_series_del_fav
      tags:
        - Stalker Portal (MAG)
      summary: Remove series from favourites
      description: |-
        Removes `video_id` from `fav_channels.series`.

        Source: `src/Ministra/PortalHandler.php:1327`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - series
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - del_fav
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: video_id
          in: query
          required: false
          schema:
            type: integer
          description: Series id.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=series&action=set_claim:
    get:
      operationId: Stalker_series_set_claim
      tags:
        - Stalker Portal (MAG)
      summary: Report a problem
      description: |-
        Inserts into `mag_claims`.

        Source: `src/Ministra/PortalHandler.php:1295`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - series
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_claim
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: id
          in: query
          required: false
          schema:
            type: integer
          description: ''
        - name: real_type
          in: query
          required: false
          schema:
            type: string
          description: ''
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=series&action=set_not_ended:
    get:
      operationId: Stalker_series_set_not_ended
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: set_not_ended'
      description: |-
        No-op (shared with type=vod). Replies `{"js":true}`.

        Source: `src/Ministra/PortalHandler.php:98`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - series
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_not_ended
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsObject'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=series&action=del_link:
    get:
      operationId: Stalker_series_del_link
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: del_link'
      description: |-
        No-op (shared with type=vod). Replies `{"js":true}`.

        Source: `src/Ministra/PortalHandler.php:101`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - series
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - del_link
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsObject'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=series&action=log:
    get:
      operationId: Stalker_series_log
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: log'
      description: |-
        No-op (shared with type=vod). Replies `{"js":1}`.

        Source: `src/Ministra/PortalHandler.php:104`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - series
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - log
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsObject'
              examples:
                ok:
                  value:
                    js: 1
  /portal.php?type=radio&action=get_ordered_list:
    get:
      operationId: Stalker_radio_get_ordered_list
      tags:
        - Stalker Portal (MAG)
      summary: Paged radio station list
      description: |-
        Radio streams in the bouquets. `cmd` as for channels (signed `play/` URL, or `http://localhost/ch/<id>_` when `mag_security` != 0 - but note radio has no create_link handler here). Ints are NOT stringified (unlike itv) except `use_http_tmp_link`; `id` is a DB string. Default `sortby` `added`. `cur_page` 0 when explicit `p` given.

        Source: `src/Ministra/PortalHandler.php:1452`, `src/Ministra/portal.php:2023`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - radio
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_ordered_list
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - $ref: '#/components/parameters/Stalker_Page'
        - name: sortby
          in: query
          required: false
          schema:
            type: string
            enum:
              - added
              - name
              - number
              - top
              - rating
            default: added
          description: ''
        - name: fav
          in: query
          required: false
          schema:
            type: integer
            enum:
              - 0
              - 1
          description: ''
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_RadioPage'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      total_items: 25
                      max_page_items: 10
                      selected_item: 0
                      cur_page: 1
                      data:
                        - id: '3001'
                          name: Classic FM
                          number: 1
                          cmd: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
                          count: 0
                          open: 1
                          status: 1
                          volume_correction: 0
                          use_http_tmp_link: '0'
                          fav: 0
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=radio&action=get_all_fav_radio:
    get:
      operationId: Stalker_radio_get_all_fav_radio
      tags:
        - Stalker Portal (MAG)
      summary: Favourite stations (first page)
      description: |-
        Same as get_ordered_list with fav=1 and default sort; still paged by `p`.

        Source: `src/Ministra/PortalHandler.php:1458`, `src/Ministra/portal.php:2023`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - radio
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_all_fav_radio
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - $ref: '#/components/parameters/Stalker_Page'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_RadioPage'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      total_items: 1
                      max_page_items: 10
                      selected_item: 0
                      cur_page: 1
                      data:
                        - id: '3001'
                          name: Classic FM
                          number: 1
                          cmd: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
                          count: 0
                          open: 1
                          status: 1
                          volume_correction: 0
                          use_http_tmp_link: '0'
                          fav: 1
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=radio&action=set_fav:
    get:
      operationId: Stalker_radio_set_fav
      tags:
        - Stalker Portal (MAG)
      summary: Replace radio favourites
      description: |-
        Replaces `fav_channels.radio_streams` with the comma-separated ids.

        Source: `src/Ministra/PortalHandler.php:1461`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - radio
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_fav
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: fav_radio
          in: query
          required: false
          schema:
            type: string
            example: 3001,3004
          description: Comma-separated ids.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsTrue'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: true
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=radio&action=get_fav_ids:
    get:
      operationId: Stalker_radio_get_fav_ids
      tags:
        - Stalker Portal (MAG)
      summary: Radio favourite ids
      description: |-
        String ids array.

        Source: `src/Ministra/PortalHandler.php:1476`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - radio
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_fav_ids
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsStringArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - '3001'
                      - '3004'
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=audioclub&action=get_categories:
    get:
      operationId: Stalker_audioclub_get_categories
      tags:
        - Stalker Portal (MAG)
      summary: Audio club categories (movie categories)
      description: |-
        Quirk: returns the MOVIE categories (category_type `movie`), same shape as vod/get_categories. No other audioclub action is handled (they return an empty body).

        Source: `src/Ministra/PortalHandler.php:779`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - audioclub
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_categories
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_CategoryList'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - id: '5'
                        title: Movies 2024
                        alias: Movies 2024
                        censored: 0
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=account_info&action=get_main_info:
    get:
      operationId: Stalker_account_info_get_main_info
      tags:
        - Stalker Portal (MAG)
      summary: Account page info
      description: |-
        Quirk: the expiry is returned in the `phone` field - `date("F j, Y, g:i a", exp_date)` or `Unlimited`. `mac` echoes the request/cookie MAC. `message` = `mag_message` setting with newlines -> `<br/>` and HTML entities decoded.

        Source: `src/Ministra/PortalHandler.php:1424`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - account_info
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_main_info
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsObject'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      mac: 00:1A:79:12:34:56
                      phone: December 31, 2026, 11:59 pm
                      message: 'Welcome!<br/>Support: support@example.com'
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=account_info&action=get_terms_info:
    get:
      operationId: Stalker_account_info_get_terms_info
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: get_terms_info'
      description: |-
        Always `{"js":true}`.

        Source: `src/Ministra/PortalHandler.php:115`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - account_info
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_terms_info
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsTrue'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=account_info&action=get_payment_info:
    get:
      operationId: Stalker_account_info_get_payment_info
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: get_payment_info'
      description: |-
        Always `{"js":true}`.

        Source: `src/Ministra/PortalHandler.php:118`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - account_info
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_payment_info
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsTrue'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=account_info&action=get_agreement_info:
    get:
      operationId: Stalker_account_info_get_agreement_info
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: get_agreement_info'
      description: |-
        Always `{"js":true}`.

        Source: `src/Ministra/PortalHandler.php:121`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - account_info
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_agreement_info
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsTrue'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=tv_archive&action=create_link:
    get:
      operationId: Stalker_tv_archive_create_link
      tags:
        - Stalker Portal (MAG)
      summary: Catch-up (archive) link for an EPG programme
      description: |-
        `cmd` is `auto /media/<programme_id>_<stream_id>.mpg` (built by the client from epg `get_simple_data_table` item `id`). The programme is looked up in the EPG cache; link minted from `ministra::timeshift/<username>/<password>/<duration_minutes>/<start_ts>/<stream_id>/<device token>`, `?ext=.ts` when `mag_keep_extension`. Unknown programme -> empty 200 body. `download_cmd` is the URL without the player prefix.

        Source: `src/Ministra/PortalHandler.php:1555`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - tv_archive
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - create_link
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: cmd
          in: query
          required: true
          schema:
            type: string
            example: auto /media/9c1f0e_1452.mpg
          description: Archive cmd.
        - name: series
          in: query
          required: false
          schema:
            type: string
          description: Ignored.
        - name: download
          in: query
          required: false
          schema:
            type: string
          description: Ignored.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsObject'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      id: 0
                      cmd: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
                      storage_id: ''
                      load: 0
                      error: ''
                      download_cmd: http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As
                      to_file: ''
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=tv_archive&action=get_next_part_url:
    get:
      operationId: Stalker_tv_archive_get_next_part_url
      tags:
        - Stalker Portal (MAG)
      summary: URL of the programme after the current archive item
      description: |-
        `id` = `<stream_id>_<start_ts>` (an EPG `real_id`). Finds the first programme starting after that time within 24 h. `js` is a bare string URL with `?&osd_title=<rawurlencoded>&real_id=<stream>_<start>` (+`&ext=.ts`), or `false` when none.

        Source: `src/Ministra/PortalHandler.php:1495`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - tv_archive
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_next_part_url
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: id
          in: query
          required: true
          schema:
            type: string
            example: 1452_1760720400
          description: real_id of the current item.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsAny'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                next:
                  value:
                    js: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As?&osd_title=EastEnders&real_id=1452_1760722200
                none:
                  value:
                    js: false
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=tv_archive&action=get_link_for_channel:
    get:
      operationId: Stalker_tv_archive_get_link_for_channel
      tags:
        - Stalker Portal (MAG)
      summary: Time-shift link for the current hour
      description: |-
        Mints a 60-minute timeshift link starting at the top of the current hour, with firmware hints appended: `<url> position:<sec into hour> media_len:<sec since midnight>`.

        Source: `src/Ministra/PortalHandler.php:1608`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - tv_archive
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_link_for_channel
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - name: ch_id
          in: query
          required: true
          schema:
            type: integer
          description: Stream id.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsObject'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      id: 0
                      cmd: ffmpeg http://line.example.com:80/play/kO3vXb1u9Qm2Zc7Ld0Wn4Rt6Yp8Ef5Ha-Gs_Jq1Mx3Vb7Nc9Ke2Lr0Ty4Ui6Op8As position:754 media_len:65554
                      storage_id: ''
                      load: 0
                      error: ''
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=tv_archive&action=set_played_timeshift:
    get:
      operationId: Stalker_tv_archive_set_played_timeshift
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: set_played_timeshift'
      description: |-
        No-op.

        Source: `src/Ministra/PortalHandler.php:129`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - tv_archive
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_played_timeshift
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsTrue'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=tv_archive&action=set_played:
    get:
      operationId: Stalker_tv_archive_set_played
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: set_played'
      description: |-
        No-op.

        Source: `src/Ministra/PortalHandler.php:132`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - tv_archive
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - set_played
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsTrue'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=tv_archive&action=update_played_timeshift_end_time:
    get:
      operationId: Stalker_tv_archive_update_played_timeshift_end_time
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: update_played_timeshift_end_time'
      description: |-
        No-op.

        Source: `src/Ministra/PortalHandler.php:135`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - tv_archive
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - update_played_timeshift_end_time
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsTrue'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=epg&action=get_week:
    get:
      operationId: Stalker_epg_get_week
      tags:
        - Stalker Portal (MAG)
      summary: Day selector for the EPG
      description: |-
        26 days: today-16 .. today+9. `f_human` = `D d F`, `f_mysql` = `Y-m-d`, `today` int flag.

        Source: `src/Ministra/PortalHandler.php:1662`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - epg
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_week
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - f_human: Thu 01 October
                        f_mysql: '2026-10-01'
                        today: 0
                      - f_human: Sat 17 October
                        f_mysql: '2026-10-17'
                        today: 1
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=epg&action=get_simple_data_table:
    get:
      operationId: Stalker_epg_get_simple_data_table
      tags:
        - Stalker Portal (MAG)
      summary: Paged one-day EPG for a channel
      description: |-
        Programmes starting on `date` (server tz) for `ch_id`. Page size 7 (xc_vm theme) or 10. With `p`=0 and `date` = today, the page containing the live programme is chosen and `selected_item` points at it; otherwise `cur_page`/`selected_item` are 0. `id` = `<programme_id>_<ch_id>` (feed to tv_archive/create_link as `/media/<id>.mpg`); `mark_archive` = 1 when the programme ended within the channel `tv_archive_duration` days. Missing `ch_id` or `date` -> empty 200 body.

        Source: `src/Ministra/PortalHandler.php:1683`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - epg
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_simple_data_table
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - $ref: '#/components/parameters/Stalker_TimezoneCookie'
        - name: ch_id
          in: query
          required: true
          schema:
            type: string
          description: Stream id.
        - name: date
          in: query
          required: true
          schema:
            type: string
            format: date
          description: '`Y-m-d`.'
        - $ref: '#/components/parameters/Stalker_Page'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsObject'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      cur_page: 3
                      selected_item: 2
                      total_items: 30
                      max_page_items: 7
                      data:
                        - id: 9c1f0e_1452
                          ch_id: '1452'
                          time: '2026-10-17 18:00:00'
                          time_to: '2026-10-17 18:30:00'
                          duration: 1800
                          name: BBC News at Six
                          descr: The latest news.
                          real_id: 1452_1760720400
                          category: ''
                          director: ''
                          actor: ''
                          start_timestamp: 1760720400
                          stop_timestamp: 1760722200
                          t_time: '18:00'
                          t_time_to: '18:30'
                          open: 1
                          mark_memo: 0
                          mark_rec: 0
                          mark_archive: 0
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=epg&action=get_all_program_for_ch:
    get:
      operationId: Stalker_epg_get_all_program_for_ch
      tags:
        - Stalker Portal (MAG)
      summary: All programmes from today for a channel
      description: |-
        Every programme starting from today 00:00 (server tz), timestamps shifted to the `timezone` cookie zone.

        Source: `src/Ministra/PortalHandler.php:1810`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - epg
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_all_program_for_ch
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
        - $ref: '#/components/parameters/Stalker_TimezoneCookie'
        - name: ch_id
          in: query
          required: true
          schema:
            type: integer
          description: Stream id.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js:
                      - start_timestamp: 1760720400
                        stop_timestamp: 1760722200
                        name: BBC News at Six
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=epg&action=get_data_table:
    get:
      operationId: Stalker_epg_get_data_table
      tags:
        - Stalker Portal (MAG)
      summary: Multi-channel EPG grid (stub)
      description: |-
        Always `{"js":[]}`.

        Source: `src/Ministra/PortalHandler.php:1680`.

        Auth: requires a device verified by `stb/get_profile` under the presented Bearer token (header `Authorization: Bearer <token>` or `token` query/POST field). Unverified/missing/stale token -> HTTP 200 with plain body `Authorization failed.` (src/Ministra/PortalHandler.php:1867).
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - epg
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_data_table
          description: Module action. Read from `$_REQUEST` (GET or POST).
        - $ref: '#/components/parameters/Stalker_Authorization'
        - $ref: '#/components/parameters/Stalker_TokenQuery'
        - $ref: '#/components/parameters/Stalker_MacQuery'
        - $ref: '#/components/parameters/Stalker_MacCookie'
        - $ref: '#/components/parameters/Stalker_XUserAgent'
        - $ref: '#/components/parameters/Stalker_JsHttpRequest'
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Stalker_JsEmptyArray'
                  - $ref: '#/components/schemas/Stalker_AuthFailedText'
              examples:
                ok:
                  value:
                    js: []
                unauthenticated:
                  summary: Token missing/stale or device not verified
                  value: Authorization failed.
        '403':
          $ref: '#/components/responses/Stalker_FloodBlocked'
        '404':
          $ref: '#/components/responses/Stalker_LegacyDisabled'
        '503':
          $ref: '#/components/responses/Stalker_Maintenance'
  /portal.php?type=remote_pvr&action=start_record_on_stb:
    get:
      operationId: Stalker_remote_pvr_start_record_on_stb
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: start_record_on_stb'
      description: |-
        No-op.

        Source: `src/Ministra/PortalHandler.php:77`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - remote_pvr
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - start_record_on_stb
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsTrue'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=remote_pvr&action=stop_record_on_stb:
    get:
      operationId: Stalker_remote_pvr_stop_record_on_stb
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: stop_record_on_stb'
      description: |-
        No-op.

        Source: `src/Ministra/PortalHandler.php:80`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - remote_pvr
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - stop_record_on_stb
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsTrue'
              examples:
                ok:
                  value:
                    js: true
  /portal.php?type=remote_pvr&action=get_active_recordings:
    get:
      operationId: Stalker_remote_pvr_get_active_recordings
      tags:
        - Stalker Portal (MAG)
      summary: Stub
      description: |-
        Always empty.

        Source: `src/Ministra/PortalHandler.php:83`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - remote_pvr
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
            enum:
              - get_active_recordings
          description: Module action. Read from `$_REQUEST` (GET or POST).
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsEmptyArray'
              examples:
                ok:
                  value:
                    js: []
  /portal.php?type=media_favorites:
    get:
      operationId: Stalker_media_favorites_any
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: any media_favorites action'
      description: |-
        Every action replies `{"js":""}`.

        Source: `src/Ministra/PortalHandler.php:89`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - media_favorites
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
          description: Any non-empty value; the stub answers for every action of this type.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsObject'
              examples:
                ok:
                  value:
                    js: ''
  /portal.php?type=tvreminder:
    get:
      operationId: Stalker_tvreminder_any
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: any tvreminder action'
      description: |-
        Every action replies `{"js":[]}`.

        Source: `src/Ministra/PortalHandler.php:92`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - tvreminder
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
          description: Any non-empty value; the stub answers for every action of this type.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsEmptyArray'
              examples:
                ok:
                  value:
                    js: []
  /portal.php?type=downloads:
    get:
      operationId: Stalker_downloads_any
      tags:
        - Stalker Portal (MAG)
      summary: 'Stub: any downloads action'
      description: |-
        Every action replies `{"js":true}`.

        Source: `src/Ministra/PortalHandler.php:110`.

        Auth: none. Answered by the pre-init stub table (src/Ministra/PortalHandler.php:46) BEFORE bootstrap, DB, maintenance, legacy-path and `disable_ministra` checks; always succeeds, no side effects.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum:
              - downloads
          description: Portal module. Read from `$_REQUEST` (GET or POST).
        - name: action
          in: query
          required: true
          schema:
            type: string
          description: Any non-empty value; the stub answers for every action of this type.
      responses:
        '200':
          description: 'Success. JSON body served with `Content-type: text/javascript` (src/Ministra/portal.php:18).'
          content:
            text/javascript:
              schema:
                $ref: '#/components/schemas/Stalker_JsTrue'
              examples:
                ok:
                  value:
                    js: true
