From 60eaa8d0f81a081c7f250568a2a16a16c730205c Mon Sep 17 00:00:00 2001 From: Thomas Erlang Date: Fri, 17 Nov 2023 19:28:02 +0100 Subject: [PATCH] pts_time might not be there in keyframes --- seplis_play_server/scanners/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seplis_play_server/scanners/base.py b/seplis_play_server/scanners/base.py index eea0ae4..1005812 100644 --- a/seplis_play_server/scanners/base.py +++ b/seplis_play_server/scanners/base.py @@ -138,7 +138,7 @@ async def get_keyframes(self, path): if isinstance(data, bytes): data = data.decode('utf-8') data = utils.json_loads(data) - keyframes = [r['pts_time'] for r in data['packets'] if r['flags'].startswith('K')] + keyframes = [r['pts_time'] for r in data['packets'] if r['flags'].startswith('K') and r.get('pts_time')] return keyframes