From 172c7e7c86246f501b44054fe5055201bccfd047 Mon Sep 17 00:00:00 2001 From: TheErrorExe <161362055+TheErrorExe@users.noreply.github.com> Date: Fri, 29 Aug 2025 21:00:46 +0200 Subject: [PATCH] fix trending 0 views bug --- youtubei.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtubei.py b/youtubei.py index ef76482..baf9c9b 100644 --- a/youtubei.py +++ b/youtubei.py @@ -282,6 +282,7 @@ def innertube_trending(trending_type=None, region="US", max_results=50): author = vd.get("ownerText", {}).get("runs", [{}])[0].get("text", "") thumbnails = vd.get("thumbnail", {}).get("thumbnails", []) view_count_text = vd.get("viewCountText", {}).get("simpleText", "") + view_count = parse_view_count(view_count_text) published_text = vd.get("publishedTimeText", {}).get("simpleText", "") length_text_obj, length_seconds = extract_length_text_and_seconds(vd) return { @@ -289,7 +290,7 @@ def innertube_trending(trending_type=None, region="US", max_results=50): "videoId": vid, "author": author, "videoThumbnails": thumbnails, - "viewCountText": view_count_text, + "viewCount": view_count, "publishedText": published_text, "lengthText": length_text_obj, "lengthSeconds": length_seconds