Invidious is an alternative front-end to YouTube
Only replace "/watch" links in Reddit description
Omar Rothc42c0b65b0c9
diff --git a/src/helpers.cr b/src/helpers.crindex 44262479..9b79c27e 100644--- a/src/helpers.cr+++ b/src/helpers.cr@@ -132,17 +132,6 @@ def fetch_video(id, client)dislikes = dislikes ? dislikes.content.delete(",").to_i : 0description = html.xpath_node(%q(//p[@id="eow-description"]))- if description- description.xpath_nodes(%q(//a/@href)).each do |match|- uri = URI.parse(match.content)-- if uri.host =~ /(www\.)?youtube.com/- uri = uri.full_path- end-- match.content = uri.to_s- end- enddescription = description ? description.to_xml : ""wilson_score = ci_lower_bound(likes, likes + dislikes)@@ -303,7 +292,7 @@ def template_comments(root)body_html.xpath_nodes(%q(//a/@href)).each do |match|uri = URI.parse(match.content)- if uri.host =~ /(www\.)?youtube.com/+ if uri.host =~ /(www\.)?youtube.com/ && uri.path == "/watch"uri = uri.full_pathend