mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Fix comment templating when JavaScript is disabled
This commit is contained in:
parent
4b76b93610
commit
df7480bcb6
1 changed files with 3 additions and 9 deletions
|
@ -282,9 +282,7 @@ get "/watch" do |env|
|
||||||
|
|
||||||
if source == "youtube"
|
if source == "youtube"
|
||||||
begin
|
begin
|
||||||
comments = fetch_youtube_comments(id, "", proxies, "html")
|
comment_html = JSON.parse(fetch_youtube_comments(id, "", proxies, "html"))["contentHtml"]
|
||||||
comments = JSON.parse(comments)
|
|
||||||
comment_html = template_youtube_comments(comments)
|
|
||||||
rescue ex
|
rescue ex
|
||||||
if preferences.comments[1] == "reddit"
|
if preferences.comments[1] == "reddit"
|
||||||
comments, reddit_thread = fetch_reddit_comments(id)
|
comments, reddit_thread = fetch_reddit_comments(id)
|
||||||
|
@ -303,16 +301,12 @@ get "/watch" do |env|
|
||||||
comment_html = replace_links(comment_html)
|
comment_html = replace_links(comment_html)
|
||||||
rescue ex
|
rescue ex
|
||||||
if preferences.comments[1] == "youtube"
|
if preferences.comments[1] == "youtube"
|
||||||
comments = fetch_youtube_comments(id, "", proxies, "html")
|
comment_html = JSON.parse(fetch_youtube_comments(id, "", proxies, "html"))["contentHtml"]
|
||||||
comments = JSON.parse(comments)
|
|
||||||
comment_html = template_youtube_comments(comments)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
comments = fetch_youtube_comments(id, "", proxies, "html")
|
comment_html = JSON.parse(fetch_youtube_comments(id, "", proxies, "html"))["contentHtml"]
|
||||||
comments = JSON.parse(comments)
|
|
||||||
comment_html = template_youtube_comments(comments)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
comment_html ||= ""
|
comment_html ||= ""
|
||||||
|
|
Loading…
Reference in a new issue