diff --git a/src/invidious.cr b/src/invidious.cr index ae7c9610..16349ee7 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -965,8 +965,8 @@ post "/login" do |env| end if cookie.extension - cookie.extension = cookie.extension.not_nil!.gsub(".youtube.com", host) - cookie.extension = cookie.extension.not_nil!.gsub("Secure; ", "") + cookie.extension = cookie.extension.not_nil!.gsub(".youtube.com", host) + cookie.extension = cookie.extension.not_nil!.gsub("Secure; ", "") end env.response.cookies << cookie end @@ -2569,8 +2569,8 @@ get "/api/v1/stats" do |env| next statistics.to_json end - statistics.to_json - end + statistics.to_json +end get "/api/v1/captions/:id" do |env| locale = LOCALES[env.get("preferences").as(Preferences).locale]? @@ -2613,8 +2613,8 @@ get "/api/v1/captions/:id" do |env| end end - next response - end + next response + end env.response.content_type = "text/vtt" @@ -2723,7 +2723,7 @@ get "/api/v1/comments/:id" do |env| reddit_thread = JSON.parse(reddit_thread.to_json).as_h reddit_thread["comments"] = JSON.parse(comments.to_json) - next reddit_thread.to_json + next reddit_thread.to_json else response = { "title" => reddit_thread.title, @@ -2731,10 +2731,10 @@ get "/api/v1/comments/:id" do |env| "contentHtml" => content_html, } - next response.to_json - end + next response.to_json end end +end get "/api/v1/insights/:id" do |env| locale = LOCALES[env.get("preferences").as(Preferences).locale]? @@ -2821,8 +2821,8 @@ get "/api/v1/insights/:id" do |env| "graphData" => graph_data, } - next response.to_json - end + next response.to_json +end get "/api/v1/videos/:id" do |env| locale = LOCALES[env.get("preferences").as(Preferences).locale]? @@ -3027,8 +3027,8 @@ get "/api/v1/videos/:id" do |env| end end - video_info - end + video_info +end get "/api/v1/trending" do |env| locale = LOCALES[env.get("preferences").as(Preferences).locale]? @@ -3075,8 +3075,8 @@ get "/api/v1/trending" do |env| end end - videos - end + videos +end get "/api/v1/popular" do |env| locale = LOCALES[env.get("preferences").as(Preferences).locale]? @@ -3105,8 +3105,8 @@ get "/api/v1/popular" do |env| end end - videos - end + videos +end get "/api/v1/top" do |env| locale = LOCALES[env.get("preferences").as(Preferences).locale]? @@ -3148,8 +3148,8 @@ get "/api/v1/top" do |env| end end - videos - end + videos +end get "/api/v1/channels/:ucid" do |env| locale = LOCALES[env.get("preferences").as(Preferences).locale]? @@ -3353,8 +3353,8 @@ get "/api/v1/channels/:ucid" do |env| end end - channel_info - end + channel_info +end ["/api/v1/channels/:ucid/videos", "/api/v1/channels/videos/:ucid"].each do |route| get route do |env| @@ -3421,9 +3421,9 @@ get "/api/v1/channels/:ucid" do |env| end end - result - end + result end +end ["/api/v1/channels/:ucid/latest", "/api/v1/channels/latest/:ucid"].each do |route| get route do |env| @@ -3470,9 +3470,9 @@ get "/api/v1/channels/:ucid" do |env| end end - response - end + response end +end ["/api/v1/channels/:ucid/playlists", "/api/v1/channels/playlists/:ucid"].each do |route| get route do |env| @@ -3536,9 +3536,9 @@ get "/api/v1/channels/:ucid" do |env| end end - response - end + response end +end get "/api/v1/channels/search/:ucid" do |env| locale = LOCALES[env.get("preferences").as(Preferences).locale]? @@ -3637,8 +3637,8 @@ get "/api/v1/channels/search/:ucid" do |env| end end - response - end + response +end get "/api/v1/search" do |env| locale = LOCALES[env.get("preferences").as(Preferences).locale]? @@ -3762,8 +3762,8 @@ get "/api/v1/search" do |env| end end - response - end + response +end get "/api/v1/playlists/:plid" do |env| locale = LOCALES[env.get("preferences").as(Preferences).locale]? @@ -3862,8 +3862,8 @@ get "/api/v1/playlists/:plid" do |env| }.to_json end - response - end + response +end get "/api/v1/mixes/:rdid" do |env| locale = LOCALES[env.get("preferences").as(Preferences).locale]? @@ -4444,7 +4444,7 @@ error 500 do |env| here - or send an email to + or send an email to omarroth@protonmail.com. END_HTML diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index 6707e1f1..275de470 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -308,13 +308,13 @@ def template_youtube_comments(comments, locale)

