### Building xTeVe from Source Code (Go) Source: https://github.com/xteve-project/xteve/blob/master/README.md Instructions for building the xTeVe application from its Go source code. This involves downloading the source, installing necessary dependencies using 'go get', and finally compiling the project with 'go build'. ```go go get github.com/koron/go-ssdp go get github.com/gorilla/websocket go get github.com/kardianos/osext go build xteve.go ``` -------------------------------- ### Start xTeVe with Command Line Options (Bash) Source: https://context7.com/xteve-project/xteve/llms.txt Demonstrates various command-line arguments for starting the xTeVe application. These options allow customization of the port, configuration directory, update branch, logging level, backup restoration, and displaying system information or help. ```bash # Basic startup (uses default port 34400 and config in ~/.xteve/) ./xteve # Specify custom port ./xteve -port 8080 # Use custom config directory ./xteve -config /path/to/config/ # Switch to beta branch for updates ./xteve -branch beta # Enable debug logging (levels 0-3) ./xteve -debug 1 # Restore from backup ./xteve -restore /path/to/xteve_backup.zip # Show system information ./xteve -info # Show help ./xteve -h ``` -------------------------------- ### Go Commands for Building xTeVe from Source Source: https://context7.com/xteve-project/xteve/llms.txt Compile the xTeVe application from its source code using Go. This involves installing necessary dependencies with 'go get' and then building the executable binary with 'go build'. The '-dev' flag can be used to run in development mode, utilizing local HTML files. ```bash # Install dependencies go get github.com/koron/go-ssdp go get github.com/gorilla/websocket go get github.com/kardianos/osext # Build binary go build xteve.go # Run with development mode (uses local HTML files) ./xteve -dev ``` -------------------------------- ### XMLTV Guide Data Structure Source: https://context7.com/xteve-project/xteve/llms.txt An example of the XMLTV data structure generated by xTeVe. It includes channel information with display names and icons, as well as program details with start times, durations, titles, descriptions, and categories. ```xml CNN Morning News Daily morning news broadcast News ``` -------------------------------- ### XMLTV Guide Data Source: https://context7.com/xteve-project/xteve/llms.txt Retrieve the XMLTV guide data. Authentication may be required if enabled in settings. ```APIDOC ## GET /xmltv/xteve.xml ### Description Retrieves the XMLTV guide data for all channels. ### Method GET ### Endpoint `/xmltv/xteve.xml` ### Parameters #### Query Parameters - **username** (string) - Optional - The username for authentication. - **password** (string) - Optional - The password for authentication. ### Response #### Success Response (200) - **XMLTV Data** (xml) - The XMLTV formatted guide data. ### Response Example ```xml CNN Morning News Daily morning news broadcast News ``` ``` -------------------------------- ### xTeVe Device Discovery Response (JSON) Source: https://context7.com/xteve-project/xteve/llms.txt Example JSON response from the /discover.json endpoint. It provides essential details about the xTeVe instance, including its base URL, device ID, firmware information, and lineup URL, enabling media servers to identify and connect to it. ```json { "BaseURL": "http://192.168.1.100:34400", "DeviceAuth": "xteve", "DeviceID": "2019-01-XXXX-XXXXXX", "FirmwareName": "bin_2.2.0", "FirmwareVersion": "2.2.0", "FriendlyName": "xTeVe", "LineupURL": "http://192.168.1.100:34400/lineup.json", "Manufacturer": "Golang", "ModelNumber": "2.2.0", "TunerCount": 1 } ``` -------------------------------- ### xTeVe M3U Playlist Export Format (M3U) Source: https://context7.com/xteve-project/xteve/llms.txt An example of the M3U playlist format exported by xTeVe. It includes extended information tags for TV guide data (tvg-chno, tvg-name, tvg-id, tvg-logo, group-title) and the stream URL for each channel. ```m3u #EXTM3U url-tvg="http://192.168.1.100:34400/xmltv/xteve.xml" #EXTINF:0 channelID="x-ID.0" tvg-chno="1000" tvg-name="CNN" tvg-id="1000" tvg-logo="http://example.com/cnn.png" group-title="News",CNN http://192.168.1.100:34400/stream/abc123def456 #EXTINF:0 channelID="x-ID.1" tvg-chno="1001" tvg-name="BBC World" tvg-id="1001" tvg-logo="http://example.com/bbc.png" group-title="News",BBC World http://192.168.1.100:34400/stream/xyz789ghi012 ``` -------------------------------- ### Fetch XMLTV with Authentication (curl) Source: https://context7.com/xteve-project/xteve/llms.txt Retrieves the XMLTV guide data from xTeVe. Requires username and password if authentication is enabled on the server. The output is an XML document containing channel and program information. ```bash curl "http://localhost:34400/xmltv/xteve.xml?username=user&password=pass" ``` -------------------------------- ### xTeVe Device Capabilities Response (XML) Source: https://context7.com/xteve-project/xteve/llms.txt An example XML response from the /device.xml endpoint, detailing the UPnP device description. This file is crucial for network discovery protocols, allowing media servers to recognize xTeVe as a compatible device. ```xml http://192.168.1.100:34400 1 0 urn:schemas-upnp-org:device:MediaServer:1 xTeVe Silicondust HDTC-2US HDTC-2US uuid:2019-01-XXXX-XXXXXX ``` -------------------------------- ### REST API - Get Status Source: https://context7.com/xteve-project/xteve/llms.txt Retrieve system status and streaming statistics. ```APIDOC ## POST /api/ ### Description Retrieves the current system status, including streaming statistics and configuration details. ### Method POST ### Endpoint `/api/` ### Parameters #### Request Body - **cmd** (string) - Required - Must be `"status"`. - **token** (string) - Optional - The authentication token obtained from a previous login. ### Request Example ```bash # Without authentication curl -X POST -H "Content-Type: application/json" \ -d '{"cmd":"status"}' \ http://localhost:34400/api/ # With token authentication curl -X POST -H "Content-Type: application/json" \ -d '{"cmd":"status","token":"U0T-NTSaigh-RlbkqERsHvUpgvaaY2dyRGuwIIvv"}' \ http://localhost:34400/api/ ``` ### Response #### Success Response (200) - **epg.source** (string) - The source of the EPG data. - **status** (boolean) - Indicates the overall status of the system. - **streams.active** (integer) - The number of currently active streams. - **streams.all** (integer) - The total number of configured streams. - **streams.xepg** (integer) - The number of streams associated with XEPG. - **token** (string) - A new token for subsequent requests (may be updated). - **url.dvr** (string) - The URL for DVR access. - **url.m3u** (string) - The URL for the M3U playlist. - **url.xepg** (string) - The URL for the XMLTV EPG data. - **version.api** (string) - The version of the API. - **version.xteve** (string) - The version of xTeVe. #### Response Example ```json { "epg.source": "XEPG", "status": true, "streams.active": 7, "streams.all": 63, "streams.xepg": 42, "token": "mXiG1NE1MrTXDtyh7PxRHK5z8iPI_LzxsQmY-LFn", "url.dvr": "192.168.1.100:34400", "url.m3u": "http://192.168.1.100:34400/m3u/xteve.m3u", "url.xepg": "http://192.168.1.100:34400/xmltv/xteve.xml", "version.api": "1.1.0", "version.xteve": "2.2.0" } ``` ``` -------------------------------- ### xTeVe Channel Lineup Response (JSON) Source: https://context7.com/xteve-project/xteve/llms.txt An example JSON array representing the channel lineup, formatted for HDHomeRun compatibility. Each object includes channel details like GuideName, GuideNumber, and the stream URL, used by DVRs for channel mapping. ```json [ { "GuideName": "CNN", "GuideNumber": "1000", "URL": "http://192.168.1.100:34400/stream/abc123def456" }, { "GuideName": "BBC World", "GuideNumber": "1001", "URL": "http://192.168.1.100:34400/stream/xyz789ghi012" } ] ``` -------------------------------- ### M3U and XMLTV Export API Source: https://context7.com/xteve-project/xteve/llms.txt Endpoints for exporting channel lineups as M3U playlists and electronic program guides as XMLTV files. ```APIDOC ## GET /m3u/xteve.m3u ### Description Exports the filtered and mapped channel lineup as an M3U playlist. ### Method GET ### Endpoint /m3u/xteve.m3u ### Parameters #### Query Parameters - **group-title** (string) - Optional. Filter the playlist by specific group titles (e.g., "Sports,News"). - **username** (string) - Optional. Username for authentication. - **password** (string) - Optional. Password for authentication. #### Request Body None ### Request Example ```bash # Download full M3U playlist curl -o channels.m3u http://localhost:34400/m3u/xteve.m3u # Filter by specific group titles curl "http://localhost:34400/m3u/xteve.m3u?group-title=Sports,News" # With authentication (if enabled) curl "http://localhost:34400/m3u/xteve.m3u?username=user&password=pass" ``` ### Response #### Success Response (200) M3U playlist content. #### Response Example ```m3u #EXTM3U url-tvg="http://192.168.1.100:34400/xmltv/xteve.xml" #EXTINF:0 channelID="x-ID.0" tvg-chno="1000" tvg-name="CNN" tvg-id="1000" tvg-logo="http://example.com/cnn.png" group-title="News",CNN http://192.168.1.100:34400/stream/abc123def456 #EXTINF:0 channelID="x-ID.1" tvg-chno="1001" tvg-name="BBC World" tvg-id="1001" tvg-logo="http://example.com/bbc.png" group-title="News",BBC World http://192.168.1.100:34400/stream/xyz789ghi012 ``` ## GET /xmltv/xteve.xml ### Description Exports the electronic program guide in XMLTV format. ### Method GET ### Endpoint /xmltv/xteve.xml ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash # Download XMLTV EPG curl -o guide.xml http://localhost:34400/xmltv/xteve.xml ``` ### Response #### Success Response (200) XMLTV EPG content. #### Response Example ```xml CNN BBC World CNN News BBC World Update ``` ``` -------------------------------- ### Get Status Response Source: https://context7.com/xteve-project/xteve/llms.txt The JSON response detailing the xTeVe system status. It includes information on EPG sources, active and total streams, API and xTeVe versions, and URLs for M3U playlists and XMLTV guides. ```json { "epg.source": "XEPG", "status": true, "streams.active": 7, "streams.all": 63, "streams.xepg": 42, "token": "mXiG1NE1MrTXDtyh7PxRHK5z8iPI_LzxsQmY-LFn", "url.dvr": "192.168.1.100:34400", "url.m3u": "http://192.168.1.100:34400/m3u/xteve.m3u", "url.xepg": "http://192.168.1.100:34400/xmltv/xteve.xml", "version.api": "1.1.0", "version.xteve": "2.2.0" } ``` -------------------------------- ### Update XEPG Mapping (curl) Source: https://context7.com/xteve-project/xteve/llms.txt Rebuilds the XEPG (XMLTV Extended Program Guide) database based on the current channel mappings within xTeVe. This command requires an authentication token. ```bash curl -X POST -H "Content-Type: application/json" \ -d '{"cmd":"update.xepg","token":"your-token-here"}' \ http://localhost:34400/api/ ``` -------------------------------- ### Get Status (curl) Source: https://context7.com/xteve-project/xteve/llms.txt Retrieves the current system status and streaming statistics from xTeVe. This command can be executed with or without token authentication, depending on the server's configuration. ```bash # Without authentication curl -X POST -H "Content-Type: application/json" \ -d '{"cmd":"status"}' \ http://localhost:34400/api/ # With token authentication curl -X POST -H "Content-Type: application/json" \ -d '{"cmd":"status","token":"U0T-NTSaigh-RlbkqERsHvUpgvaaY2dyRGuwIIvv"}' \ http://localhost:34400/api/ ``` -------------------------------- ### Update XMLTV EPG (curl) Source: https://context7.com/xteve-project/xteve/llms.txt Initiates a refresh for all configured XMLTV Electronic Program Guide sources in xTeVe. This operation requires a valid authentication token. ```bash curl -X POST -H "Content-Type: application/json" \ -d '{"cmd":"update.xmltv","token":"your-token-here"}' \ http://localhost:34400/api/ ``` -------------------------------- ### Export XMLTV EPG from xTeVe (Bash) Source: https://context7.com/xteve-project/xteve/llms.txt Downloads the electronic program guide (EPG) data in XMLTV format using curl from the /xmltv/xteve.xml endpoint. This data is essential for providing program information in DVR interfaces. ```bash # Download XMLTV EPG curl -o guide.xml http://localhost:34400/xmltv/xteve.xml ``` -------------------------------- ### xTeVe Lineup Scan Status Response (JSON) Source: https://context7.com/xteve-project/xteve/llms.txt Example JSON response from the /lineup_status.json endpoint. It indicates whether a scan is in progress and if further scans are possible, providing feedback for DVR configuration. ```json { "ScanInProgress": 0, "ScanPossible": 0, "Source": "Cable", "SourceList": ["Cable"] } ``` -------------------------------- ### Check xTeVe Lineup Scan Status (Bash) Source: https://context7.com/xteve-project/xteve/llms.txt Retrieves the current status of the channel lineup scan using curl on the /lineup_status.json endpoint. This is typically used during the DVR setup process to monitor scan progress. ```bash curl http://localhost:34400/lineup_status.json ``` -------------------------------- ### Configuration Files Source: https://context7.com/xteve-project/xteve/llms.txt Details about xTeVe's configuration files and their structure. ```APIDOC ## Configuration Files xTeVe stores configuration in `~/.xteve/` by default. ### Configuration Directory Structure ``` ~/.xteve/ ├── settings.json # Main settings ├── xepg.json # Channel mapping database ├── authentication.json # User accounts ├── pms.json # Plex Media Server mapping ├── urls.json # Stream URL cache ├── data/ │ ├── xteve.m3u # Generated M3U │ ├── xteve.xml # Generated XMLTV │ ├── xteve.xml.gz # Compressed XMLTV │ └── images/ # Uploaded logos ├── cache/ │ └── images/ # Cached logos └── backup/ # Automatic backups ``` ### Settings Structure (settings.json) ```json { "api": true, "authentication.api": false, "authentication.m3u": false, "authentication.pms": false, "authentication.web": false, "authentication.xml": false, "backup.keep": 10, "backup.path": "/home/user/.xteve/backup/", "buffer": "ffmpeg", "buffer.size.kb": 1024, "buffer.timeout": 500, "cache.images": true, "epgSource": "XEPG", "ffmpeg.options": "-hide_banner -loglevel error -i [URL] -c copy -f mpegts pipe:1", "ffmpeg.path": "/usr/bin/ffmpeg", "vlc.options": "-I dummy [URL] --sout #std{mux=ts,access=file,dst=-}", "vlc.path": "/usr/bin/cvlc", "files": { "m3u": {}, "hdhr": {}, "xmltv": {} }, "files.update": true, "filter": {}, "language": "en", "log.entries.ram": 500, "mapping.first.channel": 1000, "port": "34400", "ssdp": true, "tuner": 2, "update": ["0300"], "user.agent": "xTeVe", "uuid": "2024-01-XXXX-XXXXXX", "udpxy": "", "xepg.replace.missing.images": true, "xteveAutoUpdate": true } ``` ``` -------------------------------- ### Web Interface Source: https://context7.com/xteve-project/xteve/llms.txt Access the web interface for visual configuration management of xTeVe. ```APIDOC ## Web Interface Access the web interface at `http://localhost:34400/web/` for visual configuration management. ### Method GET ### Endpoint `http://localhost:34400/web/` ### Description Provides a graphical user interface for managing xTeVe settings, sources, and other configurations. ### Usage Open the URL in your web browser. If authentication is enabled, a login page will appear first. After successful login, you can access the dashboard using the token stored in your browser's cookies. ``` -------------------------------- ### Fetch xTeVe Channel Lineup (Bash) Source: https://context7.com/xteve-project/xteve/llms.txt Fetches the complete channel lineup in HDHomeRun format using curl from the /lineup.json endpoint. Supports authentication if enabled in xTeVe configuration. ```bash # Without authentication curl http://localhost:34400/lineup.json # With authentication (if enabled) curl -u username:password http://localhost:34400/lineup.json ``` -------------------------------- ### Retrieve xTeVe Device Capabilities (Bash) Source: https://context7.com/xteve-project/xteve/llms.txt Fetches the device capabilities XML file using curl from the /device.xml endpoint. This XML is used for SSDP (Simple Service Discovery Protocol) to allow devices on the network to discover the xTeVe service. ```bash curl http://localhost:34400/device.xml ``` -------------------------------- ### Bash Commands for xTeVe Web Interface and Image Retrieval Source: https://context7.com/xteve-project/xteve/llms.txt Access the xTeVe web interface using the 'open' command on macOS or by navigating to the URL in a browser. Retrieve cached or uploaded images using 'curl' commands, specifying the appropriate endpoint and filename. Authentication may be required for the web interface. ```bash # Open web interface open http://localhost:34400/web/ # With authentication, login page appears first # After login, access dashboard with token in cookie # Retrieve cached images curl http://localhost:34400/images/abc123.jpg -o logo.jpg # Retrieve uploaded images curl http://localhost:34400/data_images/custom_logo.png -o custom.png ``` -------------------------------- ### Configuring xTeVe GitHub Repository and Update Settings Source: https://github.com/xteve-project/xteve/blob/master/README.md This Go code snippet defines the default GitHub repository details and update settings for xTeVe. It includes the default branch, user, repository name, and a boolean flag to enable/disable automatic updates. This configuration is crucial for managing forks and updates. ```go var GitHub = GitHubStruct{Branch: "master", User: "xteve-project", Repo: "xTeVe-Downloads", Update: true} /* Branch: GitHub Branch User: GitHub Username Repo: GitHub Repository Update: Automatic updates from the GitHub repository [true|false] */ ``` -------------------------------- ### JSON Configuration Structure for xTeVe Settings Source: https://context7.com/xteve-project/xteve/llms.txt The 'settings.json' file in the xTeVe configuration directory stores the main application settings. This JSON object defines various parameters including API access, authentication methods, buffer settings, file paths, port configuration, tuner count, and update preferences. It allows for detailed customization of xTeVe's behavior. ```json { "api": true, "authentication.api": false, "authentication.m3u": false, "authentication.pms": false, "authentication.web": false, "authentication.xml": false, "backup.keep": 10, "backup.path": "/home/user/.xteve/backup/", "buffer": "ffmpeg", "buffer.size.kb": 1024, "buffer.timeout": 500, "cache.images": true, "epgSource": "XEPG", "ffmpeg.options": "-hide_banner -loglevel error -i [URL] -c copy -f mpegts pipe:1", "ffmpeg.path": "/usr/bin/ffmpeg", "vlc.options": "-I dummy [URL] --sout #std{mux=ts,access=file,dst=-}", "vlc.path": "/usr/bin/cvlc", "files": { "m3u": {}, "hdhr": {}, "xmltv": {} }, "files.update": true, "filter": {}, "language": "en", "log.entries.ram": 500, "mapping.first.channel": 1000, "port": "34400", "ssdp": true, "tuner": 2, "update": ["0300"], "user.agent": "xTeVe", "uuid": "2024-01-XXXX-XXXXXX", "udpxy": "", "xepg.replace.missing.images": true, "xteveAutoUpdate": true } ``` -------------------------------- ### HDHomeRun Discovery API Source: https://context7.com/xteve-project/xteve/llms.txt Endpoints that emulate HDHomeRun hardware for automatic discovery by Plex and Emby DVR. ```APIDOC ## GET /discover.json ### Description Returns device information in HDHomeRun format for DVR auto-discovery. ### Method GET ### Endpoint /discover.json ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl http://localhost:34400/discover.json ``` ### Response #### Success Response (200) - **BaseURL** (string) - The base URL of the xTeVe instance. - **DeviceAuth** (string) - Authentication token for the device. - **DeviceID** (string) - Unique identifier for the device. - **FirmwareName** (string) - Name of the firmware. - **FirmwareVersion** (string) - Version of the firmware. - **FriendlyName** (string) - A user-friendly name for the device. - **LineupURL** (string) - URL to fetch the channel lineup. - **Manufacturer** (string) - Manufacturer of the device. - **ModelNumber** (string) - Model number of the device. - **TunerCount** (integer) - Number of tuners available. #### Response Example ```json { "BaseURL": "http://192.168.1.100:34400", "DeviceAuth": "xteve", "DeviceID": "2019-01-XXXX-XXXXXX", "FirmwareName": "bin_2.2.0", "FirmwareVersion": "2.2.0", "FriendlyName": "xTeVe", "LineupURL": "http://192.168.1.100:34400/lineup.json", "Manufacturer": "Golang", "ModelNumber": "2.2.0", "TunerCount": 1 } ``` ## GET /device.xml ### Description Returns UPnP device description XML for SSDP discovery. ### Method GET ### Endpoint /device.xml ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl http://localhost:34400/device.xml ``` ### Response #### Success Response (200) XML document describing the UPnP device. #### Response Example ```xml http://192.168.1.100:34400 1 0 urn:schemas-upnp-org:device:MediaServer:1 xTeVe Silicondust HDTC-2US HDTC-2US uuid:2019-01-XXXX-XXXXXX ``` ## GET /lineup_status.json ### Description Returns the current scan status for DVR setup. ### Method GET ### Endpoint /lineup_status.json ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl http://localhost:34400/lineup_status.json ``` ### Response #### Success Response (200) - **ScanInProgress** (integer) - Indicates if a scan is currently in progress (0 for no, 1 for yes). - **ScanPossible** (integer) - Indicates if a scan is possible (0 for no, 1 for yes). - **Source** (string) - The current source type (e.g., "Cable"). - **SourceList** (array of strings) - A list of available source types. #### Response Example ```json { "ScanInProgress": 0, "ScanPossible": 0, "Source": "Cable", "SourceList": ["Cable"] } ``` ## GET /lineup.json ### Description Returns the channel lineup in HDHomeRun format, used for DVR channel mapping. ### Method GET ### Endpoint /lineup.json ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash # Without authentication curl http://localhost:34400/lineup.json # With authentication (if enabled) curl -u username:password http://localhost:34400/lineup.json ``` ### Response #### Success Response (200) - **GuideName** (string) - The name of the channel as it appears in the guide. - **GuideNumber** (string) - The channel number. - **URL** (string) - The streaming URL for the channel. #### Response Example ```json [ { "GuideName": "CNN", "GuideNumber": "1000", "URL": "http://192.168.1.100:34400/stream/abc123def456" }, { "GuideName": "BBC World", "GuideNumber": "1001", "URL": "http://192.168.1.100:34400/stream/xyz789ghi012" } ] ``` ``` -------------------------------- ### WebSocket Commands Source: https://context7.com/xteve-project/xteve/llms.txt Connect to the WebSocket endpoint and send JSON commands to manage xTeVe server configuration, settings, file sources, channel filters, EPG mappings, and perform actions like creating backups or resetting logs. ```APIDOC ## WebSocket Commands Connect to the WebSocket endpoint and send JSON commands. ### Method WebSocket ### Endpoint `ws://localhost:34400/data/?Token=your-token` ### Description Send JSON commands to the WebSocket server to control various aspects of xTeVe. ### Commands - **getServerConfig**: Retrieves the current server configuration. - **saveSettings**: Saves updated server settings. - **Request Body**: - **cmd** (string) - Required - `"saveSettings"` - **settings** (object) - Required - Contains the settings to save. - **tuner** (integer) - Number of tuners. - **buffer** (string) - Buffering method (e.g., `"ffmpeg"`). - **"buffer.size.kb"** (integer) - Buffer size in kilobytes. - **saveFilesM3U**: Saves an M3U file source. - **Request Body**: - **cmd** (string) - Required - `"saveFilesM3U"` - **files** (object) - Required - Contains M3U file source configurations. - **"M3U1"** (object) - Configuration for an M3U source. - **name** (string) - Required - Name of the M3U source. - **"file.source"** (string) - Required - URL or path to the M3U file. - **tuner** (integer) - Number of tuners for this source. - **saveFilesXMLTV**: Saves an XMLTV file source. - **Request Body**: - **cmd** (string) - Required - `"saveFilesXMLTV"` - **files** (object) - Required - Contains XMLTV file source configurations. - **"XMLTV1"** (object) - Configuration for an XMLTV source. - **name** (string) - Required - Name of the XMLTV source. - **"file.source"** (string) - Required - URL or path to the XMLTV file. - **saveFilter**: Saves a channel filter configuration. - **Request Body**: - **cmd** (string) - Required - `"saveFilter"` - **filter** (object) - Required - Contains filter configurations. - **"0"** (object) - Configuration for a specific filter. - **active** (boolean) - Whether the filter is active. - **name** (string) - Name of the filter. - **type** (string) - Type of filter (e.g., `"group-title"`). - **filter** (string) - The filter value. - **saveEpgMapping**: Saves an EPG mapping configuration. - **Request Body**: - **cmd** (string) - Required - `"saveEpgMapping"` - **epg** (object) - Required - Contains EPG mapping configurations. - **"x-ID.0"** (object) - Configuration for a specific EPG mapping. - **"x-active"** (boolean) - Whether the mapping is active. - **"x-channelID"** (string) - The channel ID. - **"x-name"** (string) - The channel name. - **"x-xmltv-file"** (string) - The associated XMLTV file. - **"x-mapping"** (string) - The EPG mapping identifier. - **xteveBackup**: Creates a backup of the xTeVe configuration. - **resetLogs**: Resets the xTeVe logs. - **updateLog**: Updates the log view. ### Request Example (Save Settings) ```json { "cmd": "saveSettings", "settings": { "tuner": 2, "buffer": "ffmpeg", "buffer.size.kb": 2048 } } ``` ### Request Example (Save M3U Source) ```json { "cmd": "saveFilesM3U", "files": { "M3U1": { "name": "IPTV Provider", "file.source": "http://provider.com/playlist.m3u", "tuner": 2 } } } ``` ``` -------------------------------- ### Switching xTeVe Git Branches Source: https://github.com/xteve-project/xteve/blob/master/README.md Allows users to switch between the 'beta' and 'master' branches of the xTeVe Git repository. This is done by running xTeVe with a command-line argument. The output confirms the active branch. ```bash xteve -branch beta ... [xTeVe] GitHub: https://github.com/xteve-project [xTeVe] Git Branch: beta [xteve-project] ... ``` ```bash xteve -branch master ... [xTeVe] GitHub: https://github.com/xteve-project [xTeVe] Git Branch: master [xteve-project] ... ``` -------------------------------- ### Export M3U Playlist from xTeVe (Bash) Source: https://context7.com/xteve-project/xteve/llms.txt Downloads the M3U playlist, which contains the filtered and mapped channel lineup, using curl. Options are available to filter by group titles and include authentication credentials. ```bash # Download full M3U playlist curl -o channels.m3u http://localhost:34400/m3u/xteve.m3u # Filter by specific group titles curl "http://localhost:34400/m3u/xteve.m3u?group-title=Sports,News" # With authentication (if enabled) curl "http://localhost:34400/m3u/xteve.m3u?username=user&password=pass" ``` -------------------------------- ### REST API - Update HDHomeRun Sources Source: https://context7.com/xteve-project/xteve/llms.txt Trigger a refresh of HDHomeRun device sources. ```APIDOC ## POST /api/ ### Description Initiates a refresh process for HDHomeRun devices. This command rescans for available channels from connected HDHomeRun tuners. ### Method POST ### Endpoint `/api/` ### Parameters #### Request Body - **cmd** (string) - Required - Must be `"update.hdhr"`. - **token** (string) - Required - The authentication token. ### Request Example ```bash curl -X POST -H "Content-Type: application/json" \ -d '{"cmd":"update.hdhr","token":"your-token-here"}' \ http://localhost:34400/api/ ``` ``` -------------------------------- ### Discover xTeVe Device Information (Bash) Source: https://context7.com/xteve-project/xteve/llms.txt Uses curl to fetch device information from the HDHomeRun discovery endpoint. This JSON output is used by Plex and Emby for automatic DVR device discovery. ```bash curl http://localhost:34400/discover.json ``` -------------------------------- ### Image Endpoints Source: https://context7.com/xteve-project/xteve/llms.txt Endpoints for retrieving cached channel logos and program images, as well as user-uploaded custom logos. ```APIDOC ## Image Endpoints ### Cached Images #### GET /images/{filename} Retrieve cached channel logos and program images. **Parameters** - **filename** (string) - Required - The name of the image file to retrieve. **Request Example** ```bash curl http://localhost:34400/images/abc123.jpg -o logo.jpg ``` ### Uploaded Images #### GET /data_images/{filename} Retrieve user-uploaded custom logos. **Parameters** - **filename** (string) - Required - The name of the custom image file to retrieve. **Request Example** ```bash curl http://localhost:34400/data_images/custom_logo.png -o custom.png ``` ``` -------------------------------- ### REST API - Update M3U Playlists Source: https://context7.com/xteve-project/xteve/llms.txt Trigger a refresh of all configured M3U playlist sources. ```APIDOC ## POST /api/ ### Description Initiates a refresh process for all configured M3U playlist sources. This ensures that channel information is up-to-date. ### Method POST ### Endpoint `/api/` ### Parameters #### Request Body - **cmd** (string) - Required - Must be `"update.m3u"`. - **token** (string) - Required - The authentication token. ### Request Example ```bash curl -X POST -H "Content-Type: application/json" \ -d '{"cmd":"update.m3u","token":"your-token-here"}' \ http://localhost:34400/api/ ``` ### Response #### Success Response (200) - **status** (boolean) - Indicates if the update command was processed successfully. - **token** (string) - A new token for subsequent requests. ``` -------------------------------- ### Stream Channel (curl, vlc, ffplay) Source: https://context7.com/xteve-project/xteve/llms.txt Proxies a stream from its original source to the client. The `stream_id` is obtained from `lineup.json`. Buffering can be controlled via server settings, supporting direct passthrough, xTeVe's HLS buffer, or external buffering with FFmpeg or VLC. ```bash # Stream a channel (stream_id from lineup.json URL) curl http://localhost:34400/stream/abc123def456 # Use with media players vlc http://localhost:34400/stream/abc123def456 ffplay http://localhost:34400/stream/abc123def456 ``` -------------------------------- ### REST API - Update XEPG Mapping Source: https://context7.com/xteve-project/xteve/llms.txt Rebuild the XEPG database with current channel mappings. ```APIDOC ## POST /api/ ### Description Rebuilds the XEPG database using the current channel mappings. This is useful after making changes to channel configurations. ### Method POST ### Endpoint `/api/` ### Parameters #### Request Body - **cmd** (string) - Required - Must be `"update.xepg"`. - **token** (string) - Required - The authentication token. ### Request Example ```bash curl -X POST -H "Content-Type: application/json" \ -d '{"cmd":"update.xepg","token":"your-token-here"}' \ http://localhost:34400/api/ ``` ``` -------------------------------- ### Stream Proxy Endpoint Source: https://context7.com/xteve-project/xteve/llms.txt Proxies and optionally buffers streams from their original source. ```APIDOC ## GET /stream/{stream_id} ### Description Proxies and optionally buffers the stream from the original source to the client. The `stream_id` is typically obtained from the `lineup.json` URL. ### Method GET ### Endpoint `/stream/{stream_id}` ### Parameters #### Path Parameters - **stream_id** (string) - Required - The unique identifier for the stream. #### Query Parameters - **buffer** (string) - Optional - Specifies the buffering behavior. Options include `-` (direct passthrough), `xteve` (built-in buffer with HLS), `ffmpeg` (buffer using FFmpeg), or `vlc` (buffer using VLC). ### Request Example ```bash # Stream a channel (stream_id from lineup.json URL) curl http://localhost:34400/stream/abc123def456 # Use with media players vlc http://localhost:34400/stream/abc123def456 ffplay http://localhost:34400/stream/abc123def456 ``` ### Response #### Success Response (200) - **Stream Data** (binary) - The raw stream data from the source. ``` -------------------------------- ### REST API - Authentication Source: https://context7.com/xteve-project/xteve/llms.txt Authenticate to receive a token for subsequent API requests when authentication is enabled. ```APIDOC ## POST /api/ ### Description Authenticates the user and returns a token for subsequent API requests. This endpoint is used when API authentication is enabled in the xTeVe settings. ### Method POST ### Endpoint `/api/` ### Parameters #### Request Body - **cmd** (string) - Required - Must be `"login"`. - **username** (string) - Required - The username for authentication. - **password** (string) - Required - The password for authentication. ### Request Example ```json { "cmd": "login", "username": "admin", "password": "secret" } ``` ### Response #### Success Response (200) - **status** (boolean) - Indicates if the login was successful. - **token** (string) - The authentication token to be used in subsequent requests. #### Response Example ```json { "status": true, "token": "U0T-NTSaigh-RlbkqERsHvUpgvaaY2dyRGuwIIvv" } ``` ``` -------------------------------- ### JavaScript WebSocket Commands for xTeVe Control Source: https://context7.com/xteve-project/xteve/llms.txt Connect to the xTeVe WebSocket endpoint and send JSON commands to manage server configuration, save file sources (M3U, XMLTV), apply channel filters, configure EPG mappings, create backups, reset logs, and update the log view. Requires a WebSocket client library. ```javascript const ws = new WebSocket('ws://localhost:34400/data/?Token=your-token'); // Request server configuration ws.send(JSON.stringify({cmd: "getServerConfig"})); // Save settings ws.send(JSON.stringify({ cmd: "saveSettings", settings: { tuner: 2, buffer: "ffmpeg", "buffer.size.kb": 2048 } })); // Save M3U file source ws.send(JSON.stringify({ cmd: "saveFilesM3U", files: { "M3U1": { "name": "IPTV Provider", "file.source": "http://provider.com/playlist.m3u", "tuner": 2 } } })); // Save XMLTV file source ws.send(JSON.stringify({ cmd: "saveFilesXMLTV", files: { "XMLTV1": { "name": "EPG Source", "file.source": "http://provider.com/epg.xml" } } })); // Save channel filter ws.send(JSON.stringify({ cmd: "saveFilter", filter: { "0": { "active": true, "name": "Sports Filter", "type": "group-title", "filter": "Sports" } } })); // Save EPG mapping ws.send(JSON.stringify({ cmd: "saveEpgMapping", epg: { "x-ID.0": { "x-active": true, "x-channelID": "1000", "x-name": "CNN", "x-xmltv-file": "epg.xml", "x-mapping": "cnn.us" } } })); // Create backup ws.send(JSON.stringify({cmd: "xteveBackup"})); // Reset logs ws.send(JSON.stringify({cmd: "resetLogs"})); // Update log view ws.send(JSON.stringify({cmd: "updateLog"})); ``` -------------------------------- ### API Login (curl) Source: https://context7.com/xteve-project/xteve/llms.txt Authenticates with the xTeVe API to obtain a token, which is required for subsequent authenticated requests. This endpoint requires the API to be enabled in the server settings. ```bash curl -X POST -H "Content-Type: application/json" \ -d '{"cmd":"login","username":"admin","password":"secret"}' \ http://localhost:34400/api/ ``` -------------------------------- ### API Login Response Source: https://context7.com/xteve-project/xteve/llms.txt The JSON response from a successful API login request. It includes a status indicating success and an authentication token to be used in subsequent API calls. ```json { "status": true, "token": "U0T-NTSaigh-RlbkqERsHvUpgvaaY2dyRGuwIIvv" } ``` -------------------------------- ### Update M3U Playlists Response Source: https://context7.com/xteve-project/xteve/llms.txt The JSON response after requesting an M3U playlist update. It confirms the status of the operation and may provide a new token for subsequent requests. ```json { "status": true, "token": "new-token-for-next-request" } ```