From 4c23dcbd48f197927e3d5076ffa7d7af4855add9 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 25 Dec 2024 21:24:51 +0100 Subject: [PATCH] Don't try to ffprobe for duration if file is not actually present. --- src/ytplom/misc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ytplom/misc.py b/src/ytplom/misc.py index a68edbe..12e7953 100644 --- a/src/ytplom/misc.py +++ b/src/ytplom/misc.py @@ -447,6 +447,8 @@ class VideoFile(DbData): @property def ffprobed_duration(self) -> str: """Return human-friendly formatting of file duration as per ffprobe.""" + if not self.full_path.is_file(): + return '?' json = ffprobe(self.full_path) duration_str = json['format']['duration'] m_seconds_str = duration_str.split('.')[1] -- 2.30.2