From 486e2ba552fab17b6a6fc40de769e463b2d26950 Mon Sep 17 00:00:00 2001 From: acgnhik Date: Mon, 2 Jan 2023 12:09:40 +0800 Subject: [PATCH] refactor: avoid errors caused by invalid small FLV files --- src/blrec/postprocess/postprocessor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/blrec/postprocess/postprocessor.py b/src/blrec/postprocess/postprocessor.py index f7c84a4..c5240f2 100644 --- a/src/blrec/postprocess/postprocessor.py +++ b/src/blrec/postprocess/postprocessor.py @@ -148,6 +148,8 @@ class Postprocessor( if video_path.endswith('.flv'): if not await self._is_vaild_flv_file(video_path): logger.warning(f'The flv file may be invalid: {video_path}') + if os.path.getsize(video_path) < 1024**2: + continue if self.remux_to_mp4: self._status = PostprocessorStatus.REMUXING (