字幕自动匹配和修改工具

来源:互联网 发布:js播放视频 编辑:程序博客网 时间:2024/06/05 11:32

这几天出于兴趣写了一个关于字幕自动匹配下载和字幕修改的工具

  • 输入文件路径就可以自动下载出来对应匹配的字幕
  • 解析中文英文混杂的字幕,将英文或者中文单独提取出来

工具比较简陋,字幕匹配用了一个外国SubDB的API

但是可能是不太全吧感觉,匹配度虽然是100%
但是能匹配到的不是特别多,以后有时间还会继续修改这个项目吧,加一些中文匹配之类的

Github: https://github.com/WJerry0227/SubtitleUtil

Subtitle Util

Subtitle Util has a list of functions below

  • 1 Subtitle Transfer
  • 2 Subtitle Downloader

See each util for more details.

Requirement:
- python 2
- python -> urllib2

Installation:

 - git clone https://github.com/WJerry0227/SubtitleUtil.git - cd SubtitleUtil - python [Subtitle Util Type].py [Usage]

Contact:

wjerry227@gmail.com

About:
Developed by WJerry0227

1 Subtitle Transfer

Intro

It is a small python program to remove Chinese or English characters in your subtitle file

When I was watching This is us on my computer. I hate the Chinese subtitle mixed with English subtitle.

Therefore, this python program came to mind.

Usage

python SubtitleTransfer.py [YOUR SUBTITLE FILE PATH] [TYPE]
  • TYPE: The type that you want to delete from your subtitle.
  • [Chinese] [English] are available only
  • FILE PATH :.ass and .srt are available only

It will create a new file in your old path with the new postfix.

Encoding

The encoding of your subtitle will be automatically detected.

2 Subtitle Downloader

Intro

It is a small python program to download subtitle for your video

I always found the subtitle download from Internet does not fit with my video. Then I search this website SubDB. Thanks to the API it provides.

Usage

python SubtitleDownloader.py [YOUR VIDEO FILE PATH] [LANGUAGE]
  • [LANGUAGE] is optional.
  • [LANUGAGE] support type: [ en,es,fr,it,nl,pl,pt,ro,sv,tr ]
  • It does not support Chinese yet.

It will automatically download a [VIDEONAME].srt file in your video path.

原创粉丝点击