diff --git a/locales/ar.json b/locales/ar.json index 4f43675f..18078836 100644 --- a/locales/ar.json +++ b/locales/ar.json @@ -50,6 +50,7 @@ "Autoplay: ": "تشغيل تلقائى: ", "Autoplay next video: ": "شغل الفيديو التالى تلقائى: ", "Listen by default: ": "تشغيل النسخة السمعية تلقائى: ", + "Proxy videos? ": "", "Default speed: ": "السرعة الإفتراضية: ", "Preferred video quality: ": "الجودة المفضلة للفيديوهات: ", "Player volume: ": "صوت المشغل: ", @@ -102,6 +103,7 @@ "Released under the AGPLv3 by Omar Roth.": "تم الإنشاء تحت AGPLv3 بواسطة عمر روث.", "Source available here.": "الأكواد متوفرة هنا.", "View JavaScript license information.": "مشاهدة معلومات حول تراخيص الجافاسكريبت.", + "View privacy policy.": "", "Trending": "الشائع", "Watch video on Youtube": "مشاهدة الفيديو على اليوتيوب", "Genre: ": "النوع: ", diff --git a/locales/de.json b/locales/de.json index d66ebee3..89bc09ea 100644 --- a/locales/de.json +++ b/locales/de.json @@ -50,6 +50,7 @@ "Autoplay: ": "Automatisch abspielen: ", "Autoplay next video: ": "nächstes Video automatisch abspielen: ", "Listen by default: ": "Nur Ton als Standard: ", + "Proxy videos? ": "", "Default speed: ": "Standardgeschwindigkeit: ", "Preferred video quality: ": "Bevorzugte Videoqualität: ", "Player volume: ": "Playerlautstärke: ", @@ -102,6 +103,7 @@ "Released under the AGPLv3 by Omar Roth.": "Veröffentlicht unter AGPLv3 von Omar Roth.", "Source available here.": "Quellcode verfügbar hier.", "View JavaScript license information.": "Javascript Lizenzinformationen anzeigen.", + "View privacy policy.": "", "Trending": "Trending", "Watch video on Youtube": "Video auf YouTube ansehen", "Genre: ": "Genre: ", diff --git a/locales/en-US.json b/locales/en-US.json index 6a05d1bb..68204a04 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -50,6 +50,7 @@ "Autoplay: ": "Autoplay: ", "Autoplay next video: ": "Autoplay next video: ", "Listen by default: ": "Listen by default: ", + "Proxy videos? ": "Proxy videos? ", "Default speed: ": "Default speed: ", "Preferred video quality: ": "Preferred video quality: ", "Player volume: ": "Player volume: ", @@ -100,6 +101,7 @@ "Released under the AGPLv3 by Omar Roth.": "Released under the AGPLv3 by Omar Roth.", "Source available here.": "Source available here.", "View JavaScript license information.": "View JavaScript license information.", + "View privacy policy.": "View privacy policy.", "Trending": "Trending", "Watch video on Youtube": "Watch video on Youtube", "Genre: ": "Genre: ", diff --git a/locales/eu.json b/locales/eu.json index 1e4ad1d4..b71a163e 100644 --- a/locales/eu.json +++ b/locales/eu.json @@ -50,6 +50,7 @@ "Autoplay: ": "", "Autoplay next video: ": "", "Listen by default: ": "", + "Proxy videos? ": "", "Default speed: ": "", "Preferred video quality: ": "", "Player volume: ": "", @@ -100,6 +101,7 @@ "Released under the AGPLv3 by Omar Roth.": "", "Source available here.": "", "View JavaScript license information.": "", + "View privacy policy.": "", "Trending": "", "Watch video on Youtube": "", "Genre: ": "", diff --git a/locales/fr.json b/locales/fr.json index 28f0b579..7647be53 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -50,6 +50,7 @@ "Autoplay: ": "Lire Automatiquement : ", "Autoplay next video: ": "Lire automatiquement la vidéo suivante : ", "Listen by default: ": "Audio Uniquement par défaut : ", + "Proxy videos? ": "", "Default speed: ": "Vitesse par défaut : ", "Preferred video quality: ": "Qualité vidéo souhaitée : ", "Player volume: ": "Volume du lecteur : ", @@ -100,6 +101,7 @@ "Released under the AGPLv3 by Omar Roth.": "Publié sous licence AGPLv3 par Omar Roth.", "Source available here.": "Code Source.", "View JavaScript license information.": "Voir les informations des licences JavaScript.", + "View privacy policy.": "", "Trending": "Tendances", "Watch video on Youtube": "Voir la vidéo sur Youtube", "Genre: ": "Genre : ", diff --git a/locales/it.json b/locales/it.json index 42dabf6d..6fae1259 100644 --- a/locales/it.json +++ b/locales/it.json @@ -50,6 +50,7 @@ "Autoplay: ": "Riproduzione automatica: ", "Autoplay next video: ": "Riproduci automaticamente il prossimo video: ", "Listen by default: ": "Modalità solo audio come predefinita: ", + "Proxy videos? ": "", "Default speed: ": "Velocità di riproduzione predefinita: ", "Preferred video quality: ": "Preferenza sulla qualità video: ", "Player volume: ": "Volume di riproduzione: ", @@ -100,6 +101,7 @@ "Released under the AGPLv3 by Omar Roth.": "Pubblicato con licenza AGPLv3 da Omar Roth.", "Source available here.": "Codice sorgente.", "View JavaScript license information.": "Guarda le informazioni di licenza del codice JavaScript.", + "View privacy policy.": "", "Trending": "Tendenze", "Watch video on Youtube": "Guarda il video su YouTube", "Genre: ": "Genere: ", diff --git a/locales/nb_NO.json b/locales/nb_NO.json index f0f544b5..92d43ca0 100644 --- a/locales/nb_NO.json +++ b/locales/nb_NO.json @@ -10,7 +10,7 @@ "newest": "nyeste", "oldest": "eldste", "popular": "populært", - "last": "", + "last": "siste", "Next page": "Neste side", "Previous page": "Forrige side", "Clear watch history?": "Tøm visningshistorikk?", @@ -50,6 +50,7 @@ "Autoplay: ": "Autoavspilling: ", "Autoplay next video: ": "Autospill neste video: ", "Listen by default: ": "Lytt som forvalg: ", + "Proxy videos? ": "", "Default speed: ": "Forvalgt hastighet: ", "Preferred video quality: ": "Foretrukket videokvalitet: ", "Player volume: ": "Avspillerlydstyrke: ", @@ -83,7 +84,7 @@ "Administrator preferences": "Administratorinnstillinger", "Default homepage: ": "Forvalgt hjemmeside: ", "Feed menu: ": "Flyt-meny: ", - "Top enabled? ": "", + "Top enabled? ": "Topp påskrudd? ", "CAPTCHA enabled? ": "CAPTCHA påskrudd? ", "Login enabled? ": "Innlogging påskrudd? ", "Registration enabled? ": "Registrering påskrudd? ", @@ -100,6 +101,7 @@ "Released under the AGPLv3 by Omar Roth.": "Utgitt med AGPLv3+lisens av Omar Roth.", "Source available here.": "Kildekode tilgjengelig her.", "View JavaScript license information.": "Vis JavaScript-lisensinfo.", + "View privacy policy.": "", "Trending": "Trendsettende", "Watch video on Youtube": "Vis video på YouTube", "Genre: ": "Sjanger: ", @@ -285,7 +287,7 @@ "`x` marked it with a ❤": "`x` levnet et ❤", "Audio mode": "Lydmodus", "Video mode": "Video-modus", - "Videos": "", - "Playlists": "", - "Current version: ": "" + "Videos": "Videoer", + "Playlists": "Spillelister", + "Current version: ": "Nåværende versjon: " } diff --git a/locales/nl.json b/locales/nl.json index b4ea3862..3bfe0ac4 100644 --- a/locales/nl.json +++ b/locales/nl.json @@ -50,6 +50,7 @@ "Autoplay: ": "Automatisch afspelen: ", "Autoplay next video: ": "Automatisch volgende video afspelen: ", "Listen by default: ": "Standaard luisteren: ", + "Proxy videos? ": "", "Default speed: ": "Standaard snelheid: ", "Preferred video quality: ": "Video kwaliteit voorkeur: ", "Player volume: ": "Afspeler volume: ", @@ -100,6 +101,7 @@ "Released under the AGPLv3 by Omar Roth.": "Uitgegeven onder AGPLv3 door Omar Roth.", "Source available here.": "Bron beschikbaar hier.", "View JavaScript license information.": "Bekijk JavaScript licentie informatie.", + "View privacy policy.": "", "Trending": "Trending", "Watch video on Youtube": "Bekijk video op Youtube", "Genre: ": "Genre: ", diff --git a/locales/pl.json b/locales/pl.json index 0db43c51..44db3d65 100644 --- a/locales/pl.json +++ b/locales/pl.json @@ -50,12 +50,13 @@ "Autoplay: ": "Autoodtwarzanie: ", "Autoplay next video: ": "Odtwórz następny film: ", "Listen by default: ": "Tryb dźwiękowy: ", + "Proxy videos? ": "", "Default speed: ": "Domyślna prędkość: ", "Preferred video quality: ": "Preferowana jakość filmów: ", "Player volume: ": "Głośność odtwarzacza: ", "Default comments: ": "Domyślne komentarze: ", "Default captions: ": "Domyślne napisy: ", - "Fallback captions: ": "Rezerwowe napisy: ", + "Fallback captions: ": "Zastępcze napisy: ", "Show related videos? ": "Pokaż powiązane filmy? ", "Visual preferences": "Preferencje Wizualne", "Dark mode: ": "Ciemny motyw: ", @@ -63,13 +64,13 @@ "Subscription preferences": "Preferencje subskrybcji", "Redirect homepage to feed: ": "Przekieruj stronę główną do subskrybcji: ", "Number of videos shown in feed: ": "Liczba filmów widoczna na stronie subskrybcji: ", - "Sort videos by: ": "Sortuj filmy po: ", - "published": "czasie publikacji", - "published - reverse": "czasie publikacji od najstarszych", + "Sort videos by: ": "Sortuj filmy: ", + "published": "po czasie publikacji", + "published - reverse": "po czasie publikacji od najstarszych", "alphabetically": "alfabetycznie", "alphabetically - reverse": "alfabetycznie od tyłu", - "channel name": "nazwie kanału", - "channel name - reverse": "nazwie kanału od tyłu", + "channel name": "po nazwie kanału", + "channel name - reverse": "po nazwie kanału od tyłu", "Only show latest video from channel: ": "Pokazuj tylko najnowszy film z kanału: ", "Only show latest unwatched video from channel: ": "Pokazuj tylko najnowszy nie obejrzany film z kanału: ", "Only show unwatched: ": "Pokazuj tylko nie obejrzane: ", @@ -80,14 +81,14 @@ "Manage subscriptions": "Organizuj subskrybcje", "Watch history": "Historia", "Delete account": "Usuń konto", - "Administrator preferences": "", - "Default homepage: ": "", + "Administrator preferences": "Preferencje administratora", + "Default homepage: ": "Domyślna strona główna: ", "Feed menu: ": "", "Top enabled? ": "", - "CAPTCHA enabled? ": "", - "Login enabled? ": "", - "Registration enabled? ": "", - "Report statistics? ": "", + "CAPTCHA enabled? ": "CAPTCHA aktywna? ", + "Login enabled? ": "Logowanie włączone? ", + "Registration enabled? ": "Rejestracja włączona? ", + "Report statistics? ": "Raportować statystyki? ", "Save preferences": "Zapisz preferencje", "Subscription manager": "Manager subskrybcji", "`x` subscriptions": "`x` subskrybcji", @@ -100,6 +101,7 @@ "Released under the AGPLv3 by Omar Roth.": "Wydano na licencji AGPLv3 przez Omar Roth.", "Source available here.": "Kod źródłowy dostępny tutaj.", "View JavaScript license information.": "Wyświetl informację o licencji JavaScript.", + "View privacy policy.": "", "Trending": "Na czasie", "Watch video on Youtube": "Zobacz film na YouTube", "Genre: ": "Gatunek: ", @@ -155,20 +157,20 @@ "Token is expired, please try again": "Token wygasł, spróbuj ponownie", "English": "angielski", "English (auto-generated)": "angielski (automatycznie generowane)", - "Afrikaans": "", + "Afrikaans": "afrykanerski", "Albanian": "albański", - "Amharic": "", + "Amharic": "amharski", "Arabic": "arabski", - "Armenian": "", - "Azerbaijani": "", - "Bangla": "", - "Basque": "", + "Armenian": "armeński", + "Azerbaijani": "azerski", + "Bangla": "bengalski", + "Basque": "baskijski", "Belarusian": "białoruski", "Bosnian": "bośniacki", "Bulgarian": "bułgarski", "Burmese": "birmański", "Catalan": "kataloński", - "Cebuano": "", + "Cebuano": "cebuański", "Chinese (Simplified)": "chiński (uproszczony)", "Chinese (Traditional)": "chiński (tradycyjny)", "Corsican": "korsykański", @@ -185,28 +187,28 @@ "Georgian": "gruziński", "German": "niemiecki", "Greek": "grecki", - "Gujarati": "", - "Haitian Creole": "", - "Hausa": "", + "Gujarati": "gudźarati", + "Haitian Creole": "kreolski haitański", + "Hausa": "hausa", "Hawaiian": "hawajski", "Hebrew": "hebrajski", "Hindi": "hindi", - "Hmong": "", + "Hmong": "hmong", "Hungarian": "węgierski", "Icelandic": "islandzki", - "Igbo": "", + "Igbo": "ibo", "Indonesian": "indonezyjski", "Irish": "irlandzki", "Italian": "włoski", "Japanese": "japoński", "Javanese": "jawajski", - "Kannada": "", + "Kannada": "kannada", "Kazakh": "kazachski", - "Khmer": "", + "Khmer": "khmerski", "Korean": "koreański", "Kurdish": "kurdyjski", "Kyrgyz": "kirgiski", - "Lao": "", + "Lao": "laotański", "Latin": "łaciński", "Latvian": "łotewski", "Lithuanian": "litewski", @@ -214,51 +216,51 @@ "Macedonian": "macedoński", "Malagasy": "malgaski", "Malay": "malajski", - "Malayalam": "", + "Malayalam": "malajalam", "Maltese": "maltański", - "Maori": "", - "Marathi": "", + "Maori": "maoryski", + "Marathi": "marathi", "Mongolian": "mongolski", "Nepali": "nepalski", "Norwegian": "norweski", - "Nyanja": "", - "Pashto": "", + "Nyanja": "njandża", + "Pashto": "paszto", "Persian": "perski", "Polish": "polski", "Portuguese": "portugalski", - "Punjabi": "", + "Punjabi": "pendżabski", "Romanian": "rumuński", "Russian": "rosyjski", - "Samoan": "", - "Scottish Gaelic": "", + "Samoan": "samoański", + "Scottish Gaelic": "gaelicki szkocki", "Serbian": "serbski", - "Shona": "", - "Sindhi": "", - "Sinhala": "", + "Shona": "shona", + "Sindhi": "sindhi", + "Sinhala": "syngaleski", "Slovak": "słowacki", "Slovenian": "słoweński", "Somali": "somalijski", - "Southern Sotho": "", + "Southern Sotho": "sotho południowy", "Spanish": "hiszpański", "Spanish (Latin America)": "hiszpański (ameryka łacińska)", - "Sundanese": "", - "Swahili": "", + "Sundanese": "sundajski", + "Swahili": "suahili", "Swedish": "szwedzki", - "Tajik": "", - "Tamil": "", - "Telugu": "", + "Tajik": "tadżycki", + "Tamil": "tamilski", + "Telugu": "telugu", "Thai": "tajski", "Turkish": "turecki", "Ukrainian": "ukraiński", - "Urdu": "", + "Urdu": "urdu", "Uzbek": "uzbecki", "Vietnamese": "wietnamski", "Welsh": "walijski", - "Western Frisian": "", - "Xhosa": "", - "Yiddish": "", - "Yoruba": "", - "Zulu": "", + "Western Frisian": "zachodniofryzyjski", + "Xhosa": "xhosa", + "Yiddish": "jidysz", + "Yoruba": "joruba", + "Zulu": "zuluski", "`x` years": "`x` lat", "`x` months": "`x` miesięcy", "`x` weeks": "`x` tygodni", @@ -272,7 +274,7 @@ "About": "Informacje", "Rating: ": "Ocena: ", "Language: ": "Język: ", - "Default": "", + "Default": "Domyślnie", "Music": "Muzyka", "Gaming": "Gry", "News": "Wiadomości", @@ -282,10 +284,10 @@ "%A %B %-d, %Y": "", "(edited)": "(edytowany)", "Youtube permalink of the comment": "Odnośnik bezpośredni do komentarza na YouTube", - "`x` marked it with a ❤": "", + "`x` marked it with a ❤": "'x' oznaczonych ❤", "Audio mode": "Tryb audio", "Video mode": "Tryb wideo", - "Videos": "", - "Playlists": "", - "Current version: ": "" + "Videos": "Filmy", + "Playlists": "Playlisty", + "Current version: ": "Aktualna wersja: " } diff --git a/locales/ru.json b/locales/ru.json index 222b693f..bfcd449e 100644 --- a/locales/ru.json +++ b/locales/ru.json @@ -50,6 +50,7 @@ "Autoplay: ": "Автовоспроизведение: ", "Autoplay next video: ": "Автовоспроизведение следующего видео: ", "Listen by default: ": "Режим \"только аудио\" по-умолчанию: ", + "Proxy videos? ": "", "Default speed: ": "Скорость по-умолчанию: ", "Preferred video quality: ": "Предпочтительное качество видео: ", "Player volume: ": "Громкость воспроизведения: ", @@ -102,6 +103,7 @@ "Released under the AGPLv3 by Omar Roth.": "Распространяется Omar Roth по AGPLv3.", "Source available here.": "Исходный код доступен здесь.", "View JavaScript license information.": "Посмотреть лицензии JavaScript кода.", + "View privacy policy.": "", "Trending": "В тренде", "Watch video on Youtube": "Смотреть на YouTube", "Genre: ": "Жанр: ", diff --git a/src/invidious.cr b/src/invidious.cr index 4fe018f9..0e7a3ac1 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -17,6 +17,7 @@ require "digest/md5" require "file_utils" require "kemal" +require "markdown" require "openssl/hmac" require "option_parser" require "pg" @@ -291,6 +292,11 @@ get "/" do |env| end end +get "/privacy" do |env| + locale = LOCALES[env.get("preferences").as(Preferences).locale]? + templated "privacy" +end + get "/licenses" do |env| locale = LOCALES[env.get("preferences").as(Preferences).locale]? rendered "licenses" @@ -1225,6 +1231,10 @@ post "/preferences" do |env| listen ||= "off" listen = listen == "on" + local = env.params.body["local"]?.try &.as(String) + local ||= "off" + local = local == "on" + speed = env.params.body["speed"]?.try &.as(String).to_f? speed ||= DEFAULT_USER_PREFERENCES.speed @@ -1286,6 +1296,7 @@ post "/preferences" do |env| "autoplay" => autoplay, "continue" => continue, "listen" => listen, + "local" => local, "speed" => speed, "quality" => quality, "volume" => volume, diff --git a/src/invidious/users.cr b/src/invidious/users.cr index 42468228..308786c2 100644 --- a/src/invidious/users.cr +++ b/src/invidious/users.cr @@ -31,6 +31,7 @@ DEFAULT_USER_PREFERENCES = Preferences.from_json({ "video_loop" => false, "autoplay" => false, "continue" => false, + "local" => false, "listen" => false, "speed" => 1.0, "quality" => "hd720", @@ -80,6 +81,10 @@ class Preferences type: Bool, default: DEFAULT_USER_PREFERENCES.continue, }, + local: { + type: Bool, + default: DEFAULT_USER_PREFERENCES.local, + }, listen: { type: Bool, default: DEFAULT_USER_PREFERENCES.listen, diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 17d17d93..78dd1e5a 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -747,10 +747,11 @@ def process_video_params(query, preferences) # region ||= preferences.region autoplay ||= preferences.autoplay.to_unsafe continue ||= preferences.continue.to_unsafe - related_videos ||= preferences.related_videos.to_unsafe listen ||= preferences.listen.to_unsafe + local ||= preferences.local.to_unsafe preferred_captions ||= preferences.captions quality ||= preferences.quality + related_videos ||= preferences.related_videos.to_unsafe speed ||= preferences.speed video_loop ||= preferences.video_loop.to_unsafe volume ||= preferences.volume @@ -758,10 +759,11 @@ def process_video_params(query, preferences) autoplay ||= DEFAULT_USER_PREFERENCES.autoplay.to_unsafe continue ||= DEFAULT_USER_PREFERENCES.continue.to_unsafe - related_videos ||= DEFAULT_USER_PREFERENCES.related_videos.to_unsafe listen ||= DEFAULT_USER_PREFERENCES.listen.to_unsafe + local ||= DEFAULT_USER_PREFERENCES.local.to_unsafe preferred_captions ||= DEFAULT_USER_PREFERENCES.captions quality ||= DEFAULT_USER_PREFERENCES.quality + related_videos ||= DEFAULT_USER_PREFERENCES.related_videos.to_unsafe speed ||= DEFAULT_USER_PREFERENCES.speed video_loop ||= DEFAULT_USER_PREFERENCES.video_loop.to_unsafe volume ||= DEFAULT_USER_PREFERENCES.volume diff --git a/src/invidious/views/preferences.ecr b/src/invidious/views/preferences.ecr index 20762bc5..d26b2179 100644 --- a/src/invidious/views/preferences.ecr +++ b/src/invidious/views/preferences.ecr @@ -28,6 +28,11 @@ function update_value(element) { checked<% end %>> +