A dotnet parser for M3U file format
File: simple-vod.txt
#EXTM3U
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10.0,
http://example.com/movie1/fileSequenceA.ts
#EXTINF:10.0,
http://example.com/movie1/fileSequenceB.ts
#EXTINF:10.0,
http://example.com/movie1/fileSequenceC.ts
#EXTINF:9.0,
http://example.com/movie1/fileSequenceD.ts
#EXT-X-ENDLIST
File: header-parameter.txt
#EXTM3U url-tvg="http://www.website.com" m3uautoload=1 cache=500 deinterlace=1 tvg-shift=0
#EXTINF:-1 tvgname="name tv" tvglogo="logo tv" grouptitle="group" ,Title Raw
http://192.168.1.1:4022/udp/225.50.125.10:5000
var content = @"#EXTM3U
#EXTINF:123, Sample artist - Sample title
C:\Documents and Settings\I\My Music\Sample.mp3
#EXTINF:321,Example Artist - Example title
C:\Documents and Settings\I\My Music\Greatest Hits\Example.ogg
";
var contentM3u = M3U.Parse(content);
var simpleVodM3u = M3U.ParseFromFile("simpleVod.txt");
var simpleVodM3u = M3U.ParseFromFile("headerParameter.txt");
- Parse m3u settings: PlayListType, TargetDuration, Version, MediaSequence and attributes
- Parse m3u media list: Duration, Title, MediaFile, IsStream and attributes
- Every else will be parsed in warning list
PM> Install-Package m3uParser.NET
Little size codebase