summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/invidious/comments.cr15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr
index e6d74d1d..0bad5b2e 100644
--- a/src/invidious/comments.cr
+++ b/src/invidious/comments.cr
@@ -158,7 +158,7 @@ def fetch_youtube_comments(id, continuation, proxies, format, locale)
comment_count = body["header"]["commentsHeaderRenderer"]["countText"]["simpleText"].as_s.delete("Comments,").to_i
json.field "commentCount", comment_count
end
-
+
json.field "videoId", id
json.field "comments" do
@@ -213,7 +213,7 @@ def fetch_youtube_comments(id, continuation, proxies, format, locale)
published_text = node_comment["publishedTimeText"]["runs"][0]["text"].as_s
published = decode_date(published_text.rchop(" (edited)"))
-
+
if published_text.includes?(" (edited)")
json.field "isEdited", true
else
@@ -227,7 +227,7 @@ def fetch_youtube_comments(id, continuation, proxies, format, locale)
json.field "likeCount", node_comment["likeCount"]
json.field "commentId", node_comment["commentId"]
json.field "authorIsChannelOwner", node_comment["authorIsChannelOwner"]
-
+
if node_comment["actionButtons"]["commentActionButtonsRenderer"]["creatorHeart"]?
hearth_data = node_comment["actionButtons"]["commentActionButtonsRenderer"]["creatorHeart"]["creatorHeartRenderer"]["creatorThumbnail"]
json.field "creatorHeart" do
@@ -349,18 +349,19 @@ def template_youtube_comments(comments, locale)
<a class="#{child["authorIsChannelOwner"] == true ? "channel-owner" : ""}" href="#{child["authorUrl"]}">#{child["author"]}</a>
</b>
<p style="white-space:pre-wrap">#{child["contentHtml"]}</p>
- <span title="#{Time.unix(child["published"].as_i64).to_s(translate(locale,"%A %B %-d, %Y"))}">#{translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64)))} #{child["isEdited"] == true ? translate(locale, "(edited)") : ""}</span>
+ <span title="#{Time.unix(child["published"].as_i64).to_s(translate(locale, "%A %B %-d, %Y"))}">#{translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64)))} #{child["isEdited"] == true ? translate(locale, "(edited)") : ""}</span>
|
<a href="https://www.youtube.com/watch?v=#{comments["videoId"]}&lc=#{child["commentId"]}" title="#{translate(locale, "Youtube permalink of the comment")}">[YT]</a>
|
<i class="icon ion-ios-thumbs-up"></i> #{number_with_separator(child["likeCount"])}
END_HTML
-
+
if child["creatorHeart"]?
+ creator_thumbnail = "/ggpht#{URI.parse(child["creatorHeart"]["creatorThumbnail"].as_s).full_path}"
html += <<-END_HTML
<span class="creator-heart-container" title="#{translate(locale, "`x` marked it with a ❤", child["creatorHeart"]["creatorName"].as_s)}">
<div class="creator-heart">
- <img class="creator-heart-background-hearted" src="#{child["creatorHeart"]["creatorThumbnail"]}"></img>
+ <img class="creator-heart-background-hearted" src="#{creator_thumbnail}"></img>
<div class="creator-heart-small-hearted">
<div class="creator-heart-small-container">🖤</div>
</div>
@@ -368,7 +369,7 @@ def template_youtube_comments(comments, locale)
</span>
END_HTML
end
-
+
html += <<-END_HTML
</p>
#{replies_html}
2023-08-10Update Slovak translationAti 2023-08-10Update Slovak translationMilan Šalka 2023-08-10Update errors.crsyeopite 2023-08-08Regression from #4037 | Fix storyboardssyeopite PR #4037 introduced a workaround around YouTube's new integrity checks on streaming URLs. However, the usage of this workaround prevents storyboard data from being returned by InnerTube. This commit fixes that by only using the workaround when calling try_fetch_streaming_data 2023-08-08Add workaround for storyboards on priv. instancessyeopite An upstream problem with videojs-vtt-thumbnails means that URLs gets joined incorrectly on any instance where `domain`, `external_port` and `https_only` aren't set. This commit adds some logic with the 404 handler to mitigate this problem. This is however only a workaround. See: https://github.com/iv-org/invidious/issues/3117 https://github.com/chrisboustead/videojs-vtt-thumbnails/issues/31 2023-08-07Update Slovenian translationDamjan Gerl 2023-08-07Update Portuguese translationLeonardo Colman 2023-08-07Update Vietnamese translationHoang Minh Pham 2023-08-07Update Portuguese (Brazil) translationLeonardo Colman 2023-08-07Update Chinese (Simplified) translationEric 2023-08-07Update Italian translationrandom r 2023-08-07Update Italian translationatilluF 2023-08-07Update French translationJohn Donne 2023-08-07Update Sinhala translationOverplant Poster 2023-08-07Update Odia translationSubham Jena 2023-08-07Update Czech translationFjuro 2023-08-07Update Croatian translationMilo Ivir 2023-08-07Update Portuguese (Brazil) translationjoaooliva 2023-08-07Update Japanese translationmaboroshin 2023-08-07Update Russian translationVoidWalker 2023-08-07Update Chinese (Traditional) translationJeff Huang