From 2cbe261774680b1df836a0d8e63dd9b8efe9e81e Mon Sep 17 00:00:00 2001 From: Tatsuya Hiroishi Date: Thu, 22 Aug 2024 12:09:03 +0900 Subject: [PATCH] Fix slice_segments --- webvtt/segmenter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webvtt/segmenter.py b/webvtt/segmenter.py index a159fd8..8ddeb51 100644 --- a/webvtt/segmenter.py +++ b/webvtt/segmenter.py @@ -3,7 +3,7 @@ import typing import os import pathlib -from math import ceil, floor +from math import floor from .webvtt import WebVTT, Caption @@ -49,7 +49,7 @@ def slice_segments( total_segments = ( 0 if not captions else - int(ceil(captions[-1].end_in_seconds / seconds)) + floor(captions[-1].end_in_seconds / seconds) + 1 ) segments: typing.List[typing.List[Caption]] = [