Skip to content
Multi formats subtitles parser in C#
C# SRecode Template
Branch: master
Clone or download

Latest commit

AlexPoint Merge pull request #26 from gldraphael/add-summary-comments-for-intel…
…lisense

Add summary comments to SubtitleItem "times"
Latest commit b25815f Jan 8, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
SubtitlesParser.Tests Add naive tests Oct 12, 2019
SubtitlesParser Add summary comments to SubtitleItem "times" Jan 8, 2020
Test Handle vtt file that has no captions Mar 28, 2019
.gitignore Nuget was integrated in .NET Core so we don't need nuget exe. Jan 18, 2019
LICENSE Change license from GPL to MIT Aug 24, 2015
README.md Fixed Readme Jun 10, 2019
SubtitlesParser.sln Add a new xunit project for tests Oct 3, 2019
global.json Add global.json file Oct 12, 2019

README.md

SubtitlesParser

Universal subtitles parser which aims at supporting all subtitle formats. For more info on subtitles formats, see this page: http://en.wikipedia.org/wiki/Category:Subtitle_file_formats

It's available on Nuget:

Install-Package SubtitlesParser

For now, 7 different formats are supported:

Quickstart

You can check the Test project for subtitles files and more sample codes.

Universal parser

If you don't specify the subtitle format, the SubtitlesParser will try all the registered parsers (7 for now)

var parser = new SubtitlesParser.Classes.Parsers.SubParser();
using (var fileStream = File.OpenRead(pathToSrtFile)){
	var items = parser.ParseStream(fileStream);
}

Specific parser

You can use a specific parser if you know the format of the files you parse. For example, for parsing an srt file:

var parser = new SubtitlesParser.Classes.Parsers.SrtParser();
using (var fileStream = File.OpenRead(pathToSrtFile)){
	var items = parser.ParseStream(fileStream);
}
You can’t perform that action at this time.