Workaround — Adds
tvc-stream-timestamps="rewrite"to M3U entries so Channels DVR can correctly record IPTV streams from Dispatcharr.
When using Dispatcharr as an IPTV source for Channels DVR, recordings of live IPTV streams can fail or produce broken files due to incorrect stream timestamps.
Channels DVR supports a per-stream tag — tvc-stream-timestamps="rewrite" — that instructs it to rewrite timestamps on ingest, fixing the issue. Dispatcharr does not currently expose a way to inject this tag into its M3U output.
This script bridges that gap until native support is added to Dispatcharr.
Dispatcharr M3U URL
│
▼
Python Script
(adds tvc-stream-timestamps="rewrite" to every #EXTINF line)
│
▼
Modified .m3u files
served via Caddy on your LAN
│
▼
Channels DVR
(uses modified M3U — recordings work correctly)
The script:
- Fetches one or more M3U playlists from your Dispatcharr instance
- Injects
tvc-stream-timestamps="rewrite"into every#EXTINFline - Saves each playlist as a named
.m3ufile (e.g.TNT Sports.m3u,Sky.m3u) - Files are served locally over your LAN via Caddy
- Python 3.8+
requestslibrary (pip install requests)- A running Dispatcharr instance
- Caddy (or any file server) to serve the output files
git clone https://github.com/yourusername/dispatcharr-m3u-fix.git
cd dispatcharr-m3u-fixpip install requestsEdit m3u-update.py and update the two configuration values at the top:
M3U_URLS = [
"http://<your-dispatcharr-ip>:<port>/output/m3u/TNT Sports?cachedlogos=false",
"http://<your-dispatcharr-ip>:<port>/output/m3u/Sky?cachedlogos=false",
# Add more playlists as needed...
]
OUTPUT_DIR = "/caddy/M3U" # Where the modified .m3u files will be savedpython m3u-update.pyExample output:
============================================================
M3U Modifier – adding tvc-stream-timestamps
Processing 9 playlist(s)
============================================================
[TNT Sports]
URL: http://10.0.60.51:9191/output/m3u/TNT Sports?cachedlogos=false
✓ Downloaded 48,291 characters
✓ Added tvc-stream-timestamps to 42 stream entries
✓ Saved → /caddy/M3U/TNT Sports.m3u (47.2 KB)
...
============================================================
Completed: 9 succeeded | 0 failed
Output dir: /caddy/M3U
============================================================
To keep your playlists fresh, run the script on a schedule:
# Refresh every 6 hours
0 */6 * * * /usr/bin/python3 /path/to/m3u-update.pyServe the modified files over your LAN using Caddy. The config below restricts access to your local subnet only — no exposure outside your network.
10.0.0.32:8080 {
root * /caddy/M3U
# Restrict to LAN only
@blocked not remote_ip 10.0.0.0/24
respond @blocked 403
header {
Access-Control-Allow-Origin *
Access-Control-Allow-Methods "GET, OPTIONS"
Access-Control-Allow-Headers *
}
@options method OPTIONS
respond @options 204
file_server
}Your playlists will then be available at:
http://10.0.0.32:8080/TNT Sports.m3u
http://10.0.0.32:8080/Sky.m3u
Point Channels DVR at these URLs instead of the Dispatcharr URLs directly.
Before (from Dispatcharr):
#EXTINF:-1 tvg-id="250" tvg-name="Sky Arts" group-title="Entertainment"
After (served to Channels DVR):
#EXTINF:-1 tvc-stream-timestamps="rewrite" tvg-id="250" tvg-name="Sky Arts" group-title="Entertainment"
The tag tells Channels DVR to rewrite stream timestamps on ingest rather than trusting the source timestamps, which fixes broken recordings caused by non-standard timestamp values in IPTV streams.
- Multi-playlist support
- Auto-naming from URL path
- LAN-only Caddy serving
- ⏳ Awaiting native
tvc-stream-timestampssupport in Dispatcharr
Once Dispatcharr adds this tag natively to its M3U output, this workaround will no longer be needed and you can point Channels DVR back at Dispatcharr directly.
- Dispatcharr — the IPTV playlist manager this works around
- Channels DVR — the DVR software consuming these playlists
- tvc-stream-timestamps documentation — Channels DVR community docs