From e791fd003204891ae00d3a59abb9e7134963af99 Mon Sep 17 00:00:00 2001 From: ercan Date: Wed, 25 May 2022 22:07:20 +0300 Subject: [PATCH] Fixed a bug with subtitles where some lines can be empty after filtering Updated version to 1.3.1 --- README.txt | 7 +++++-- condenser.py | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.txt b/README.txt index cc8f6a8..6fe633e 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -Condenser v1.3.0 by Ercan Serteli +Condenser v1.3.1 by Ercan Serteli --------------------------------- @@ -11,7 +11,7 @@ How to use - Simple ------------------- * Unpack the archive to a folder and create a shortcut to condenser.exe if you want. * Drag and drop a video or a folder with videos to the executable (or its shortcut). -* If there is an ambiguity, a pop up may ask you to make a choice. Answer accordingly. +* If there is an ambiguity, a pop-up may ask you to make a choice. Answer accordingly. * When the processing is done, an audio file with the name "[video_name]_con.mp3" will be created next to the video. @@ -57,6 +57,9 @@ Condenser uses ffmpeg for manipulating video and audio files. Change log ---------- +v1.3.1 + * Fixed a bug with subtitles where some lines can be empty after filtering + v1.3.0 * Fixed a bug with external subtitles when condensing a folder * Added the ability to filter certain characters and lines enclosed by parentheses in subtitles, set by config diff --git a/condenser.py b/condenser.py index bf467dc..ab5ee89 100644 --- a/condenser.py +++ b/condenser.py @@ -54,6 +54,8 @@ def streams_to_options(streams): def filter_text(text): text = re.sub('<[^<]+?>', '', text) # strip xml tags + if len(text) == 0: + return "" if filter_parentheses and \ ((text[0] == "(" and text[-1] == ")") or \ (text[0] == "[" and text[-1] == "]") or \