Giter VIP home page Giter VIP logo

srtparser's Introduction

SRTParser

SRTParser is everything that you need to deal with SRT files, legend files.

Installation

As a light weight version of the code that has been optimized for Android devices, the best way to make use of it is cloning the code and adding it to your project.

Contributing

Pull requests are welcome.

Please make sure to update tests as appropriate.

What is this project for?

The purpose of this project is to give Java or Android developers an easy, fast, performant and light weight srt library.

You can easily read srt files, re-sync and search for a specific subtitle in your player, or anything that is needed a subtitle.

The usage of the project:

import main.gusthavo.srt.SRTParser;
import main.gusthavo.srt.Subtitle;

import java.io.File;
import java.util.ArrayList;
import java.util.logging.Logger;

public class MyClass {

    private final static Logger logger = Logger.getLogger(MyClass.class.getName());

    public static void main(String[] args) {
        String path = System.getProperty("user.dir") + File.separator + "files" + File.separator +"sub.srt";

        boolean keepNewLinesEscaped = true;

        ArrayList<Subtitle> subtitles = SRTParser.getSubtitlesFromFile(path, keepNewLinesEscaped);

        for (Subtitle subtitle : subtitles) {
            logger.info(subtitle.toString());
            // Print out: Subtitle [id=1, startTime=00:00:01,500, endTime=00:00:02,500, text=Testing str file., timeIn=1500, timeOut=2500]
        }
    }
}

Version 0.0.2

srtparser's People

Contributors

dependabot[bot] avatar easonwang00 avatar gusthavosouza avatar usilitel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

srtparser's Issues

readme

Please, fix the readme description.
You write: "ArrayList subtitles = SRTReader.getSubtitlesFromFile(path, keepNewLinesEscaped);"
correct "ArrayList subtitles = SRTParser.getSubtitlesFromFile(path, keepNewLinesEscaped);"

What is the License of your code?

Hi there @gusthavosouza,

I have been reading the code for the SRTParser and might be hoping to use it in an Android app.

What is the license policy of your code? Could you add a LICENSE.md file so it's clear?

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.