#{child["author"]} - +

#{child["contentHtml"]}

#{translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64), locale))} #{child["isEdited"] == true ? translate(locale, "(edited)") : ""} | [YT] - | - #{number_with_separator(child["likeCount"])} + | + #{number_with_separator(child["likeCount"])} END_HTML if child["creatorHeart"]? @@ -372,8 +372,8 @@ def template_reddit_comments(root, locale) content = <<-END_HTML

- [ - ] - #{author} + [ - ] + #{author} #{translate(locale, "`x` points", number_with_separator(score))} #{translate(locale, "`x` ago", recode_date(child.created_utc, locale))}

diff --git a/src/invidious/helpers/handlers.cr b/src/invidious/helpers/handlers.cr index 4a7b5650..22fb1b70 100644 --- a/src/invidious/helpers/handlers.cr +++ b/src/invidious/helpers/handlers.cr @@ -62,7 +62,7 @@ class FilteredCompressHandler < Kemal::Handler call_next env {% else %} request_headers = env.request.headers - + if request_headers.includes_word?("Accept-Encoding", "gzip") env.response.headers["Content-Encoding"] = "gzip" env.response.output = Gzip::Writer.new(env.response.output, sync_close: true) @@ -70,7 +70,7 @@ class FilteredCompressHandler < Kemal::Handler env.response.headers["Content-Encoding"] = "deflate" env.response.output = Flate::Writer.new(env.response.output, sync_close: true) end - + call_next env {% end %} end diff --git a/src/invidious/users.cr b/src/invidious/users.cr index 5d0c66b2..747b72d8 100644 --- a/src/invidious/users.cr +++ b/src/invidious/users.cr @@ -300,7 +300,7 @@ def generate_captcha(key, db) clock_svg = <<-END_SVG - + 1 2 3 diff --git a/src/invidious/views/channel.ecr b/src/invidious/views/channel.ecr index d40d8d9f..746ffcde 100644 --- a/src/invidious/views/channel.ecr +++ b/src/invidious/views/channel.ecr @@ -64,7 +64,7 @@ <%= rendered "components/item" %> <% end %> <% end %> - +
diff --git a/src/invidious/views/components/player.ecr b/src/invidious/views/components/player.ecr index 4e976991..f7848b4d 100644 --- a/src/invidious/views/components/player.ecr +++ b/src/invidious/views/components/player.ecr @@ -1,4 +1,4 @@ -
- +
@@ -35,7 +35,7 @@
- +
diff --git a/src/invidious/views/embed.ecr b/src/invidious/views/embed.ecr index f32a6685..5fab259c 100644 --- a/src/invidious/views/embed.ecr +++ b/src/invidious/views/embed.ecr @@ -10,13 +10,13 @@ <%= HTML.escape(video.title) %> - Invidious diff --git a/src/invidious/views/mix.ecr b/src/invidious/views/mix.ecr index c82270b9..0e88b263 100644 --- a/src/invidious/views/mix.ecr +++ b/src/invidious/views/mix.ecr @@ -19,4 +19,4 @@ <%= rendered "components/item" %> <% end %> <% end %> -
+ diff --git a/src/invidious/views/playlist.ecr b/src/invidious/views/playlist.ecr index cd767140..98da42dc 100644 --- a/src/invidious/views/playlist.ecr +++ b/src/invidious/views/playlist.ecr @@ -31,7 +31,7 @@ <%= rendered "components/item" %> <% end %> <% end %> - +
diff --git a/src/invidious/views/privacy.ecr b/src/invidious/views/privacy.ecr index 63f99ab6..79206c56 100644 --- a/src/invidious/views/privacy.ecr +++ b/src/invidious/views/privacy.ecr @@ -5,15 +5,15 @@
<%= Markdown.to_html(<<-END_PRIVACY_POLICY ## Privacy - + This document concerns what data you provide to this website, the purpose of the data, how the data is stored, and how the data can be removed. - + ### Data you directly provide - + Data that you provide to the website for the purpose of the site's operation (for example: an account name, account password, or channel subscription) will be stored in the website's database until the user decides to remove it. This data will not be intentionally shared with anyone or anything. - + Information stored about a registered user is limited to: - + - a list of session tokens for remaining logged in across devices - the last time an account was updated (to provide accurate notifications) - a list of video IDs identifying notifications from a user's subscriptions @@ -23,51 +23,51 @@ - a hashed password if applicable (not present on google accounts) - a randomly generated token for providing an RSS feed of a user's subscriptions - a list of video IDs identifying watched videos - + The above list reflects [this code](https://github.com/omarroth/invidious/blob/master/src/invidious/users.cr#L14-L51). - + Users can clear their watch history using the [clear watch history](/clear_watch_history) page. - + If a user is logged in with a Google account, no password will ever be stored. This website uses the session token provided by Google to identify a user, but does not store the information required to make requests on a user's behalf without their knowledge or consent. - + ### Data you passively provide - + When you request any resource from this website (for example: a page, a font, an image, or an API endpoint) information about the request may be logged. - + Information about a request is limited to: - + - the time the request was made - the status code of the response - the method of the request - the requested URL - how long it took to complete the request. - + No identifying information is logged, such as the visitor's cookie, user-agent, or IP address. Here are a couple lines to serve as an example: - + ``` 2019-01-19 16:37:47 +00:00 200 GET /api/v1/comments/xrlETJYzH-c?format=html&hl=en-US 1345.88ms 2019-01-19 16:37:53 +00:00 200 GET /vi/r5P-f5arPXE/maxres.jpg 1085.41ms 2019-01-19 16:37:54 +00:00 200 GET /watch 7.04ms ``` - + This website does not store the visitor's user-agent or IP address and does not use fingerprinting, advertisements, or tracking of any form. - + This website provides links to googlevideo.com to provide audio and video playback. googlevideo.com is owned by Google and is subject to their [privacy policy](https://policies.google.com/privacy). - + ### Data stored in your browser - + This website uses browser cookies to authenticate registered users. This data consists of: - + - An account token to keep you logged into the website between visits, which is sent when any page is loaded while you are logged in - + This website also provides an option to store site preferences, such as the theme or locale, without an account. Using this feature will store a cookie in the visitor's browser containing their preferences. This cookie is sent on every request and does not contain any identifying information. You can remove this data from your browser by logging out of this website, or by using your browser's cookie-related controls to delete the data. - + ### Removal of data - + To remove data stored in your browser, you can log out of the website, or you can use your browser's cookie-related controls to delete the data. - + To remove data that has been stored in the website's database, you can use the [delete my account](/delete_account) page. END_PRIVACY_POLICY ) diff --git a/src/invidious/views/search.ecr b/src/invidious/views/search.ecr index 2cfb5b6a..a0d3bb7b 100644 --- a/src/invidious/views/search.ecr +++ b/src/invidious/views/search.ecr @@ -8,7 +8,7 @@ <%= rendered "components/item" %> <% end %> <% end %> -
+
diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index 496719ce..35e52dcf 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -116,7 +116,7 @@
Liberapay - / + / Patreon
+
<%= translate(locale, "Current version: ") %> <%= CURRENT_VERSION %>-<%= CURRENT_COMMIT %> diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 3595a4f5..5173c9fb 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -18,7 +18,7 @@ - + @@ -33,7 +33,7 @@

- <%= HTML.escape(video.title) %> + <%= HTML.escape(video.title) %> <% if params[:listen] %> " href="/watch?<%= env.params.query %>&listen=0"> @@ -53,7 +53,7 @@

<%= translate(locale, "Watch video on Youtube") %>

- +
@@ -150,7 +150,7 @@ <% if params[:related_videos] %>
- + <% if !rvs.empty? %>
style="display:none"<% end %>>
@@ -187,7 +187,7 @@