From e1a026bae3bd5e5ca75ce4b6dd43d6876576a7bc Mon Sep 17 00:00:00 2001
From: BingLingGroup <42505588+BingLingGroup@users.noreply.github.com>
Date: Tue, 5 Nov 2019 21:51:43 +0800
Subject: [PATCH 1/8] Docs fix changelog
---
CHANGELOG.md | 15 +++++++++------
docs/CHANGELOG.zh-Hans.md | 17 ++++++++++-------
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ff8e66b9..7bdec99a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,19 +9,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## TOC
-- [[0.5.2-alpha] - 2019-11-05](#052-alpha---2019-11-05)
+- [0.5.2-alpha - 2019-11-05](#052-alpha---2019-11-05)
- [Added](#added052-alpha)
- [Changed](#changed052-alpha)
-- [[0.5.1-alpha] - 2019-08-02](#051-alpha---2019-08-02)
+- [0.5.1-alpha - 2019-08-02](#051-alpha---2019-08-02)
- [Added](#added051-alpha)
- [Changed](#changed051-alpha)
-- [[0.5.0-alpha] - 2019-07-27](#050-alpha---2019-07-27)
+- [0.5.0-alpha - 2019-07-27](#050-alpha---2019-07-27)
- [Added](#added050-alpha)
- [Changed](#changed050-alpha)
-- [[0.4.1-alpha] - 2019-07-11](#041-alpha---2019-07-11)
+- [0.4.1-alpha - 2019-07-11](#041-alpha---2019-07-11)
- [Added](#added041-alpha)
- [Changed](#changed041-alpha)
-- [[0.4.0-alpha] - 2019-02-17](#040-alpha---2019-02-17)
+- [0.4.0-alpha - 2019-02-17](#040-alpha---2019-02-17)
- [Changed](#changed040-alpha)
Click up arrow to go back to TOC.
@@ -37,6 +37,8 @@ Click up arrow to go back to TOC.
- Fix last row of empty translation text missing issue. [issue #62](https://github.com/BingLingGroup/autosub/issues/62)
- Fix executable file detection problem in the current directory.
+ ↑
+
### [0.5.1-alpha] - 2019-08-02
#### Added(0.5.1-alpha)
@@ -141,7 +143,8 @@ Click up arrow to go back to TOC.
↑
-[Unreleased]: https://github.com/BingLingGroup/autosub/compare/0.5.1-alpha...HEAD
+[Unreleased]: https://github.com/BingLingGroup/autosub/compare/0.5.2-alpha...HEAD
+[0.5.2-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.1-alpha...0.5.2-alpha
[0.5.1-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.0-alpha...0.5.1-alpha
[0.5.0-alpha]: https://github.com/BingLingGroup/autosub/compare/0.4.1-alpha...0.5.0-alpha
[0.4.1-alpha]: https://github.com/BingLingGroup/autosub/compare/0.4.0-alpha...0.4.1-alpha
diff --git a/docs/CHANGELOG.zh-Hans.md b/docs/CHANGELOG.zh-Hans.md
index 25c6bef7..96bcceff 100644
--- a/docs/CHANGELOG.zh-Hans.md
+++ b/docs/CHANGELOG.zh-Hans.md
@@ -8,19 +8,19 @@
## 目录
-- [[0.5.2-alpha] - 2019-11-05](#052-alpha---2019-11-05)
+- [0.5.2-alpha - 2019-11-05](#052-alpha---2019-11-05)
- [添加](#添加052-alpha)
- [改动](#改动052-alpha)
-- [[0.5.1-alpha] - 2019-08-02](#051-alpha---2019-08-02)
+- [0.5.1-alpha - 2019-08-02](#051-alpha---2019-08-02)
- [添加](#添加051-alpha)
- [改动](#改动051-alpha)
-- [[0.5.0-alpha] - 2019-07-27](#050-alpha---2019-07-27)
+- [0.5.0-alpha - 2019-07-27](#050-alpha---2019-07-27)
- [添加](#添加050-alpha)
- [改动](#改动050-alpha)
-- [[0.4.1-alpha] - 2019-07-11](#041-alpha---2019-07-11)
+- [0.4.1-alpha - 2019-07-11](#041-alpha---2019-07-11)
- [添加](#添加041-alpha)
- [改动](#改动041-alpha)
-- [[0.4.0-alpha] - 2019-02-17](#040-alpha---2019-02-17)
+- [0.4.0-alpha - 2019-02-17](#040-alpha---2019-02-17)
- [改动](#改动040-alpha)
点击上箭头以返回目录。
@@ -36,6 +36,8 @@
- 修复最后一排空翻译丢行问题。[issue #62](https://github.com/BingLingGroup/autosub/issues/62)
- 修复当前运行路径的可执行文件检测问题。
+ ↑
+
### [0.5.1-alpha] - 2019-08-02
#### 添加(0.5.1-alpha)
@@ -48,7 +50,7 @@
- 修复unix subprocess.check_output的兼容性问题。[issue #47](https://github.com/BingLingGroup/autosub/issues/47)
- 修复googletrans全角字符长度过长翻译错误的问题。[issue #49](https://github.com/BingLingGroup/autosub/issues/49)
- ↑
+ ↑
### [0.5.0-alpha] - 2019-07-27
@@ -134,7 +136,8 @@
↑
-[Unreleased]: https://github.com/BingLingGroup/autosub/compare/0.5.1-alpha...HEAD
+[未发布]: https://github.com/BingLingGroup/autosub/compare/0.5.2-alpha...HEAD
+[0.5.2-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.1-alpha...0.5.2-alpha
[0.5.1-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.0-alpha...0.5.1-alpha
[0.5.0-alpha]: https://github.com/BingLingGroup/autosub/compare/0.4.1-alpha...0.5.0-alpha
[0.4.1-alpha]: https://github.com/BingLingGroup/autosub/compare/0.4.0-alpha...0.4.1-alpha
From b490f12c2341de698fa5c987e41e2a4af46f48d5 Mon Sep 17 00:00:00 2001
From: BingLingGroup <42505588+BingLingGroup@users.noreply.github.com>
Date: Thu, 7 Nov 2019 11:49:29 +0800
Subject: [PATCH 2/8] Docs update readme
---
README.md | 13 +++++++++++--
.../zh_CN/LC_MESSAGES/autosub.ffmpeg_utils.mo | Bin 1614 -> 1614 bytes
.../zh_CN/LC_MESSAGES/autosub.ffmpeg_utils.po | 10 +++++-----
autosub/ffmpeg_utils.py | 6 +++++-
docs/README.zh-Hans.md | 13 +++++++++++--
5 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index df59936e..7084b8b7 100644
--- a/README.md
+++ b/README.md
@@ -713,11 +713,20 @@ Bugs and suggestions can be reported at [issues](https://github.com/BingLingGrou
I only write the scripts for building standalone executable files on windows, [Nuitka script](scripts/nuitka_build.bat) and [pyinstaller script](scripts/pyinstaller_build.bat).
-Nuitka build is pretty tricky. I use anaconda as the package manager because [Nuitka readme](https://github.com/Nuitka/Nuitka#id6) recommends using it. I use anaconda Python3.5 and [m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc) to build. [m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc) perhaps is the stablest 64bit C compiler on this specific case. Other C compiler or Python environment may fail to compile due to unknown reasons. And for those whose os language is not `en_US`, please set it to `en_US` and then start to build. Otherwise you will encounter this [known issue](https://github.com/Nuitka/Nuitka/issues/193).
+Nuitka build is pretty tricky. These two environments I tried and worked.
+
+1. Anaconda recommended by [Nuitka readme](https://github.com/Nuitka/Nuitka#id6).
+ - Python version 3.5
+ - mingw-w64 package [m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc) (No need to set the environment variables separately if you run it on Anaconda Prompt)
+2. Use other C Compiler rather than the [m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc) by setting the value of environment variable `CC` which is the path to the C Compiler, including the executable name. For example, you install [MingW-W64-builds](http://mingw-w64.org/doku.php/download/mingw-builds) somewhere on your storage and you want Nuitka to use it. In this case, Python 3.5 is still recommended.
+
+And for those whose os language is not `en_US`, please set it to `en_US` and then start to build. Otherwise you may encounter this [known issue](https://github.com/Nuitka/Nuitka/issues/193).
Pyinstaller build is more robust. No issues encountered when the spec file is written in the proper way.
-[create_release.py](scripts/create_release.py) is used to make the two release packages. You need to create a `binaries` folder containing ffmpeg and ffmpeg-normalize executable files if you want to create a "fully" standalone release like the one I release. `ffmpeg.exe` and `ffprobe.exe` are from [Zeranoe ffmpeg windows build](https://ffmpeg.zeranoe.com/builds/). It should have the directory structure like this below.
+[create_release.py](scripts/create_release.py) is used to make the two release packages. You need to create a `binaries` folder containing ffmpeg and ffmpeg-normalize executable files if you want to create a "fully" standalone release like the one I release. `ffmpeg.exe` and `ffprobe.exe` are from [Zeranoe ffmpeg windows build](https://ffmpeg.zeranoe.com/builds/). `ffmpeg-normalize.exe` built in the same way as I mentioned [above](#install-on-windows).
+
+It should have the directory structure like this below.
```
binaries\ffmpeg.exe
diff --git a/autosub/data/locale/zh_CN/LC_MESSAGES/autosub.ffmpeg_utils.mo b/autosub/data/locale/zh_CN/LC_MESSAGES/autosub.ffmpeg_utils.mo
index e38a476aaa791c2ce11a2a674f6215cce5f8b48f..1de34516b57300b24ac8acead02e721eceeaa12f 100644
GIT binary patch
delta 20
bcmX@dbB&F*Cclf}x?6iRET1W)WrpKb{2%
delta 20
bcmX@dbB&F*Ccdf{}rhk?CeDW)WrpKS>1t
diff --git a/autosub/data/locale/zh_CN/LC_MESSAGES/autosub.ffmpeg_utils.po b/autosub/data/locale/zh_CN/LC_MESSAGES/autosub.ffmpeg_utils.po
index 7a34a048..48e1bef8 100644
--- a/autosub/data/locale/zh_CN/LC_MESSAGES/autosub.ffmpeg_utils.po
+++ b/autosub/data/locale/zh_CN/LC_MESSAGES/autosub.ffmpeg_utils.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2019-11-03 20:25+0800\n"
+"POT-Creation-Date: 2019-11-07 11:49+0800\n"
"PO-Revision-Date: 2019-07-28 15:09+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -39,22 +39,22 @@ msgstr "输入你视频的帧率。任何非法的值会被当作\".srt\"格式
msgid "Use \".srt\" instead."
msgstr "改用\".srt\"格式。"
-#: autosub/ffmpeg_utils.py:217
+#: autosub/ffmpeg_utils.py:221
msgid ""
"Warning: Dependency ffmpeg-normalize not found on this machine. Try default "
"method."
msgstr ""
"警告:依赖ffmpeg-normalize未在这台电脑上找到。尝试默认的方法去转换格式。"
-#: autosub/ffmpeg_utils.py:229
+#: autosub/ffmpeg_utils.py:233
msgid ""
"There is already a file with the same name in this location: \"{dest_name}\"."
msgstr "在此处已有同名文件:\"{dest_name}\"。"
-#: autosub/ffmpeg_utils.py:232
+#: autosub/ffmpeg_utils.py:236
msgid "Input a new path (including directory and file name) for output file.\n"
msgstr "为输出文件输入一个新的路径(包括路径和文件名)。\n"
-#: autosub/ffmpeg_utils.py:250 autosub/ffmpeg_utils.py:283
+#: autosub/ffmpeg_utils.py:254 autosub/ffmpeg_utils.py:287
msgid "Audio pre-processing failed. Try default method."
msgstr "音频预处理失败。尝试默认的方法去转换格式。"
diff --git a/autosub/ffmpeg_utils.py b/autosub/ffmpeg_utils.py
index 93fcd575..43577b73 100644
--- a/autosub/ffmpeg_utils.py
+++ b/autosub/ffmpeg_utils.py
@@ -180,10 +180,14 @@ def which_exe(program_path):
program = os.path.join(path, program_path)
if is_exe(program):
return program
- # if program located locally
+ # if program located at app's directory
program_name = os.path.join(constants.APP_PATH, os.path.basename(program_path))
if is_exe(program_name):
return program_name
+ # if program located at current directory
+ program_name = os.path.join(os.getcwd(), os.path.basename(program_path))
+ if is_exe(program_name):
+ return program_name
return None
diff --git a/docs/README.zh-Hans.md b/docs/README.zh-Hans.md
index 9afdff85..4212d0bc 100644
--- a/docs/README.zh-Hans.md
+++ b/docs/README.zh-Hans.md
@@ -646,11 +646,20 @@ for /f "delims=^" %%i in ('dir /b %in_format%') do (
我只写了在windows上构建独立运行程序的脚本,一个用于[Nuitka](../scripts/nuitka_build.bat)一个用于[pyinstaller](../scripts/pyinstaller_build.bat)。
-Nuitka的构建有点麻烦。我使用anaconda作为包管理器,因为[Nuitka readme](https://github.com/Nuitka/Nuitka#id6)是这么建议的。我使用anaconda的Python3.5和[m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc)来构建。[m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc)在这种情况也许是最稳定的64位C编译器。其他的C编译器或者Python环境可能在编译时失败,原因不明。对于那些操作系统语言不是`en_US`,请在构建前先设置成`en_US`。否则你会遇到这个[已知问题](https://github.com/Nuitka/Nuitka/issues/193)。
+Nuitka的构建有点麻烦。以下是我尝试成功的两种环境。
+
+1. [Nuitka readme](https://github.com/Nuitka/Nuitka#id6)推荐的Anacondare环境。
+ - Python 3.5版本
+ - mingw-w64的包[m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc) (只要你是用Anaconda命令行启动的,就不需要单独设置环境变量)
+2. 设置环境变量`CC`的值为相应C编译器可执行文件的目录(包括其名称)来使用其他C的编译器,而不是[m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc)。。譬如,你想让Nuitka使用你存储上安装的[MingW-W64-builds](http://mingw-w64.org/doku.php/download/mingw-builds)。在这种情况下,依然推荐使用Python 3.5。
+
+其他的C编译器或者Python环境可能在编译时失败,原因不明。对于那些操作系统语言不是`en_US`,请在构建前先设置成`en_US`。否则你会遇到这个[已知问题](https://github.com/Nuitka/Nuitka/issues/193)。
Pyinstaller的构建就比较稳定。只要配置文件写好了就没遇到问题。
-[create_release.py](../scripts/create_release.py)是用来创建两个发布包的。如果你想创建一个“完全”独立运行的发布包像我制作的那样,你需要创建一个`binaries`文件夹,里面包含ffmpeg和ffmpeg-normalize的可执行文件。我使用的`ffmpeg.exe`和`ffprobe.exe`都来自[Zeranoe的ffmpeg windows构建](https://ffmpeg.zeranoe.com/builds/)。它的文件目录应该如下。
+[create_release.py](../scripts/create_release.py)是用来创建两个发布包的。如果你想创建一个“完全”独立运行的发布包像我制作的那样,你需要创建一个`binaries`文件夹,里面包含ffmpeg和ffmpeg-normalize的可执行文件。我使用的`ffmpeg.exe`和`ffprobe.exe`都来自[Zeranoe的ffmpeg windows构建](https://ffmpeg.zeranoe.com/builds/)。`ffmpeg-normalize.exe` 使用[如上](#在Windows上安装)所说的相同的方式进行构建。
+
+它的文件目录应该如下。
```
binaries\ffmpeg.exe
From f48974fbf8c6dc6218f1575b76bbc19920dbf25e Mon Sep 17 00:00:00 2001
From: BingLingGroup <42505588+BingLingGroup@users.noreply.github.com>
Date: Thu, 7 Nov 2019 16:27:34 +0800
Subject: [PATCH 3/8] Docs fix readme typo
---
docs/README.zh-Hans.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/README.zh-Hans.md b/docs/README.zh-Hans.md
index 4212d0bc..fcdf2092 100644
--- a/docs/README.zh-Hans.md
+++ b/docs/README.zh-Hans.md
@@ -648,10 +648,10 @@ for /f "delims=^" %%i in ('dir /b %in_format%') do (
Nuitka的构建有点麻烦。以下是我尝试成功的两种环境。
-1. [Nuitka readme](https://github.com/Nuitka/Nuitka#id6)推荐的Anacondare环境。
+1. [Nuitka readme](https://github.com/Nuitka/Nuitka#id6)推荐的Anaconda环境。
- Python 3.5版本
- mingw-w64的包[m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc) (只要你是用Anaconda命令行启动的,就不需要单独设置环境变量)
-2. 设置环境变量`CC`的值为相应C编译器可执行文件的目录(包括其名称)来使用其他C的编译器,而不是[m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc)。。譬如,你想让Nuitka使用你存储上安装的[MingW-W64-builds](http://mingw-w64.org/doku.php/download/mingw-builds)。在这种情况下,依然推荐使用Python 3.5。
+2. 设置环境变量`CC`的值为相应C编译器可执行文件的目录(包括其名称)来使用其他C的编译器,而不是[m2w64-gcc](https://anaconda.org/msys2/m2w64-gcc)。譬如,你想让Nuitka使用你存储上安装的[MingW-W64-builds](http://mingw-w64.org/doku.php/download/mingw-builds)。在这种情况下,依然推荐使用Python 3.5。
其他的C编译器或者Python环境可能在编译时失败,原因不明。对于那些操作系统语言不是`en_US`,请在构建前先设置成`en_US`。否则你会遇到这个[已知问题](https://github.com/Nuitka/Nuitka/issues/193)。
From 607479338f42bff35c1ea822d1725d81c9da1720 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AF=82=E5=90=AC?=
Date: Mon, 25 Nov 2019 19:10:56 +0000
Subject: [PATCH 4/8] Fix excessive transcoding time issue
add -vn to parameter in order to bypass video during transcoding to avoid excessive transcoding time
---
autosub/constants.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/autosub/constants.py b/autosub/constants.py
index 3a92d6d9..7f4583a1 100644
--- a/autosub/constants.py
+++ b/autosub/constants.py
@@ -84,7 +84,7 @@
"ffmpeg-normalize -v \"{in_}\" -ar 44100 -ofmt flac -c:a flac -pr -p -o \"{out_}\""
]
-DEFAULT_AUDIO_CVT = "ffmpeg -hide_banner -y -i \"{in_}\" -ac {channel} -ar {sample_rate} \"{out_}\""
+DEFAULT_AUDIO_CVT = "ffmpeg -hide_banner -y -i \"{in_}\" -vn -ac {channel} -ar {sample_rate} \"{out_}\""
DEFAULT_AUDIO_SPLT = \
"ffmpeg -ss {start} -t {dura} -y -i \"{in_}\" -c copy -loglevel error \"{out_}\""
From 35d4937a4f6081921e820f4351ed940e49e41f52 Mon Sep 17 00:00:00 2001
From: BingLingGroup <42505588+BingLingGroup@users.noreply.github.com>
Date: Tue, 26 Nov 2019 04:10:06 +0800
Subject: [PATCH 5/8] Fix constant.py line-too-long issue
---
autosub/constants.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/autosub/constants.py b/autosub/constants.py
index 7f4583a1..c330b8a2 100644
--- a/autosub/constants.py
+++ b/autosub/constants.py
@@ -84,7 +84,8 @@
"ffmpeg-normalize -v \"{in_}\" -ar 44100 -ofmt flac -c:a flac -pr -p -o \"{out_}\""
]
-DEFAULT_AUDIO_CVT = "ffmpeg -hide_banner -y -i \"{in_}\" -vn -ac {channel} -ar {sample_rate} \"{out_}\""
+DEFAULT_AUDIO_CVT = \
+ "ffmpeg -hide_banner -y -i \"{in_}\" -vn -ac {channel} -ar {sample_rate} \"{out_}\""
DEFAULT_AUDIO_SPLT = \
"ffmpeg -ss {start} -t {dura} -y -i \"{in_}\" -c copy -loglevel error \"{out_}\""
From bb935496b542af4b1d43526572cac2108fae4232 Mon Sep 17 00:00:00 2001
From: BingLingGroup <42505588+BingLingGroup@users.noreply.github.com>
Date: Sun, 22 Dec 2019 10:43:01 +0800
Subject: [PATCH 6/8] Fix #70 Auditok option issues
---
CHANGELOG.md | 9 +++++++++
autosub/cmdline_utils.py | 6 +++---
docs/CHANGELOG.zh-Hans.md | 7 +++++++
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7bdec99a..22b2134b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## TOC
+- [Unreleased](#unreleased)
+ - [Changed](#changedunreleased)
- [0.5.2-alpha - 2019-11-05](#052-alpha---2019-11-05)
- [Added](#added052-alpha)
- [Changed](#changed052-alpha)
@@ -26,6 +28,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Click up arrow to go back to TOC.
+### [Unreleased]
+
+### Changed(Unreleased)
+
+- Fix excessive transcoding time issue.
+- Fix Auditok option issues.
+
### [0.5.2-alpha] - 2019-11-05
### Added(0.5.2-alpha)
diff --git a/autosub/cmdline_utils.py b/autosub/cmdline_utils.py
index 59c917e6..2a9dd658 100644
--- a/autosub/cmdline_utils.py
+++ b/autosub/cmdline_utils.py
@@ -831,9 +831,9 @@ def audio_or_video_prcs( # pylint: disable=too-many-branches, too-many-statemen
regions = core.auditok_gen_speech_regions(
audio_wav=audio_wav,
energy_threshold=args.energy_threshold,
- min_region_size=constants.MIN_REGION_SIZE,
- max_region_size=constants.MAX_REGION_SIZE,
- max_continuous_silence=constants.DEFAULT_CONTINUOUS_SILENCE,
+ min_region_size=args.min_region_size,
+ max_region_size=args.max_region_size,
+ max_continuous_silence=args.max_continuous_silence,
mode=mode
)
os.remove(audio_wav)
diff --git a/docs/CHANGELOG.zh-Hans.md b/docs/CHANGELOG.zh-Hans.md
index 96bcceff..85222f13 100644
--- a/docs/CHANGELOG.zh-Hans.md
+++ b/docs/CHANGELOG.zh-Hans.md
@@ -25,6 +25,13 @@
点击上箭头以返回目录。
+### [未发布]
+
+### 改动(未发布)
+
+- 修复ffmpeg参数导致的过长转码时间问题。
+- 修复Auditok选项问题。
+
### [0.5.2-alpha] - 2019-11-05
### 添加(0.5.2-alpha)
From 3a940924356664919e0f2cdb6c24fed040cfc88c Mon Sep 17 00:00:00 2001
From: BingLingGroup <42505588+BingLingGroup@users.noreply.github.com>
Date: Mon, 30 Dec 2019 16:08:14 +0800
Subject: [PATCH 7/8] Fix #73 output option issue
---
CHANGELOG.md | 19 ++++++++++++-------
README.md | 2 +-
autosub/cmdline_utils.py | 5 +++--
docs/CHANGELOG.zh-Hans.md | 19 +++++++++++++------
docs/README.zh-Hans.md | 2 +-
5 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 22b2134b..c32de3eb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## TOC
- [Unreleased](#unreleased)
- - [Changed](#changedunreleased)
+- [0.5.3-alpha - 2019-12-30](#053-alpha---2019-12-30)
+ - [Changed](#changed053-alpha)
- [0.5.2-alpha - 2019-11-05](#052-alpha---2019-11-05)
- [Added](#added052-alpha)
- [Changed](#changed052-alpha)
@@ -30,18 +31,21 @@ Click up arrow to go back to TOC.
### [Unreleased]
-### Changed(Unreleased)
+### [0.5.3-alpha] - 2019-12-30
-- Fix excessive transcoding time issue.
-- Fix Auditok option issues.
+#### Changed(0.5.3-alpha)
+
+- Fix excessive transcoding time issue. [pull request #66](https://github.com/BingLingGroup/autosub/pull/66)
+- Fix Auditok option issues. [issue #70](https://github.com/BingLingGroup/autosub/issues/70)
+- Fix output option issue. [issue #73](https://github.com/BingLingGroup/autosub/issues/73)
### [0.5.2-alpha] - 2019-11-05
-### Added(0.5.2-alpha)
+#### Added(0.5.2-alpha)
- Add issue templates.
-### Changed(0.5.2-alpha)
+#### Changed(0.5.2-alpha)
- Fix last row of empty translation text missing issue. [issue #62](https://github.com/BingLingGroup/autosub/issues/62)
- Fix executable file detection problem in the current directory.
@@ -152,7 +156,8 @@ Click up arrow to go back to TOC.
↑
-[Unreleased]: https://github.com/BingLingGroup/autosub/compare/0.5.2-alpha...HEAD
+[Unreleased]: https://github.com/BingLingGroup/autosub/compare/0.5.3-alpha...HEAD
+[0.5.3-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.2-alpha...0.5.3-alpha
[0.5.2-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.1-alpha...0.5.2-alpha
[0.5.1-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.0-alpha...0.5.1-alpha
[0.5.0-alpha]: https://github.com/BingLingGroup/autosub/compare/0.4.1-alpha...0.5.0-alpha
diff --git a/README.md b/README.md
index 7084b8b7..9272e390 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Autosub
-
+
[简体中文](docs/README.zh-Hans.md)
diff --git a/autosub/cmdline_utils.py b/autosub/cmdline_utils.py
index 2a9dd658..28539f1a 100644
--- a/autosub/cmdline_utils.py
+++ b/autosub/cmdline_utils.py
@@ -203,11 +203,12 @@ def validate_io( # pylint: disable=too-many-branches, too-many-statements
# get format from default
args.format = constants.DEFAULT_SUBTITLES_FORMAT
else:
+ output_name = os.path.splitext(args.output)
if not args.format:
# get format from output
- args.format = input_ext.strip('.')
+ args.format = output_name[-1].strip('.')
# format = output name extension without dot
- args.output = input_path
+ args.output = output_name[0]
# output = output name without extension
if args.format not in constants.OUTPUT_FORMAT:
diff --git a/docs/CHANGELOG.zh-Hans.md b/docs/CHANGELOG.zh-Hans.md
index 85222f13..c4231d45 100644
--- a/docs/CHANGELOG.zh-Hans.md
+++ b/docs/CHANGELOG.zh-Hans.md
@@ -8,6 +8,9 @@
## 目录
+- [未发布](#未发布)
+- [0.5.3-alpha - 2019-12-30](#053-alpha---2019-12-30)
+ - [改动](#改动053-alpha)
- [0.5.2-alpha - 2019-11-05](#052-alpha---2019-11-05)
- [添加](#添加052-alpha)
- [改动](#改动052-alpha)
@@ -27,18 +30,21 @@
### [未发布]
-### 改动(未发布)
+### [0.5.3-alpha] - 2019-12-30
-- 修复ffmpeg参数导致的过长转码时间问题。
-- 修复Auditok选项问题。
+#### 改动(0.5.3-alpha)
+
+- 修复ffmpeg参数导致的过长转码时间问题。[pull request #66](https://github.com/BingLingGroup/autosub/pull/66)
+- 修复Auditok选项问题。[issue #70](https://github.com/BingLingGroup/autosub/issues/70)
+- 修复输出选项问题。[issue #73](https://github.com/BingLingGroup/autosub/issues/73)
### [0.5.2-alpha] - 2019-11-05
-### 添加(0.5.2-alpha)
+#### 添加(0.5.2-alpha)
- 添加问题模板。
-### 改动(0.5.2-alpha)
+#### 改动(0.5.2-alpha)
- 修复最后一排空翻译丢行问题。[issue #62](https://github.com/BingLingGroup/autosub/issues/62)
- 修复当前运行路径的可执行文件检测问题。
@@ -143,7 +149,8 @@
↑
-[未发布]: https://github.com/BingLingGroup/autosub/compare/0.5.2-alpha...HEAD
+[未发布]: https://github.com/BingLingGroup/autosub/compare/0.5.3-alpha...HEAD
+[0.5.3-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.2-alpha...0.5.3-alpha
[0.5.2-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.1-alpha...0.5.2-alpha
[0.5.1-alpha]: https://github.com/BingLingGroup/autosub/compare/0.5.0-alpha...0.5.1-alpha
[0.5.0-alpha]: https://github.com/BingLingGroup/autosub/compare/0.4.1-alpha...0.5.0-alpha
diff --git a/docs/README.zh-Hans.md b/docs/README.zh-Hans.md
index fcdf2092..720bc4a1 100644
--- a/docs/README.zh-Hans.md
+++ b/docs/README.zh-Hans.md
@@ -1,6 +1,6 @@
# Autosub
-
+
[English](../README.md)
From dd5b3d5aa9877a1f3f8b259fc788e4f15bad34eb Mon Sep 17 00:00:00 2001
From: BingLingGroup <42505588+BingLingGroup@users.noreply.github.com>
Date: Mon, 30 Dec 2019 16:58:12 +0800
Subject: [PATCH 8/8] Update translations
---
.../LC_MESSAGES/autosub.cmdline_utils.mo | Bin 8988 -> 8988 bytes
.../LC_MESSAGES/autosub.cmdline_utils.po | 98 +++++++++---------
autosub/metadata.py | 2 +-
3 files changed, 50 insertions(+), 50 deletions(-)
diff --git a/autosub/data/locale/zh_CN/LC_MESSAGES/autosub.cmdline_utils.mo b/autosub/data/locale/zh_CN/LC_MESSAGES/autosub.cmdline_utils.mo
index 355becdbaa589e60bf95bc774c4e1330cae2f78e..6b6b532b209f4ea13a47d9755b3f48d778e77901 100644
GIT binary patch
delta 24
fcmbQ^HpgwlQ(