Menu

Parsing M3U playlists in Dart: what the format really looks like (and what breaks)
📰

Parsing M3U playlists in Dart: what the format really looks like (and what breaks)

DEV Community: dart·Walistv·1 day ago
#4CjBweZN
#devtodart#devto#dev#extm3u#extinf
Long article (744 words) — no AI summary yet.
Reading 0:00
15s threshold

When we started building WalisTV , a free M3U player for Android TV and Windows, we assumed M3U was a simple format. It is, until you open real playlists. This post shows what the format looks like, a small Dart parser, and the things that broke for us.

What an M3U playlist is

An M3U playlist is a plain text file. The extended version starts with #EXTM3U , then each entry is a metadata line ( #EXTINF ) followed by the stream URL:

#EXTM3U #EXTINF:-1 tvg-id="news1" tvg-logo="https://example.com/logo.png" group-title="News",News Channel 1 https://example.com/stream/news1.m3u8 #EXTINF:-1 group-title="Sport",Sport Channel 2 https://example.com/stream/sport2.m3u8

Enter fullscreen mode

Exit fullscreen mode

-1 is the duration. For live streams it is always -1 .

key="value" pairs ( tvg-id , tvg-logo , group-title ...) are not part of the original spec.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.