sunny 38705d4d8d
Build & Release / release (push) Successful in 11m25s
Tests / test (push) Successful in 37s
Merge pull request 'CI: build the Windows exe and attach it to releases' (#8) from ci/windows-exe into main
Reviewed-on: #8
2026-11-07 18:18:22 +00:00
2026-08-30 23:21:12 +01:00
2026-08-30 23:05:29 +01:00
2026-03-23 20:46:57 +00:00
2026-03-23 20:46:57 +00:00
2026-09-02 23:25:43 +01:00
2026-03-23 20:46:19 +00:00
2026-03-24 00:27:45 +00:00
2026-03-23 20:46:19 +00:00

KaliTV

KaliTV

Your IPTV, everywhere.

A modern IPTV player for Windows, FreeBSD, Android and Android TV.
Live TV, movies, series, a full EPG and DVR-style recording - powered by MPV and PyQt6 on the desktop, ExoPlayer and Jetpack Compose on mobile and TV.


Windows FreeBSD Android Android TV

Python PyQt6 MPV Kotlin Tests


Install · Features · Shortcuts · Android · Android TV · Development


📊 Project Status

Target Status Notes
🪟 Windows - from source 🟢 Stable The best-tested path
😈 FreeBSD - from source 🟢 Stable No portable binary; run from source
📦 Windows - portable .exe 🟡 Usable Previously-blocking crashes are fixed
🤖 Android 🟢 v1.1 Kotlin / Compose client, signed release build
📺 Android TV 🟡 v1.0 New remote-first client with a TiviMate-style guide; tested on the Android TV 16 emulator

349 tests across 18 modules, headless and network-free, passing on Windows.


✨ Features

📺 Playback

  • Hardware-accelerated video via MPV (gpu + hwdec auto-safe)
  • Live TV over MPEG-TS / HLS with low-latency buffering
  • Movies & series on demand from Xtream providers
  • Pause, seek, volume, mute
  • Audio output device picker (WASAPI / CoreAudio / PulseAudio / PipeWire / ALSA)
  • Audio & subtitle track selector
  • Screenshot the current frame
  • Fullscreen with auto-hiding controls
  • Compact / mini-player mode

🔌 Sources

  • Xtream Codes API - server URL, username, password
  • M3U / M3U8 from a remote URL or local file
  • Selective category import - sync only the groups you want
  • Multiple playlists side by side

🧭 Channel Navigation

  • Category sidebar
  • Real-time search
  • Favorites and recently-watched lists
  • Channel logos, fetched lazily as rows scroll in

🎬 VOD Browser

  • Poster-grid movie browser with centre-cropped art
  • Expandable season / episode tree for series
  • Category filtering and debounced search
  • Built for huge catalogues - posters load on demand for the cards actually on screen, so a 20,000-title category opens in a fraction of a second instead of queueing 20,000 HTTP requests
  • Switch between Xtream providers from the header

📅 Electronic Program Guide

  • XMLTV import from URL or local file
  • Multiple EPG sources, refreshed independently
  • Now/Next bar beneath the player
  • Full scrollable TV Guide grid
  • Schedule a recording straight from the guide

⏺️ Recording

  • Record the current channel instantly
  • Schedule future recordings from the EPG
  • Stops automatically when the programme ends
  • ffmpeg stream-copy to .ts - no re-encoding
  • Recordings library window for scheduled / live / done
⚙️ Settings & configuration

Settings is organised into five tabs - Playlists, EPG Sources, Recordings, General and Network.

Setting Tab What it does
Xtream account info Playlists Subscription status, expiry, trial flag, connections in use vs. allowed, server time
Audio output device General Choose which device mpv renders to
HTTP proxy Network Applied to both stream playback and playlist fetching
EPG sources EPG Sources Add, refresh or remove XMLTV feeds
Playlist management Playlists Add, edit, refresh or delete sources
Recordings directory Recordings Where captures are written

Everything persists to SQLite at %APPDATA%\KaliTV\kalitv.db.

🎨 Interface
  • Tokenised design system - dark and light themes, auto-switched from the OS colour scheme
  • Icon-driven controls (Lucide set) rather than emoji glyphs
  • Command palette (Ctrl+K) for fuzzy channel and action search
  • Toast notifications for transient outcomes
  • High-DPI aware (Qt PassThrough scaling)
  • Collapsible channel sidebar
  • Stream info overlay - resolution and bitrate
  • Windows media keys - Play/Pause, Stop, Volume, Mute via WM_APPCOMMAND

⌨️ Keyboard Shortcuts

▶️ Playback🖥️ View🧭 Navigation

Space Pause / resume
M Mute / unmute
↑ ↓ Volume up / down
T Audio & subtitle tracks
R Start / stop recording
Ctrl+S Screenshot

F Fullscreen
Ctrl+M Mini-player
Esc Exit fullscreen / close Guide
H Hide / show EPG bar
I Stream info overlay
Ctrl+B Toggle sidebar

PgUp PgDn Prev / next channel
Ctrl+L Focus search
Ctrl+K Command palette
G TV Guide  ·  V Movies & Series
Ctrl+J Recordings
Ctrl+F Favorite  ·  Ctrl+Q Quit


🚀 Installation

git clone https://tig.sshah.email/Cheeba/kalitv.git
cd kalitv
pip install -r requirements.txt
python setup_mpv.py          # fetches libmpv-2.dll
python main.py               # or double-click run.bat
Step-by-step, if any of that was unfamiliar

1 · Install Python

Grab the latest Python 3.10+ 64-bit installer from python.org/downloads. Tick "Add Python to PATH" before clicking Install, then confirm:

python --version

2 · Download KaliTV

git clone https://tig.sshah.email/Cheeba/kalitv.git
cd kalitv

3 · Install dependencies

pip install -r requirements.txt
Package Version Purpose
PyQt6 ≥ 6.5 UI framework
python-mpv ≥ 1.0.7 Bindings for MPV
requests ≥ 2.31 HTTP for playlists and EPG

4 · Set up MPV

KaliTV needs libmpv-2.dll for video playback. Pick one:

  • Automated - python setup_mpv.py fetches the latest MPV Windows build and drops the DLL in place.
  • Package manager - scoop install mpv or winget install mpv; the DLL is found on PATH automatically.
  • Manual - download an x86_64-dev build from mpv-winbuild-cmake releases and copy libmpv-2.dll next to main.py.

5 · Launch

python main.py

😈 Option 2 - FreeBSD

sudo pkg install python311 mpv ffmpeg
git clone https://tig.sshah.email/Cheeba/kalitv.git
cd kalitv
pip install -r requirements.txt
python main.py
If pip can't build PyQt6

Install it from ports instead:

sudo pkg install py311-qt6-pyqt
pip install python-mpv requests

The portable EXE build is Windows-only - on FreeBSD, run from source.


📦 Option 3 - Portable EXE (no Python required)

build_pyinstaller.bat

Installs PyInstaller if needed, then bundles the app, assets and libmpv-2.dll into a single dist\KaliTV.exe via kalitv.spec. Copy that one file to any Windows 10/11 machine and run it - no Python, no other prerequisites.

🩹 Three crashes that used to make this build unusable - all fixed
Symptom Root cause Fix
Crash on startup PyQt6.QtSvg was never bundled Added as an explicit hidden import in kalitv.spec
Freeze on the first frame mpv#9850 - auto-selected audio device stalls Resolve and pin an explicit audio device at init
UI not clickable The toast overlay swallowed every mouse event Overlay now sets WS_EX_TRANSPARENT so clicks pass through

Before building: libmpv-2.dll must be in the project root - run setup_mpv.py first. The EXE still sees less day-to-day use than source runs, so prefer Option 1 where you can.


🤖 Android App

A native client lives in android/ and brings KaliTV to mobile.

Version Set by the release tag (v1.2.3 → versionCode 10203)
App ID com.kalitv.android
Runs on Android 8.0 (API 26)+
Built against API 35, JDK 17
  • Playback - Media3 / ExoPlayer with HLS, a foreground MediaSessionService for lock-screen and notification controls
  • Subtitles - choose the font, size, text colour and background (including transparent) in Settings → Subtitles, with a preview
  • UI - Jetpack Compose + Material 3 + Navigation: channels, VOD, EPG and settings
  • Data - Room with migrations, Hilt DI, and the same Xtream / M3U / XMLTV handling as desktop, shared with the TV app through the :core module
  • Background - WorkManager jobs for playlist refresh and programme reminders
  • Updates - offers new releases from this repo and installs them in the app
🔨 Building the APK

1 · Install Android Studio (or the command-line SDK) with the API 35 platform.

2 · Point Gradle at your SDK:

cp android/local.properties.template android/local.properties
# then edit sdk.dir to your SDK path

3 · Build:

cd android
./gradlew assembleDebug        # gradlew.bat on Windows

The APK lands in android/app/build/outputs/apk/debug/. The project has three modules: :app (phone), :tv (Android TV) and :core (the shared data layer both depend on).

Signed release build - create android/keystore.properties with storeFile, storePassword, keyAlias and keyPassword, then run ./gradlew assembleRelease.

⚠️ Never commit signing material. android/.gitignore already excludes keystore.properties, keystore/, *.jks, *.keystore and local.properties.

🔄 In-app updates (phone and TV)

Both apps check this repo's latest release on launch (at most every 12 hours) and when you ask: Settings → About → Check for updates on TV, Settings → App updates on the phone. No account is needed.

  • An update shows its version, size and what's new, with Update now, Later and Skip this version.
  • The APK is downloaded, checked against the release's SHA256SUMS.txt and installed with Android's package installer. Playlists and settings are kept.
  • The first time, Android asks you to let KaliTV install apps. KaliTV opens that setting (Install unknown apps) and carries on by itself when you come back. After that, Android 12 and later usually update without asking again.
  • KaliTV closes while it updates; open it again afterwards.
  • Automatic checks can be turned off in the same place. Debug builds never check on launch.

Updates install only over an app signed with the same key, so they work for the release APKs. To point a build at a different Gitea server or repo:

./gradlew assembleRelease -Pkalitv.updateServer=https://git.example.com -Pkalitv.updateRepo=owner/kalitv

📺 Android TV App

A separate, remote-first client for Android TV / Google TV lives in android/tv/, laid out the way TiviMate users expect: the TV guide is home, with a live preview of the playing channel, and everything is driven by the D-pad.

Version Set by the release tag, like the phone app
App ID com.kalitv.tv (installs alongside the phone app)
Runs on Android TV 8.0 (API 26)+, tested on Android TV 16
Built against API 35, JDK 17
  • TV guide - EPG grid with channel numbers and logos, programme details and a live preview window, "now" line, reminders
  • Live TV - fullscreen with info bar, channel list overlay, groups, per-channel EPG, number-key tuning
  • Catch-up - on channels whose Xtream provider keeps recordings, the guide scrolls back through the archive and past programmes play like a movie (seekable). Watch from start restarts what's on now
  • Movies & Series - poster grids by category, detail pages, resume, next-episode autoplay. Both open on Continue watching when something is in progress, with progress bars on the posters; a series opens on the episode you were watching
  • Favourites - channels, movies and series together under Favourites in the main menu
  • Search, recently watched, multiple playlists, Xtream account info, group picker
  • Hide channels and groups - hold OK on a channel or a group; bring them back in Settings → Groups
  • Parental control - a 4-digit PIN locks channel groups and movie / series categories, and optionally Settings. Locked content stays out of the guide, lists, search and favourites until the PIN is entered, and locks again when KaliTV goes to the background
  • Sleep timer - in the player options (15 minutes to 2 hours); the last minute shows a countdown, and any key keeps watching
  • Subtitles on live TV - closed captions carried in the video (CEA-608), DVB subtitles and HLS subtitle tracks, from the player options. Subtitles stay on when you change channel. Teletext subtitles aren't supported by the player
  • Group order - your provider's order, A–Z, or arranged by hand (Settings → Groups)
  • Subtitle style - font, size, text colour and background, including transparent (Settings → Subtitles). A preview shows each choice at full-screen size as you move through it. Picture-based subtitles such as DVB keep their own look
  • In-app updates - new releases are offered and installed without leaving the app (how it works)
🎮 Remote control
Where Key Does
TV guide ↑ ↓ / ← → Move between channels / programmes (time is kept when changing channel)
OK Play the channel in the preview · OK again goes fullscreen · on a future programme: set a reminder · on a past programme with the replay icon: play the recording
Hold OK Channel menu: favourite, reminder, watch from start, back to now, hide channel
← at the start of the guide Channel groups (side menu) · on catch-up channels, ← keeps going back through the archive
Hold OK on a group Hide it, or lock it with the parental PIN
Back or Menu Main menu: Search, TV, Favourites, Movies, Series, Settings · Back again offers to exit
⏩ ⏪ Jump two hours forward / back
Watching TV ↑ ↓, CH+ CH− Previous / next channel (direction can be swapped in Settings)
OK or ← Channel list · ← again for groups · → for that channel's programmes
→ or Menu Options: audio track, subtitles, aspect ratio, favourite, watch from start, sleep timer, stream info
Hold OK Add / remove favourite
0-9 Type a channel number
Info Show / hide the info bar
Back Back to the TV guide
Movies & episodes ← → Seek (hold to go faster)
OK Play / pause
↑ Audio & subtitles
Anywhere Back Close the top panel or go back a screen
📲 Installing on your TV

Download KaliTV-<version>-androidtv.apk from the releases, then either:

  • adb - enable Developer options → USB / network debugging on the TV, then
    adb connect <tv-ip-address>
    adb install KaliTV-<version>-androidtv.apk
    
  • Downloader / file manager - sideload the APK with any TV file manager and allow "install unknown apps" for it when asked.

KaliTV then appears in the TV's Apps row with its banner. You only sideload it once: after that it updates itself from the releases.

🔨 Building the TV APK

Same setup as the phone app (SDK + local.properties), then:

cd android
./gradlew :tv:assembleDebug     # android/tv/build/outputs/apk/debug/tv-debug.apk
./gradlew :tv:assembleRelease   # signed with the same keystore.properties as the phone app

🎬 Getting Started

Adding a playlist
  1. Open Settings (gear icon, or Settings > Preferences)
  2. Go to the Playlists tab → + Add Playlist
  3. Pick your source type:
    • Xtream Codes API - Server URL, Username, Password
    • M3U URL - paste a remote link
    • M3U Local File - browse to a .m3u / .m3u8
  4. Save - channels load automatically

💡 For Xtream sources, hit Choose Groups to import only the categories you care about instead of every channel on the service.

Adding an EPG
  1. Settings → EPG Sources → + Add EPG Source
  2. Enter a name and the XMLTV URL (or a local file path)
  3. Refresh Selected (or Refresh All) to import guide data

Xtream providers usually expose XMLTV at:

http://yourprovider.com:8080/xmltv.php?username=USER&password=PASS
Setting up recording

Recording needs ffmpeg on the system.

Windows - put ffmpeg.exe on PATH, or at C:\ffmpeg\bin\ffmpeg.exe or C:\Program Files\ffmpeg\bin\ffmpeg.exe:

winget install ffmpeg
:: or
scoop install ffmpeg

FreeBSD:

sudo pkg install ffmpeg

Captures are written as .ts files to ~/Videos/KaliTV/ by default - change the directory in Settings.


💾 Data Storage

Platform Database location
Windows %APPDATA%\KaliTV\kalitv.db
Linux / FreeBSD $XDG_DATA_HOME/KaliTV/kalitv.db, else ~/.local/share/KaliTV/kalitv.db

Playlists, channels, EPG data, favorites, watch history, recordings and settings all live here. Cached channel logos and VOD posters sit alongside under cache/images/, sharded by hash and refetched once an entry is 30 days old.

Upgrading from an older version? KaliTV used to store its database at ~/KaliTV/kalitv.db on Linux and FreeBSD. On first launch it moves that file to the XDG location automatically and logs the move - nothing is deleted until the copy has been verified.

🔐 A note on credentials

Warning

Playlist credentials are stored in plain text.

  • Your Xtream username and password sit unencrypted in the playlists table.
  • Every row in channels holds a stream_url with those same credentials embedded in the path - that is simply how the Xtream Codes protocol builds stream URLs.

Anyone who can read the database file can recover your provider login. The file has no protection beyond your operating system's user account permissions.

In practice: don't put the database on a shared drive, don't commit it to a repository, and remember it is included if you back up your home directory or %APPDATA% somewhere less private. If you export a bug report or share logs, check them for credentials first.


🧪 Development

Running the tests

The suite is headless and makes no network calls, but it must run with Qt's offscreen platform plugin:

QT_QPA_PLATFORM=offscreen python -m pytest tests/
# Windows PowerShell
$env:QT_QPA_PLATFORM = "offscreen"; python -m pytest tests/

349 tests across 18 modules cover the parsers, database, recorder, player state, audio device selection, theme tokens, the image loader, and the UI widgets - channel list, EPG guide, VOD browser, settings, recordings, toasts and the command palette.

🚢 Releases

Pushing a v* tag runs .gitea/workflows/release.yml on the Linux Docker act_runner (ubuntu-latest). It builds the signed phone and Android TV APKs and the portable Windows EXE, and publishes a Gitea release with all three, a SHA256SUMS.txt and a changelog since the previous tag. The EXE is built with PyInstaller and kalitv.spec under Wine, as build_pyinstaller.bat does on Windows; if only the EXE fails, the APKs are still released. APK versions come from the tag: v1.2.3 becomes versionName 1.2.3 and versionCode 10203.

git tag v1.2.0 && git push origin v1.2.0

Publishing a release is also how installed apps get updated: their updater reads the latest release (Gitea leaves drafts and pre-releases out of it), takes the -android.apk or -androidtv.apk asset and checks it against SHA256SUMS.txt. Tags must keep going up, because the updater compares version codes. Its "What's new" list comes from the changelog, without merges and build:/ci:/docs:/test:/refactor:/chore: commits.

To try a build without releasing, open Actions → Build & Release → Run workflow: the same files are built and attached to the run as an artifact instead.

🔑 Repository secrets the workflow needs
Secret Value
RELEASE_TOKEN Gitea access token with write:repository
ANDROID_KEYSTORE_BASE64 The release keystore, base64-encoded (below)
ANDROID_KEYSTORE_PASSWORD Keystore password
ANDROID_KEY_ALIAS Key alias
ANDROID_KEY_PASSWORD Key password
SSH_KEY, SSH_HOST Optional. Upload through SSH to the Gitea host instead of the API, to get large files past Cloudflare's 100 MB request limit. Without them, files go through the API directly.

Encode the keystore on Windows and paste the clipboard into the secret:

[Convert]::ToBase64String([IO.File]::ReadAllBytes("android\keystore\release.jks")) | Set-Clipboard

Use the same keystore for every release: Android refuses to update an app signed with a different key. The runner needs nothing preinstalled beyond the stock image: the workflow sets up the JDK and Android SDK itself.

📁 Project structure
kalitv/
├── main.py                  # Entry point
├── run.bat                  # One-click launcher
├── build_pyinstaller.bat    # Portable EXE builder (uses kalitv.spec)
├── kalitv.spec              # PyInstaller build spec
├── setup_mpv.py             # MPV DLL download helper
├── requirements.txt
├── assets/                  # Logo (light + dark) and Lucide icon set
├── tests/                   # pytest suite - 349 tests, 18 modules
│
├── android/                 # Native Android clients (Kotlin, Compose, Media3)
│   ├── core/                # Shared by phone and TV
│   │   └── src/main/java/com/kalitv/android/
│   │       ├── data/        # Xtream API, Room DB, repositories
│   │       ├── service/     # ExoPlayer factory, background refresh worker
│   │       └── util/        # M3U & XMLTV parsers
│   ├── app/                 # Phone / tablet app (com.kalitv.android)
│   │   └── src/main/java/com/kalitv/android/
│   │       ├── service/     # PlaybackService, reminder worker
│   │       └── ui/          # channels, vod, epg, player, settings screens
│   ├── tv/                  # Android TV app (com.kalitv.tv)
│   │   └── src/main/java/com/kalitv/tv/
│   │       ├── data/        # TV prefs, foreground sync, active playlist
│   │       └── ui/          # guide, live, vod, search, settings, player, components
│   └── settings.gradle.kts
│
└── src/
    ├── main_window.py       # Main window & media key handling
    ├── player.py            # MPV Qt widget (HWND embedding), audio device resolution
    ├── channel_list.py      # Sidebar: search, categories, favorites
    ├── epg_bar.py           # Now/Next programme bar
    ├── epg_guide.py         # Full TV Guide grid
    ├── vod_browser.py       # Movies & series browser
    ├── recorder.py          # Instant & EPG-scheduled recording (ffmpeg)
    ├── settings_dialog.py   # Playlists, EPG, recordings, general & network
    ├── account_info.py      # Xtream account panel
    ├── xtream.py            # Xtream Codes API client + M3U parser
    ├── xmltv.py             # XMLTV EPG parser
    ├── database.py          # SQLite persistence layer
    ├── image_loader.py      # Shared async logo/poster pool (memory + disk cache)
    ├── workers.py           # QThread lifecycle helpers
    ├── theme.py             # Tokenised dark/light design system + QSS generator
    ├── icons.py             # Lucide icon loader (recolour + cache)
    ├── recordings_window.py # Recordings library window
    └── ui/                  # controls, overlays, toast, command_palette

📋 Requirements

🪟 Windows 10/11 (64-bit)😈 FreeBSD🤖 Android
  • Python 3.10+ (not needed for the EXE)
  • libmpv-2.dll
  • ffmpeg (recording only)
  • Python 3.10+
  • pkg install mpv
  • pkg install ffmpeg (recording only)
  • Android 8.0 (API 26)+ to run
  • API 35 SDK + JDK 17 to build

Built with MPV · PyQt6 · ExoPlayer · Jetpack Compose
S
Description
No description provided
Readme
45 MiB
0 Stars 1 Watchers 0 Forks
KaliTV v1.4.1
Latest
2026-11-07 18:49:23 +00:00
Languages
Python 54.1%
Kotlin 45.5%
Batchfile 0.4%