asstosrt

Convert ASS subtitle to SRT format.

  • Owner: sorz/asstosrt
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

asstosrt

asstosrt is a tool which can convert Advanced SubStation Alpha (ASS/SSA)
subtitle files to SubRip (SRT) files. Many old devices only support SubRip.

Usage

Install asstosrt.

::

# pip install asstosrt

chardet is suggested, which provide auto charset detection.

::

# pip install charset

Then cd into the directory of ASS/SSA files. Run asstosrt.

::

$ asstosrt

Done. All converted SRT files will be wrote to current directory.

Run with --help see more.

::

$ asstosrt --help

More Examples

Specify input and output encoding, output directory:

::

$ asstosrt -e utf-8 -s utf-18be -o /to/some/path/

Convert to Simplified Chinese (Using langconv.py <https://github.com/skydark/nstools/blob/master/zhtools/langconv.py>__ &
zh_wiki.py <https://github.com/skydark/nstools/blob/master/zhtools/zh_wiki.py>__):

::

$ asstosrt -t zh-hans -s gb18030 /path/to/some.big5.ass

Convert to Traditional Chinese (Using OpenCC):

::

# pip install pyopencc
$ asstosrt -c zhs2zht.ini 

Only keep first line for each dialogue and delete all effects:

::

$ asstosrt --only-first-line --no-effact

Used as a Library

You can use asstosrt on your program easily.

::

import asstosrt

ass_file = open('example.ass')
srt_str = asstosrt.convert(ass_file)

License

MIT License

Bugs and Issues

Please visit GitHub <https://github.com/sorz/asstosrt>__.

Main metrics

Overview
Name With Ownersorz/asstosrt
Primary LanguagePython
Program languagePython (Language Count: 1)
Platform
License:
所有者活动
Created At2012-03-06 11:23:33
Pushed At2018-01-25 09:13:57
Last Commit At2018-01-25 10:40:47
Release Count2
Last Release Namev0.1.6 (Posted on 2017-12-08 01:45:30)
First Release Namev0.1.5 (Posted on )
用户参与
Stargazers Count286
Watchers Count8
Fork Count52
Commits Count42
Has Issues Enabled
Issues Count6
Issue Open Count4
Pull Requests Count3
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private