Giter VIP home page Giter VIP logo

smi2ass's Introduction

smi2ass

smi2ass is a command-line tool that converts SAMI to SSA/ASS (SubStation Alpha).

Download the executable and run it with .smi file paths:

$ smi2ass my_subtitles.smi

smi2ass will convert the specified .smi files into .ass files. It will also generate multiple .ass files if the .smi file contains the subtitles of multiple languages.

$ ls my_subtitles.*
my_subtitles.eng.ass
my_subtitles.kor.ass

Supported tags

smi2ass supports <p>, <br>, <b>. <i>, <u>, <s>, <font> and <rt> (Ruby tags).

Fixing a bad SAMI file

smi2ass will not output anything if the conversion went OK. It prints the problematic SAMI fragment if it failed the conversion, so you can find the location of the problem in your .smi file, fix it and run again:

$ smi2ass my_bad_subtitles.smi
Failed to extract time code: <sync star=1234>

Credits

The conversion script was initially forked from https://github.com/hojel/service.subtitles.gomtv/tree/3a7342961e140eaf8250659b0ac6158ce5e6bc5c/resources/lib. Since then, @trustin made the following changes:

  • Added Ruby tag support
  • Improved the preservation of white spaces
  • Packaged into a single executable
  • Updated Python from 2 to 3
  • Updated BeautifulSoup from 3 to 4
  • Miscellaneous cleanup

smi2ass's People

Contributors

good-ghost avatar trustin avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

gk51 linearalpha

smi2ass's Issues

Problem with color code #808080 (gray) and #C0C0C0

I was testing the file below, and what I found is the if the color code is #808080 or #C0C0C0 it converts as H080808 or 0c0c0c which is not the same color code as the original file.

I was trying to debug it, but I cannot find why it is happening.

Also, I'm currently using python 3.8, pyinstaller=4.3, beautifulsoup4=4.9.3, chardet=4.0.0

Excellent Code, just found one deprecated and one bug.

Thanks for excellent code!
I forked your code for make smi2srt, and just found below issues.

  1. line 341,
    With 3.7 version og python, parser.unescape method is deprecated and need to replace with html.unescape.

  2. seperate_by_lang method did not work, because bs4.find() function return a array of result but your code expect a string in line 385. just replace '[languageTag]' to '[languageTag[0]]'.

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.