From 71a68d3947e1c1eb3c0aa8224d9ef5ae00302ac3 Mon Sep 17 00:00:00 2001 From: oop7 <110548351+oop7@users.noreply.github.com> Date: Fri, 10 Apr 2026 15:10:00 +0200 Subject: [PATCH] Use smaller dimension for resolution height Previously the code assumed the height was always the second value in the "WxH" resolution string. This change splits the resolution into parts, verifies there are two components, and uses the smaller dimension (min) as the height to correctly classify vertical videos. Also avoids potential index errors when the resolution string is malformed. --- ytsage/gui/ytsage_gui_format_table.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ytsage/gui/ytsage_gui_format_table.py b/ytsage/gui/ytsage_gui_format_table.py index 524a350..f0133ce 100644 --- a/ytsage/gui/ytsage_gui_format_table.py +++ b/ytsage/gui/ytsage_gui_format_table.py @@ -490,7 +490,10 @@ class FormatTableMixin: resolution = format_info.get("resolution", "") if resolution: try: - height = int(resolution.split("x")[1]) + parts = resolution.split("x") + if len(parts) == 2: + # Use the smaller dimension to correctly classify vertical videos + height = min(int(parts[0]), int(parts[1])) except: pass