#srt #path #sub-rip

srt_parser

A simple SubRip file parser

7 releases

0.1.15 Oct 21, 2022
0.1.14 Oct 18, 2022

#12 in #srt

Download history 8/week @ 2024-02-25 29/week @ 2024-03-24 68/week @ 2024-03-31

97 downloads per month

MIT license

8KB
129 lines

srt_parser

A simple SubRip file parser. Example usage -

use std::path::PathBuf;
use srt_parser::SubRipFile;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let subs = SubRipFile::new(PathBuf::from("test.srt"))?;
    
    for sub in subs.subtitles() {
      println!("{:#?}", sub);
    }

    Ok(())
}

lib.rs:

A simple SubRip file parser. Example usage -

use std::path::PathBuf;

use srt_parser::SubRipFile;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let subs = SubRipFile::new(PathBuf::from("test.srt"))?;

    for sub in subs.subtitles() {
        println!("{:#?}", sub);
    }

    Ok(())
}

Dependencies

~1.5MB
~25K SLoC