Skip to main content

a subtitle file format converter

Project description

swapsub

这是一个字幕文件格式转换器
支持LRC,SRT,TXT三者互转

安装

推荐使用pip包管理器进行安装

pip install swapsub

使用方法

导入swapsub

import swapsub

load()函数

load函数用于加载并预处理字幕文件

swapsub.load(path)

#path:文件路径 

load()函数将返回一个列表,里面包含里经预处理后的数据

convert()函数

convert函数用于转换并将转换后的文件储存到指定位置

swapsub.convert(data,path)

#data:load()函数返回的值  
#path:文件路径

示例

sub = swapsub.load("a.lrc")  
swapsub.convert(sub,"/home/cybytess/b.srt")

注意,路径须包含文件名及扩展名

许可证

GPL-3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swapsub-2.0.2b.tar.gz (14.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page