diff --git a/yt_dlp/extractor/tiktok.py b/yt_dlp/extractor/tiktok.py index 9d823a31544f..83d6ff002a9b 100644 --- a/yt_dlp/extractor/tiktok.py +++ b/yt_dlp/extractor/tiktok.py @@ -505,13 +505,13 @@ def _extract_web_formats(self, aweme_detail): if dimension == 540: # '540p' is actually 576p dimension = 576 if ratio < 1: # portrait: res/dimension is width - y = int(dimension / ratio) + y = round(dimension / ratio) format_info.update({ 'width': dimension, 'height': y - (y % 2), }) else: # landscape: res/dimension is height - x = int(dimension * ratio) + x = round(dimension * ratio) format_info.update({ 'width': x + (x % 2), 'height': dimension,