From dc2e111c1491907c00f583b938bf9c8ca933abb9 Mon Sep 17 00:00:00 2001 From: Hami Lemon Date: Mon, 4 Apr 2022 13:35:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/ltc.iml | 4 +--- README.md | 37 +++++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.idea/ltc.iml b/.idea/ltc.iml index a41de17..5e764c4 100644 --- a/.idea/ltc.iml +++ b/.idea/ltc.iml @@ -2,9 +2,7 @@ - - - + diff --git a/README.md b/README.md index a59a074..f790b96 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,13 @@ [![Build](https://github.com/Hami-Lemon/LrcToSrt/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/Hami-Lemon/LrcToSrt/actions/workflows/go.yml) -用于将LRC歌词文件转换成SRT字幕文件 +用于将LRC歌词文件转换成ASS、SRT字幕文件 ## 功能 - [x] lrc文件转换成srt文件 -- [x] 从网易云音乐或QQ音乐上获取歌词,并转换成srt文件 -- [x] 从网易云音乐或QQ音乐上下载歌词 +- [x] lrc文件转换成ass文件 +- [x] 从网易云音乐或QQ音乐上获取歌词,并转换。 +- [x] 从网易云音乐或QQ音乐上下载歌词。 ## 下载 @@ -16,21 +17,25 @@ ## 开始使用 -``` -Usage: - D:\ProgrameStudy\lrc2srt\lts.exe [OPTIONS] +```text +LrcToCaptions(ltc) 将LRC歌词文件转换成字幕文件。 +ltc version: "0.3.4" (build 2022.03.30) -Application Options: - -i, --id= 歌曲的id,网易云和QQ音乐均可。 - -I, --input= 需要转换的LRC文件路径。 - -s, --source=[163|qq|QQ] 当设置id时有效,指定从网易云(163)还是QQ音乐(qq)上获取歌词。 - (default: 163) - -d, --download 只下载歌词,而不进行解析。 - -m, --mode=[1|2|3] 原文和译文的排列模式,可选值有:[1] [2] [3] (default: 1) - -v, --version 获取版本信息 +用法:ltc [options] OutputFile -Help Options: - -h, --help Show this help message +options: + + -d 设置该选项时,只下载歌词,而无需转换。 + -f value + 转换成的字幕文件格式,可选值:ass(默认),srt + -i string + 歌词来源,可以是歌词对应的歌曲id,也可以是歌词文件 + -m value + 设置歌词原文和译文的合并模式,可选值:1(默认),2,3。 + -s string + 选择从网易云还是QQ音乐上获取歌词,可选值:163(默认),qq。 (default "163") + -v 获取当前程序版本信息。 + -h 显示帮助信息。 ``` ### 获取歌曲id From b973ecb5624e0757eb3d82da66f95b3966def31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8F=88=E4=B9=90=E4=B8=8D=E7=94=9C=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E9=92=B1?= Date: Mon, 4 Apr 2022 13:36:32 +0800 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f790b96..d9444ed 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# LrcToSrt +# LrcToCaptons [![Build](https://github.com/Hami-Lemon/LrcToSrt/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/Hami-Lemon/LrcToSrt/actions/workflows/go.yml) From 425e354bca69a6d4875330bf927f4c293d397dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8F=88=E4=B9=90=E4=B8=8D=E7=94=9C=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E9=92=B1?= Date: Thu, 2 Jun 2022 15:46:25 +0800 Subject: [PATCH 3/3] update README --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index f790b96..b3fce7e 100644 --- a/README.md +++ b/README.md @@ -150,3 +150,18 @@ lts -i 003FJlVU1rxjv8 -m 2 -s qq "ふわふわ时间.srt" ## 结束时间处理策略 因为在LRC文件中,并不包含一句歌词的结束时间,所以在转换成SRT文件时,处理策略为,**一句歌词的结束时间为下一句歌词的开始时间,最后一句歌词的结束时间为其`开始时间+10秒`**,所以在打轴时,对进入间奏的地方应该手动调整歌词的结束时间。 + +## 源码编译 + +### 环境需求 + +- [Go 1.18+](https://golang.google.cn/dl/) + +### 编译 + +```bash +git clone https://github.com/Hami-Lemon/ltc.git +cd ./ltc/lrctocaptions +go build -o ltc.exe . +``` +