Coder Social home page Coder Social logo

compatibility error about subtitlesparser HOT 8 OPEN

alexpoint avatar alexpoint commented on September 14, 2024
compatibility error

from subtitlesparser.

Comments (8)

AlexPoint avatar AlexPoint commented on September 14, 2024

I think you are using the wrong File class.
You need to use System.IO.File.OpenRead (see documentation) and not Microsoft.AspNetCore.Http.IFormFile.OpenReadStream (see documentation).
Let me know if that works.

from subtitlesparser.

mondherroo avatar mondherroo commented on September 14, 2024

i already used System.IO.File.OpenRead but i got another error in that line
"var items = parser.ParseStream(fileStream);" About (ParseStream)

from subtitlesparser.

AlexPoint avatar AlexPoint commented on September 14, 2024

Could you copy and paste the code you are using to parse subtitle files and the complete error message that you get?

from subtitlesparser.

mondherroo avatar mondherroo commented on September 14, 2024

Sans titre

from subtitlesparser.

gldraphael avatar gldraphael commented on September 14, 2024

Here's a full working csx example:

#!/usr/bin/env dotnet-script
#r "nuget: SubtitlesParser, 1.4.8"
#load "serilog.csx"

using Serilog;
using SubtitlesParser.Classes.Parsers;

var parser = new VttParser();
using (var fileStream = File.OpenRead("captions.vtt")){
	var items = parser.ParseStream(fileStream, Encoding.UTF8);
    Log.Verbose("{@items}", items);
}

from subtitlesparser.

AlexPoint avatar AlexPoint commented on September 14, 2024

@mondherroo : your compiling error is due to the fact that you are not specifying an encoding when using the SrtParser.
The generic Parser (SubParser) has a method ParseStream which defaults the encoding to UTF-8 but not the specific parsers.

from subtitlesparser.

AlexPoint avatar AlexPoint commented on September 14, 2024

@gldraphael Could you provide the subtitles file as well (captions.vtt)?

from subtitlesparser.

gldraphael avatar gldraphael commented on September 14, 2024

Here's the file as a text document: captions.vtt.txt

Also, it'd be nice if the VttParser could default to a UTF8 encoding, since UTF8 would be in conformance to the WebVTT spec. Link

from subtitlesparser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.