summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-11-11 23:31:27 -0600
committerOmar Roth <omarroth@hotmail.com>2018-11-11 23:31:27 -0600
commitdf7480bcb6d83590fb4ab93b50488b1b469bee51 (patch)
treed08d60ddd9363adeec343c8b4763e9bfe184e732 /src
parent4b76b93610e64a63d61d1369fdef9af119852aab (diff)
downloadinvidious-df7480bcb6d83590fb4ab93b50488b1b469bee51.tar.gz
invidious-df7480bcb6d83590fb4ab93b50488b1b469bee51.tar.bz2
invidious-df7480bcb6d83590fb4ab93b50488b1b469bee51.zip
Fix comment templating when JavaScript is disabled
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 82cf5f69..96af04fa 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -282,9 +282,7 @@ get "/watch" do |env|
if source == "youtube"
begin
- comments = fetch_youtube_comments(id, "", proxies, "html")
- comments = JSON.parse(comments)
- comment_html = template_youtube_comments(comments)
+ comment_html = JSON.parse(fetch_youtube_comments(id, "", proxies, "html"))["contentHtml"]
rescue ex
if preferences.comments[1] == "reddit"
comments, reddit_thread = fetch_reddit_comments(id)
@@ -303,16 +301,12 @@ get "/watch" do |env|
comment_html = replace_links(comment_html)
rescue ex
if preferences.comments[1] == "youtube"
- comments = fetch_youtube_comments(id, "", proxies, "html")
- comments = JSON.parse(comments)
- comment_html = template_youtube_comments(comments)
+ comment_html = JSON.parse(fetch_youtube_comments(id, "", proxies, "html"))["contentHtml"]
end
end
end
else
- comments = fetch_youtube_comments(id, "", proxies, "html")
- comments = JSON.parse(comments)
- comment_html = template_youtube_comments(comments)
+ comment_html = JSON.parse(fetch_youtube_comments(id, "", proxies, "html"))["contentHtml"]
end
comment_html ||= ""