Reviewed-on: #8
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.
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
|
🔌 Sources
🧭 Channel Navigation
|
|
🎬 VOD Browser
|
📅 Electronic Program Guide
⏺️ Recording
|
⚙️ 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
PassThroughscaling) - 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 |
F Fullscreen |
PgUp PgDn Prev / next channel |
🚀 Installation
🐍 Option 1 - Run from source (recommended)
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.pyfetches the latest MPV Windows build and drops the DLL in place. - Package manager -
scoop install mpvorwinget install mpv; the DLL is found on PATH automatically. - Manual - download an
x86_64-devbuild from mpv-winbuild-cmake releases and copylibmpv-2.dllnext tomain.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.dllmust be in the project root - runsetup_mpv.pyfirst. 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.
|
|
🔨 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/.gitignorealready excludeskeystore.properties,keystore/,*.jks,*.keystoreandlocal.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.txtand 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.
|
|
🎮 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
- Open Settings (gear icon, or
Settings > Preferences) - Go to the Playlists tab → + Add Playlist
- 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
- 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
- Settings → EPG Sources → + Add EPG Source
- Enter a name and the XMLTV URL (or a local file path)
- 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.dbon 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
playliststable. - Every row in
channelsholds astream_urlwith 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 |
|---|---|---|
|
|
|
Built with MPV · PyQt6 · ExoPlayer · Jetpack Compose