IPTVnator Documentation

repository·master·Indexed 26 days ago

https://github.com/4gray/iptvnator

A cross-platform, open-source IPTV player application supporting M3U/M3U8 playlists, Xtream Codes, and Stalker portals. Features include EPG integration, VOD support, and deployment options for desktop (Electron) and web (PWA). The documentation covers remote control setup via HTTP server, REST API endpoints, and the use of Stalker and Xtream Codes mock servers for development and performance benchmarking.

Tokens
112.2K
Snippets
178
Records
602
Agent score
92%

What's inside IPTVnator

  1. Overview of IPTVnator features

    master

    IPTVnator is a cross-platform, open-source video player application built with Electron and Angular. It supports IPTV playlist playback (M3U, M3U8) via remote URLs or local file uploads, and supports EPG information in XMLTV format.

    Key Capabilities:

    • Playlists & Sources: Supports M3U/M3U8, Xtream Codes (XC), and Stalker/Ministra (STB) portals. Allows custom "User-Agent" headers per playlist.
    • Playback: Built-in HTML5 player (HLS.js or Video.js) or external players (MPV, VLC, IINA). Supports embedded MPV (experimental) and a dedicated radio player for radio="true" streams.
    • Live TV & EPG: Includes an EPG/XMLTV TV guide with a live timeline, multi-channel grid, and catch-up/timeshift support (desktop only).
    • VOD (Movies & Series): Features detail pages with season tabs, resume positions, and a download manager (desktop only).
    • Discovery: Global search across live TV, movies, and series, plus TMDB enrichment for metadata (plots, cast, ratings, etc.).
    • Organization: Favorites (per-playlist and global), watch history, and a command palette.
  2. Understand Stalker EPG fallback behavior

    master

    The IPTVnator active panel uses a tiered approach to fetch EPG data from Stalker portals to ensure usability even when APIs are inconsistent:

    1. Primary Method (get_epg_info): Attempts a bulk request to fetch EPG data for multiple channels.
    2. Fallback Method (get_short_epg): If the bulk request fails, returns an empty response, or the selected channel is missing from the bulk cache, the active panel falls back to per-channel requests via get_short_epg.

    Limitation: While the active panel falls back to per-channel requests, row previews do not. Row previews will remain empty until the bulk EPG (get_epg_info) becomes available.

  3. EPG Format and Features

    master

    Supported Formats

    IPTVnator uses the XMLTV format for EPG data. Supported file extensions include:

    • .xml
    • .xml.gz (compressed)

    EPG Features

    Once configured, the following information is available in the UI:

    • Current program: Displayed next to channels in the channel list.
    • Progress bar: Indicates the elapsed time of the current program.
    • Program details: Shown in the right sidebar when a channel is selected.
    • Upcoming schedule: Displays times and descriptions for future programs.

    Performance and Management

    • Caching: Parsed EPG data is cached in the database (Electron version) to handle large files efficiently.
    • Multiple Sources: You can add multiple EPG sources per playlist.
    • Auto-refresh: The EPG automatically refreshes periodically to maintain schedule accuracy.
  4. Understand Stalker Portal EPG Architecture

    master

    The Stalker/Ministra ITV EPG implementation uses two distinct paths to balance performance and user experience:

    1. Bulk EPG (get_epg_info): Used for the active channel EPG panel. It fetches a 7-day window (168 hours) once per playlist session and caches programs by channel ID. This bulk data also powers the "now playing" previews in the channel sidebar rows.
    2. Short EPG Fallback (get_short_epg): If the bulk endpoint does not return usable data for a selected channel, the active panel falls back to this endpoint, requesting a smaller window (typically size=10).

    Key Lifecycle Behaviors:

    • Eager Loading: Bulk EPG is triggered eagerly when a category's channels first render to ensure row previews and the EPG panel populate immediately.
    • Cache Management: The bulk cache is cleared whenever the playlist changes to prevent data leakage between different Stalker playlists. It is not refreshed via TTL or background polling.
  5. Understand the Player-Controls Contract architecture

    master

    IPTVnator uses an engine-agnostic contract to separate player UI presentation from the underlying media engine. This allows the same UI component (app-player-controls) to work across different playback engines like HTML5, Video.js, ArtPlayer, and Embedded MPV.

    Architecture Layers:

    1. Presentation: The app-player-controls component handles rendering menus, feedback, auto-hide, and scrub UI.
    2. Contract: The PlayerController interface acts as the bridge.
    3. Adapters: Engines implement the contract via adapters (e.g., WebVideoControlsAdapter for web engines or EmbeddedMpvControlsAdapter for MPV).
    4. Engines: The actual media players (HTML5, Video.js, ArtPlayer, or MPV) that execute the commands.
  6. Understand the Download Manager Architecture

    master

    The Download Manager is a desktop-only feature in IPTVnator that provides a curated queue, progress tracking, storage configuration, and playback controls. It operates by layering these capabilities on top of existing Xtream and Stalker portal views.

    Architecture overview:

    • Backend (Electron process): Handles queue control, range-aware byte transfers (using Axios), destination collision policies, and IPC (Inter-Process Communication) management.
    • Renderer (Angular): Exposes the /downloads route, manages the UI via a dedicated DownloadsService, and communicates with the backend through the window.electron bridge.
    • Data Persistence: Uses a shared downloads SQLite table to track statuses (queued, downloading, paused, completed, failed, canceled) and metadata like bytesDownloaded, totalBytes, and resume_validator.
  7. Understand the Channel List Container Architecture

    master

    The ChannelListContainerComponent acts as a shared state coordinator for the channel sidebar. It manages several key signals to coordinate data across different views:

    • channelEpgMap: A Map<string, EpgProgram> for EPG data.
    • progressTick: A number updated at 30s intervals to drive EPG progress updates.
    • shouldShowEpg: A boolean flag.
    • favoriteIds: A Set<string> containing favorite channel IDs.

    Data flows from this parent component down to specialized views: AllChannelsView, GroupsView, FavoritesView, and RecentView. When a channel is selected in any view, it emits a channelSelected output which triggers ChannelActions.setActiveChannel in the store.

  8. Understand Embedded MPV Native Integration rendering paths

    master

    IPTVnator uses two distinct rendering paths for its embedded MPV integration depending on the platform and engine used:

    1. Native-view engine: Renders into an app-owned platform video surface:
      • macOS: Uses the libmpv render API within an NSOpenGLView (to avoid black video surfaces caused by the wid path).
      • Windows: Loads libmpv via a native Node addon and uses the mpv wid option targeting an IPTVnator-owned child HWND.
      • Linux: Creates an IPTVnator-owned X11/Xwayland child Window and starts an out-of-process mpv --wid=<window> instance.
    2. Frame-copy engine (Experimental): Uploads frames produced by a helper process to a Chromium-owned DOM canvas. This is available for Apple Silicon (macOS), Linux x64, and Windows.
  9. Understand the Workspace Shell architecture

    master

    The /workspace route is the primary application surface. The WorkspaceShellComponent provides a persistent frame consisting of a left rail, a top header, an optional context panel, a main content outlet, and an optional external playback footer.

    All descendant workspace pages inherit the layout = 'workspace' configuration from the /workspace root route. Instead of using nested provider shell components, the system uses route-scoped session providers to bootstrap state (like active playlists) and clean up local state when routes are destroyed.

  10. Understand the Shared Marketing Fixtures Architecture

    master
    The project uses a provider-neutral Nx library, @iptvnator/shared/marketing-fixtures, to manage poster-showcase metadata. This library acts as a single source of truth for marketing content (movies/posters). Both the xtream-mock-server and stalker-mock-server consume these shared fixtures and adapt them into their respective protocol shapes (Xtream or Stalker) to serve consistent marketing content across different provider simulations.