fix trending 0 views bug

This commit is contained in:
TheErrorExe 2025-08-29 21:00:46 +02:00 committed by GitHub
parent 2998f443df
commit 172c7e7c86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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