From 87b0fc1556707f76cd30bee6207ef1187becf40e Mon Sep 17 00:00:00 2001 From: girst Date: Tue, 25 Apr 2023 16:08:34 +0000 Subject: [PATCH] improve shorts detection if only one of length>60 or aspect>1 is available we can rule out a shorts video. previously, we marked this state as undetermiable (NULL). --- app/common/common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/common/common.py b/app/common/common.py index 32b6b86..8f8ac42 100644 --- a/app/common/common.py +++ b/app/common/common.py @@ -346,9 +346,9 @@ def video_metadata(metadata): # shorts are <= 60 seconds and vertical or square. if we were unable to # determine it, we set it to None. is_short = ( - None if length is None or aspect_ratio is None else - True if length <= 60 and aspect_ratio <= 1 else - False + None if length is None and aspect_ratio is None else + True if ((length or 61) <= 60) and ((aspect_ratio or 2) <= 1) else + False # length > 60 or aspect_ratio > 1 ) # Note: 'premiere' videos have livestream=False and published= will be the -- 2.39.3