diff --git a/locales/en-US.json b/locales/en-US.json index 1087bfcf..5893f420 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -489,6 +489,7 @@ "none": "none", "videoinfo_started_streaming_x_ago": "Started streaming `x` ago", "videoinfo_watch_on_youTube": "Watch on YouTube", + "videoinfo_watch_on_materialious": "Watch on Materialious", "videoinfo_youTube_embed_link": "Embed", "videoinfo_invidious_embed_link": "Embed Link", "download_subtitles": "Subtitles - `x` (.vtt)", diff --git a/locales/es.json b/locales/es.json index 9b03b1d0..0e674c05 100644 --- a/locales/es.json +++ b/locales/es.json @@ -390,6 +390,7 @@ "search_filters_features_option_purchased": "Comprado", "search_filters_features_option_three_sixty": "360°", "videoinfo_watch_on_youTube": "Ver en YouTube", + "videoinfo_watch_on_materialious": "Ver en Materialious", "preferences_save_player_pos_label": "Guardar posición de reproducción: ", "generic_views_count_0": "{{count}} visualización", "generic_views_count_1": "{{count}} visualizaciones", diff --git a/src/invidious/config.cr b/src/invidious/config.cr index 9cd38420..87b0f9bd 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -153,6 +153,9 @@ class Config # Playlist length limit property playlist_length_limit : Int32 = 500 + # Materialious redirects + property materialious_domain : String? + def disabled?(option) case disabled = CONFIG.disable_proxy when Bool diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 9e7467dd..1b552672 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -127,6 +127,20 @@ we're going to need to do it here in order to allow for translations. (<%= translate(locale, "videoinfo_youTube_embed_link") %>) + <% if CONFIG.materialious_domain %> +
+ <%- + link_materialious_watch = URI.new(scheme: "https", host: "#{CONFIG.materialious_domain}", path: "/watch", query: "v=#{video.id}") + + if !plid.nil? && !continuation.nil? + link_materialious_param = URI::Params{"list" => [plid], "index" => [continuation.to_s]} + link_materialious_watch = IV::HttpServer::Utils.add_params_to_url(link_materialious_watch, link_materialious_param) + end + -%> + <%= translate(locale, "videoinfo_watch_on_materialious") %> +
+ <% end %> +<%- link_iv_other = IV::Frontend::Misc.redirect_url(env) -%> <%= translate(locale, "Switch Invidious Instance") %>