Code Monkey home page Code Monkey logo

vtt-to-srt's Introduction

asciicast

Python 3

Packages

  • pysrt
  • webvtt-py
pip3 install pysrt webvtt-py

Synopsis

./vtt-to-srt FILE...

Description

The command accepts one or more files as arguments. For each .vtt, a .srt will be generated in the same folder. Any other extension is ignored.

vtt-to-srt's People

Contributors

lbrayner avatar

Stargazers

 avatar  avatar  avatar  avatar  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  avatar  avatar

vtt-to-srt's Issues

manage styles in the output

First of all, thanks for your script. It was the only converter I found on github actually working when there are styles in the input vtt.

but would it be possible to add font style in the output? :)
For example here is an input:


WEBVTT

STYLE
::cue {
    font-family: Verdana, Arial, Tiresias;
    line-height: 125%;
}
::cue(.white) {
    color: #ffffff;
}
::cue(.lime) {
    color: #00ff00;
}
::cue(.cyan) {
    color: #00ffff;
}
::cue(.red) {
    color: #ff0000;
}
::cue(.yellow) {
    color: #ffff00;
}
::cue(.magenta) {
    color: #ff00ff;
}
::cue(.blue) {
    color: #0000ff;
}
::cue(.black) {
    color: #000000;
}
::cue(.bg_black) {
    background: rgba(0, 0, 0, 0.76);
}

sub0
00:00:07.120 --> 00:00:09.480 line:-1
<c.magenta.bg_black>Musique douce</c>

sub1
00:00:09.720 --> 00:00:29.520 align:left line:-1
<c.magenta.bg_black>---</c>

sub2
00:00:32.439 --> 00:00:35.320 line:-1
<c.magenta.bg_black>Musique douce</c>

sub3
00:00:35.560 --> 00:02:25.240 align:left line:-1
<c.magenta.bg_black>---</c>

sub4
00:02:25.480 --> 00:02:27.440 line:-1
<c.white.bg_black>-Stéphane ? Où on se gare ?</c>

the current output is:


1
00:00:07,120 --> 00:00:09,480
Musique douce

2
00:00:09,720 --> 00:00:29,520
---

3
00:00:32,439 --> 00:00:35,320
Musique douce

4
00:00:35,560 --> 00:02:25,240
---

5
00:02:25,480 --> 00:02:27,440
-Stéphane ? Où on se gare ?

The desired output would be


1
00:00:07,120 --> 00:00:09,480
<font color="#ff00ff">Musique douce</font> 

2
00:00:09,720 --> 00:00:29,520
<font color="#ff00ff">---</font> 

3
00:00:32,439 --> 00:00:35,320
<font color="#ff00ff">Musique douce</font> 

4
00:00:35,560 --> 00:02:25,240
<font color="#ff00ff">---</font> 

5
00:02:25,480 --> 00:02:27,440
-Stéphane ? Où on se gare ?

Port vtt-to-srt functionality

Hi Leonardo,

I am writing this issue because recently I got one myself about .vtt format isaacbernat/netflix-to-srt#21 . Seeing you have this here, also written in python, I thought you might be interested in porting the code to the one linked above. One reason would be because many people have already bookmarked it and if netflix is apparently using this new format many people would benefit from being able to convert it from the existing repository they already rely on.

Thanks in advance.

Isaac

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.