From 757993064e935620db8ea1b4614c5eb0ace4fafa Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Fri, 3 May 2019 22:52:36 -0500 Subject: [PATCH] Fix view_count_text extractor for livestreams --- src/invidious/videos.cr | 2 +- src/invidious/views/watch.ecr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 9a199fad..b60fd4ed 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -929,7 +929,7 @@ def extract_polymer_config(body, html) recommended_video["author_thumbnail"] = compact_renderer["channelThumbnail"]["thumbnails"][0]["url"].as_s recommended_video["short_view_count_text"] = compact_renderer["shortViewCountText"]["simpleText"].as_s - recommended_video["view_count"] = compact_renderer["viewCountText"]?.try &.["simpleText"]?.try &.as_s.delete(", views").to_i64?.try &.to_s || "0" + recommended_video["view_count"] = compact_renderer["viewCountText"]?.try &.["simpleText"]?.try &.as_s.delete(", views watching").to_i64?.try &.to_s || "0" recommended_video["length_seconds"] = decode_length_seconds(compact_renderer["lengthText"]?.try &.["simpleText"]?.try &.as_s || "0:00").to_s rvs << recommended_video.to_s diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 856752ce..1f21f281 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -212,7 +212,7 @@
- <% if views = rv["short_view_count_text"]?.try &.delete(", views") %> + <% if views = rv["short_view_count_text"]?.try &.delete(", views watching") %> <%= translate(locale, "`x` views", views) %> <% end %>