Add local alternatives for video links

This commit is contained in:
Omar Roth 2018-03-06 22:00:35 -06:00
parent e9f214cdc0
commit ebe51c91d7
3 changed files with 57 additions and 3 deletions

View file

@ -218,11 +218,17 @@ get "/watch" do |env|
headers = HTTP::Headers{"User-Agent" => "web:invidio.us:v0.1.0 (by /u/omarroth)"}
begin
reddit_comments, reddit_thread = get_reddit_comments(id, reddit_client, headers)
reddit_html = template_comments(reddit_comments)
reddit_html = add_alt_links(reddit_html)
rescue ex
reddit_comments = JSON.parse("[]")
reddit_thread = nil
reddit_html = ""
end
video.description = fill_links(video.description, "https", "www.youtube.com")
video.description = add_alt_links(video.description)
templated "watch"
end