diff options
27 files changed, 175 insertions, 107 deletions
diff --git a/assets/css/lighttheme.css b/assets/css/lighttheme.css index b28ef0ee..73706bb7 100644 --- a/assets/css/lighttheme.css +++ b/assets/css/lighttheme.css @@ -10,7 +10,7 @@ a { /* All links that do not fit with the default color goes here */ a:not([data-id]) > .icon, -.pure-u-md-1-5 > .h-box > a[href^="/watch?"], +.pure-u-lg-1-5 > .h-box > a[href^="/watch?"], .playlist-restricted > ol > li > a { color: #303030; } diff --git a/locales/ar.json b/locales/ar.json index f82683cf..15f582fb 100644 --- a/locales/ar.json +++ b/locales/ar.json @@ -5,7 +5,6 @@ "Shared `x` ago": "تم رفع الفيديو منذ `x`", "Unsubscribe": "إلغاء الإشتراك", "Subscribe": "إشتراك", - "Login to subscribe to `x`": "سجل الدخول للإشتراك فى `x`", "View channel on YouTube": "زيارة القناة على موقع يوتيوب", "newest": "الأجدد", "oldest": "الأقدم", @@ -35,15 +34,15 @@ "Login": "تسجيل الدخول", "Login/Register": "تسجيل الدخول\\إنشاء حساب", "Login to Google": "تسجيل الدخول بإستخدام جوجل", - "User ID:": "إسم المستخدم:", - "Password:": "الرقم السرى:", + "User ID": "إسم المستخدم", + "Password": "الرقم السرى", "Time (h:mm:ss):": "(يجب ان يكتب مثل هذا التنسيق) الوقت (h(ساعات):mm(دقائق):ss(ثوانى)):", "Text CAPTCHA": "CAPTCHA كلامية", "Image CAPTCHA": "CAPTCHA صورية", "Sign In": "تسجيل الدخول", "Register": "انشاء الحساب", - "Email:": "الإيميل:", - "Google verification code:": "رمز تحقق جوجل:", + "Email": "الإيميل", + "Google verification code": "رمز تحقق جوجل", "Preferences": "التفضيلات", "Player preferences": "التفضيلات المشغل", "Always loop: ": "كرر الفيديو دائما: ", @@ -115,6 +114,7 @@ "Whitelisted regions: ": "الدول المسموح فيها هذا الفيديو: ", "Blacklisted regions: ": "الدول الحظور فيها هذا الفيديو: ", "Shared `x`": "شارك منذ `x`", + "`x` views": "", "Premieres in `x`": "يعرض فى 'x'", "Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.": "اهلا! يبدو ان الجافاسكريبت معطلة. اضغط هنا لعرض التعليقات, ضع فى إعتبارك انها ستأخذ وقت اطول للعرض.", "View YouTube comments": "عرض تعليقات اليوتيوب", @@ -278,6 +278,7 @@ "About": "حول", "Rating: ": "التقييم", "Language: ": "اللغة", + "View as playlist": "", "Default": "الكل", "Music": "الاغانى", "Gaming": "الألعاب", diff --git a/locales/de.json b/locales/de.json index 2fcffd75..473cf7f2 100644 --- a/locales/de.json +++ b/locales/de.json @@ -5,7 +5,6 @@ "Shared `x` ago": "Vor `x` geteilt", "Unsubscribe": "Abbestellen", "Subscribe": "Abonnieren", - "Login to subscribe to `x`": "Einloggen um `x` zu abonnieren", "View channel on YouTube": "Kanal auf YouTube anzeigen", "newest": "neueste", "oldest": "älteste", @@ -35,15 +34,15 @@ "Login": "Einloggen", "Login/Register": "Einloggen/Registrieren", "Login to Google": "In Google einloggen", - "User ID:": "Benutzer ID:", - "Password:": "Passwort:", + "User ID": "Benutzer ID", + "Password": "Passwort", "Time (h:mm:ss):": "Zeit (h:mm:ss):", "Text CAPTCHA": "Text CAPTCHA", "Image CAPTCHA": "Image CAPTCHA", "Sign In": "Einloggen", "Register": "Registrieren", - "Email:": "Email:", - "Google verification code:": "Google Bestätigungscode:", + "Email": "Email", + "Google verification code": "Google Bestätigungscode", "Preferences": "Einstellungen", "Player preferences": "Playereinstellungen", "Always loop: ": "Immer wiederholen: ", @@ -115,6 +114,7 @@ "Whitelisted regions: ": "Erlaubte Regionen: ", "Blacklisted regions: ": "Unerlaubte Regionen: ", "Shared `x`": "Geteilt `x`", + "`x` views": "", "Premieres in `x`": "", "Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.": "Hallo! Anscheinend haben Sie JavaScript deaktiviert. Klicken Sie hier um Kommentare anzuzeigen, beachten sie dass es etwas länger dauern kann um sie zu laden.", "View YouTube comments": "YouTube Kommentare anzeigen", @@ -278,6 +278,7 @@ "About": "Über", "Rating: ": "Bewertung: ", "Language: ": "Sprache: ", + "View as playlist": "", "Default": "", "Music": "", "Gaming": "", diff --git a/locales/en-US.json b/locales/en-US.json index 174ffb4f..2b817dd7 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -5,7 +5,6 @@ "Shared `x` ago": "Shared `x` ago", "Unsubscribe": "Unsubscribe", "Subscribe": "Subscribe", - "Login to subscribe to `x`": "Login to subscribe to `x`", "View channel on YouTube": "View channel on YouTube", "newest": "newest", "oldest": "oldest", @@ -35,15 +34,15 @@ "Login": "Login", "Login/Register": "Login/Register", "Login to Google": "Login to Google", - "User ID:": "User ID:", - "Password:": "Password:", + "User ID": "User ID", + "Password": "Password", "Time (h:mm:ss):": "Time (h:mm:ss):", "Text CAPTCHA": "Text CAPTCHA", "Image CAPTCHA": "Image CAPTCHA", "Sign In": "Sign In", "Register": "Register", - "Email:": "Email:", - "Google verification code:": "Google verification code:", + "Email": "Email", + "Google verification code": "Google verification code", "Preferences": "Preferences", "Player preferences": "Player preferences", "Always loop: ": "Always loop: ", @@ -103,7 +102,7 @@ "View JavaScript license information.": "View JavaScript license information.", "View privacy policy.": "View privacy policy.", "Trending": "Trending", - "Unlisted": "", + "Unlisted": "Unlisted", "Watch video on Youtube": "Watch video on Youtube", "Genre: ": "Genre: ", "License: ": "License: ", @@ -113,7 +112,8 @@ "Whitelisted regions: ": "Whitelisted regions: ", "Blacklisted regions: ": "Blacklisted regions: ", "Shared `x`": "Shared `x`", - "Premieres in `x`": "", + "`x` views": "`x` views", + "Premieres in `x`": "Premieres in `x`", "Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.": "Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.", "View YouTube comments": "View YouTube comments", "View more comments on Reddit": "View more comments on Reddit", @@ -276,6 +276,7 @@ "About": "About", "Rating: ": "Rating: ", "Language: ": "Language: ", + "View as playlist": "View as playlist", "Default": "Default", "Music": "Music", "Gaming": "Gaming", diff --git a/locales/es.json b/locales/es.json index 67d4d5d3..5a12c7bc 100644 --- a/locales/es.json +++ b/locales/es.json @@ -5,7 +5,6 @@ "Shared `x` ago": "Compartido hace `x`", "Unsubscribe": "Desuscribirse", "Subscribe": "Suscribirse", - "Login to subscribe to `x`": "Inicie sesión para suscribirse a `x`", "View channel on YouTube": "Ver el canal en YouTube", "newest": "más nuevos", "oldest": "más viejos", @@ -35,15 +34,15 @@ "Login": "Iniciar sesión", "Login/Register": "Iniciar sesión/Registrarse", "Login to Google": "Iniciar sesión en Google", - "User ID:": "Nombre:", - "Password:": "Contraseña:", + "User ID": "Nombre", + "Password": "Contraseña", "Time (h:mm:ss):": "Hora (h:mm:ss):", "Text CAPTCHA": "CAPTCHA en texto", "Image CAPTCHA": "CAPTCHA en imagen", "Sign In": "Iniciar sesión", "Register": "Registrarse", - "Email:": "Correo:", - "Google verification code:": "Código de verificación de Google:", + "Email": "Correo", + "Google verification code": "Código de verificación de Google", "Preferences": "Preferencias", "Player preferences": "Preferencias del reproductor", "Always loop: ": "Repetir siempre: ", @@ -113,6 +112,7 @@ "Whitelisted regions: ": "Regiones permitidas: ", "Blacklisted regions: ": "Regiones bloqueadas: ", "Shared `x`": "Compartido `x`", + "`x` views": "", "Premieres in `x`": "", "Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.": "¡Hola! Parece que tiene JavaScript desactivado. Haga clic aquí para ver los comentarios, pero tenga en cuenta que pueden tardar un poco más en cargarse.", "View YouTube comments": "Ver los comentarios de YouTube", @@ -276,6 +276,7 @@ "About": "Acerca de", "Rating: ": "Valoración: ", "Language: ": "Idioma: ", + "View as playlist": "", "Default": "Por defecto", "Music": "Música", "Gaming": "Videojuegos", diff --git a/locales/eu.json b/locales/eu.json index 4a7342a1..4ec5c46b 100644 --- a/locales/eu.json +++ b/locales/eu.json @@ -5,7 +5,6 @@ "Shared `x` ago": "Duela `x` partekatua", "Unsubscribe": "Harpidetza kendu", "Subscribe": "Harpidetu", - "Login to subscribe to `x`": "Saioa hasi `x`(e)ra harpidetzeko", "View channel on YouTube": "Ikusi kanala YouTuben", "newest": "berrienak", "oldest": "zaharrenak", @@ -35,8 +34,8 @@ "Login": "Saioa hasi", "Login/Register": "Saioa hasi/Izena eman", "Login to Google": "Googlekin hasi saioa", - "User ID:": "Erabiltzaile IDa:", - "Password:": "Pasahitza:", + "User ID": "Erabiltzaile IDa", + "Password": "Pasahitza", "Time (h:mm:ss):": "Denbora (o:mm:ss):", "Text CAPTCHA": "Testu CAPTCHA", "Image CAPTCHA": "Irudi CAPTCHA", @@ -113,6 +112,7 @@ "Whitelisted regions: ": "", "Blacklisted regions: ": "", "Shared `x`": "", + "`x` views": "", "Premieres in `x`": "", "Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.": "", "View YouTube comments": "", @@ -276,6 +276,7 @@ "About": "", "Rating: ": "", "Language: ": "", + "View as playlist": "", "Default": "", "Music": "", "Gaming": "", diff --git a/locales/fr.json b/locales/fr.json index 12dc9f2c..69427f8e 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -5,7 +5,6 @@ "Shared `x` ago": "Ajoutée il y a `x`", "Unsubscribe": "Se désabonner", "Subscribe": "S'abonner", - "Login to subscribe to `x`": "Vous devez vous connecter pour vous abonner à `x`", "View channel on YouTube": "Voir la chaîne sur YouTube", "newest": "Date d'ajout (la plus récente)", "oldest": "Date d'ajout (la plus ancienne)", @@ -35,15 +34,15 @@ "Login": "Se connecter", "Login/Register": "Se connecter/Créer un compte", "Login to Google": "Se connecter avec Google", - "User ID:": "Identifiant utilisateur :", - "Password:": "Mot de passe :", + "User ID": "Identifiant utilisateur", + "Password": "Mot de passe", "Time (h:mm:ss):": "Heure (h:mm:ss) :", "Text CAPTCHA": "CAPTCHA Texte", "Image CAPTCHA": "CAPTCHA Image", "Sign In": "Se connecter", "Register": "S'inscrire", - "Email:": "E-mail :", - "Google verification code:": "Code de vérification Google :", + "Email": "E-mail", + "Google verification code": "Code de vérification Google", "Preferences": "Préférences", "Player preferences": "Préférences du lecteur", "Always loop: ": "Lire en boucle : ", @@ -113,6 +112,7 @@ "Whitelisted regions: ": "Régions en liste blanche : ", "Blacklisted regions: ": "Régions sur liste noire : ", "Shared `x`": "Ajoutée le `x`", + "`x` views": "", "Premieres in `x`": "Première dans `x`", "Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.": "Il semblerait que JavaScript soit désactivé. Cliquez ici pour voir les commentaires sans. Gardez à l'esprit que le chargement peut prendre plus de temps.", "View YouTube comments": "Voir les commentaires YouTube", @@ -276,6 +276,7 @@ "About": "A Propos", "Rating: ": "Évaluation : ", "Language: ": "Langue : ", + "View as playlist": "", "Default": "Défaut", "Music": "Musique", "Gaming": "Jeux Vidéo", diff --git a/locales/it.json b/locales/it.json index 76bc15bd..1def7c2e 100644 --- a/locales/it.json +++ b/locales/it.json @@ -5,7 +5,6 @@ "Shared `x` ago": "Condiviso `x` fa", "Unsubscribe": "Disiscriviti", "Subscribe": "Iscriviti", - "Login to subscribe to `x`": "Accedi per iscriverti a `x`", "View channel on YouTube": "Vedi canale su YouTube", "newest": "Data di aggiunta (più recente)", "oldest": "Data di aggiunta (più vecchia)", @@ -35,15 +34,15 @@ "Login": "Entra", "Login/Register": "Entra/Registrati", "Login to Google": "Entra con Google", - "User ID:": "ID utente:", - "Password:": "Password:", + "User ID": "ID utente", + "Password": "Password", "Time (h:mm:ss):": "Orario (h:mm:ss):", "Text CAPTCHA": "Testo del CAPTCHA", "Image CAPTCHA": "Immagine CAPTCHA", "Sign In": "Entra", "Register": "Registrati", - "Email:": "Email:", - "Google verification code:": "Codice di verifica Google:", + "Email": "Email", + "Google verification code": "Codice di verifica Google", "Preferences": "Preferenze", "Player preferences": "Preferenze del riproduttore", "Always loop: ": "Ripeti sempre: ", @@ -113,6 +112,7 @@ "Whitelisted regions: ": "Regioni nella lista bianca: ", "Blacklisted regions: ": "Regioni nella lista nera: ", "Shared `x`": "Condiviso `x`", + "`x` views": "", "Premieres in `x`": "", "Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.": "Ciao! Sembra che tu abbia disattivato JavaScript. Clicca qui per visualizzare i commenti. Considera che potrebbe volerci più tempo.", "View YouTube comments": "Visualizza i commenti da YouTube", @@ -276,6 +276,7 @@ "About": "A proposito", "Rating: ": "Punteggio: ", "Language: ": "Lingua: ", + "View as playlist": "", "Default": "Predefinito", "Music": "Musica", "Gaming": "Videogiochi", diff --git a/locales/nb_NO.json b/locales/nb_NO.json index 4af499d7..0de28379 100644 --- a/locales/nb_NO.json +++ b/locales/nb_NO.json @@ -5,7 +5,6 @@ "Shared `x` ago": "Delt for `x` siden", "Unsubscribe": "Opphev abonnement", "Subscribe": "Abonner", - "Login to subscribe to `x`": "Logg inn for å abonnere på `x`", "View channel on YouTube": "Vis kanal på YouTube", "newest": "nyeste", "oldest": "eldste", @@ -35,15 +34,15 @@ "Login": "Logg inn", "Login/Register": "Logg inn/registrer", "Login to Google": "Logg inn med Google", - "User ID:": "Bruker-ID:", - "Password:": "Passord:", + "User ID": "Bruker-ID", + "Password": "Passord", "Time (h:mm:ss):": "Tid (h:mm:ss):", "Text CAPTCHA": "Tekst-CAPTCHA", "Image CAPTCHA": "Bilde-CAPTCHA", "Sign In": "Innlogging", "Register": "Registrer", - "Email:": "E-post:", - "Google verification code:": "Google-bekreftelseskode:", + "Email": "E-post", + "Google verification code": "Google-bekreftelseskode", "Preferences": "Innstillinger", "Player preferences": "Avspillerinnstillinger", "Always loop: ": "Alltid gjenta: ", @@ -113,6 +112,7 @@ "Whitelisted regions: ": "Hvitlistede regioner: ", "Blacklisted regions: ": "Svartelistede regioner: ", "Shared `x`": "Delt `x`", + "`x` views": "", "Premieres in `x`": "Premiere om `x`", "Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.": "Hei. Det ser ut til at du har JavaScript avslått. Klikk her for å vise kommentarer, ha i minnet at innlasting tar lengre tid.", "View YouTube comments": "Vis YouTube-kommentarer", @@ -276,6 +276,7 @@ "About": "Om", "Rating: ": "Vurdering: ", "Language: ": "Språk: ", + "View as playlist": "", "Default": "Forvalg", "Music": "Musikk", "Gaming": "Spill", diff --git a/locales/nl.json b/locales/nl.json index 68294dc6..ac5f4ea5 100644 --- a/locales/nl.json +++ b/locales/nl.json @@ -5,7 +5,6 @@ "Shared `x` ago": "Gedeeld `x` geleden", "Unsubscribe": "Abonnement opzeggen", "Subscribe": "Abonneren", - "Login to subscribe to `x`": "Log in om te abonneren op `x`", "View channel on YouTube": "Bekijk kanaal op Youtube", "newest": "nieuwste", "oldest": "oudste", @@ -35,15 +34,15 @@ "Login": "Inloggen", "Login/Register": "Inloggen/Registreren", "Login to Google": "Inloggen op Google", - "User ID:": "Gebruiker ID:", - "Password:": "Wachtwoord:", + "User ID": "Gebruiker ID", + "Password": "Wachtwoord", "Time (h:mm:ss):": "Tijd (h:mm:ss):", "Text CAPTCHA": "Tekst CAPTCHA", "Image CAPTCHA": "Afbeelding CAPTCHA", "Sign In": "Aanmelden", "Register": "Registreren", - "Email:": "Email:", - "Google verification code:": "Google verificatie code:", + "Email": "Email", + "Google verification code": "Google verificatie code", "Preferences": "Voorkeuren", "Player preferences": "Afspeler voorkeuren", "Always loop: ": "Altijd herhalen: ", @@ -113,6 +112,7 @@ "Whitelisted regions: ": "Toegestane regio's: ", "Blacklisted regions: ": "Geblokkeerde regio's: ", "Shared `x`": "`x` gedeeld", + "`x` views": "", "Premieres in `x`": "", "Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.": "Hoi! Het lijkt erop dat je JavaScript uit hebt staan. Klik hier om de reacties te bekijken, hou er rekening mee dat het wat langer duurt om te laden.", "View YouTube comments": "Bekijk YouTube reacties", @@ -276,6 +276,7 @@ "About": "", "Rating: ": "", "Language: ": "", + "View as playlist": "", "Default": "", "Music": "", "Gaming": "", diff --git a/locales/pl.json b/locales/pl.json index 37410974..f4c4f6b2 100644 --- a/locales/pl.json +++ b/locales/pl.json @@ -5,7 +5,6 @@ "Shared `x` ago": "Udostępniono `x` temu", "Unsubscribe": "Odsubskrybuj", "Subscribe": "Subskrybuj", - "Login to subscribe to `x`": "Zaloguj się, aby subskrybować `x`", "View channel on YouTube": "Wyświetl kanał na YouTube", "newest": "najnowsze", "oldest": "najstarsze", @@ -35,15 +34,15 @@ "Login": "Zaloguj", "Login/Register": "Zaloguj/Zarejestruj", "Login to Google": "Zaloguj do Google", - "User ID:": "ID użytkownika:", - "Password:": "Hasło:", + "User ID": "ID użytkownika", + "Password": "Hasło", "Time (h:mm:ss):": "Godzina (h:mm:ss):", "Text CAPTCHA": "Tekst CAPTCHA", "Image CAPTCHA": "Obraz CAPTCHA", "Sign In": "Zaloguj się", "Register": "Zarejestruj się", - "Email:": "Email:", - "Google verification code:": "Kod weryfikacyjny Google:", + "Email": "Email", + "Google verification code": "Kod weryfikacyjny Google", "Preferences": "Preferencje", "Player preferences": "Ustawienia odtwarzacza", "Always loop: ": "Zawsze zapętlaj: ", @@ -113,6 +112,7 @@ "Whitelisted regions: ": "Dostępny na obszarach: ", "Blacklisted regions: ": "Niedostępny na obszarach: ", "Shared `x`": "Udostępniono `x`", + "`x` views": "", "Premieres in `x`": "", "Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.": "Cześć! Wygląda na to, że masz wyłączoną obsługę JavaScriptu. Kliknij tutaj, żeby zobaczyć komentarze. Pamiętaj, że wczytywanie może potrwać dłużej.", "View YouTube comments": "Wyświetl komentarze z YouTube", @@ -276,6 +276,7 @@ "About": "Informacje", "Rating: ": "Ocena: ", "Language: ": "Język: ", + "View as playlist": "", "Default": "Domyślnie", "Music": "Muzyka", "Gaming": "Gry", diff --git a/locales/ru.json b/locales/ru.json index 25ef0ee2..8dc04c2a 100644 --- a/locales/ru.json +++ b/locales/ru.json @@ -5,7 +5,6 @@ "Shared `x` ago": "Опубликовано `x` назад", "Unsubscribe": "Отписаться", "Subscribe": "Подписаться", - "Login to subscribe to `x`": "Войти, чтобы подписаться на `x`", "View channel on YouTube": "Канал на YouTube", "newest": "новые", "oldest": "старые", @@ -35,15 +34,15 @@ "Login": "Войти", "Login/Register": "Войти/Регистрация", "Login to Google": "Войти через Google", - "User ID:": "ID пользователя:", - "Password:": "Пароль:", + "User ID": "ID пользователя", + "Password": "Пароль", "Time (h:mm:ss):": "Время (ч:мм:сс):", "Text CAPTCHA": "Текст капчи", "Image CAPTCHA": "Изображение капчи", "Sign In": "Войти", "Register": "Регистрация", - "Email:": "Эл. почта:", - "Google verification code:": "Код подтверждения Google:", + "Email": "Эл. почта", + "Google verification code": "Код подтверждения Google", "Preferences": "Настройки", "Player preferences": "Настройки проигрывателя", "Always loop: ": "Всегда повторять: ", @@ -115,6 +114,7 @@ "Whitelisted regions: ": "Доступно для: ", "Blacklisted regions: ": "Недоступно для: ", "Shared `x`": "Опубликовано `x`", + "`x` views": "", "Premieres in `x`": "Премьера через `x`", "Hi! Looks like you have JavaScript disabled. Click here to view comments, keep in mind it may take a bit longer to load.": "Похоже, что у Вас отключен JavaScript. Нажмите сюда, чтобы увидеть комментарии (учтите, что они могут загружаться дольше).", "View YouTube comments": "Смотреть комментарии с YouTube", @@ -278,6 +278,7 @@ "About": "О сайте", "Rating: ": "Рейтинг: ", "Language: ": "Язык: ", + "View as playlist": "", "Default": "По-умолчанию", "Music": "Музыка", "Gaming": "Игры", diff --git a/src/invidious.cr b/src/invidious.cr index 2d566ac0..f0d7fbf1 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -731,6 +731,8 @@ get "/search" do |env| sort = value when "subscriptions" subscriptions = value == "true" + else + operators.delete(operator) end end @@ -1617,7 +1619,7 @@ get "/subscription_ajax" do |env| } post_url = "/subscription_ajax?#{action}=1&c=#{channel_id}" - # Sync subscription with YouTube + # Sync subscriptions with YouTube client.post(post_url, headers, form: post_req) email = user.email else @@ -1953,7 +1955,7 @@ get "/feed/trending" do |env| region ||= "US" begin - trending = fetch_trending(trending_type, proxies, region, locale) + trending, plid = fetch_trending(trending_type, proxies, region, locale) rescue ex error_message = "#{ex.message}" next templated "error" @@ -2778,12 +2780,12 @@ get "/api/v1/comments/:id" do |env| format = env.params.query["format"]? format ||= "json" - sort_by = env.params.query["sort_by"]?.try &.downcase - sort_by ||= "top" - continuation = env.params.query["continuation"]? + sort_by = env.params.query["sort_by"]?.try &.downcase if source == "youtube" + sort_by ||= "top" + begin comments = fetch_youtube_comments(id, PG_DB, continuation, proxies, format, locale, thin_mode, region, sort_by: sort_by) rescue ex @@ -2794,8 +2796,10 @@ get "/api/v1/comments/:id" do |env| next comments elsif source == "reddit" + sort_by ||= "confidence" + begin - comments, reddit_thread = fetch_reddit_comments(id) + comments, reddit_thread = fetch_reddit_comments(id, sort_by: sort_by) content_html = template_reddit_comments(comments, locale) content_html = fill_links(content_html, "https", "www.reddit.com") @@ -3201,7 +3205,7 @@ get "/api/v1/trending" do |env| trending_type = env.params.query["type"]? begin - trending = fetch_trending(trending_type, proxies, region, locale) + trending, plid = fetch_trending(trending_type, proxies, region, locale) rescue ex error_message = {"error" => ex.message}.to_json env.response.status_code = 500 diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index cd96565b..645ca2a8 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -249,7 +249,7 @@ def fetch_youtube_comments(id, db, continuation, proxies, format, locale, thin_m return comments end -def fetch_reddit_comments(id) +def fetch_reddit_comments(id, sort_by = "confidence") client = make_client(REDDIT_URL) headers = HTTP::Headers{"User-Agent" => "web:invidious:v#{CURRENT_VERSION} (by /u/omarroth)"} @@ -259,12 +259,16 @@ def fetch_reddit_comments(id) if search_results.status_code == 200 search_results = RedditThing.from_json(search_results.body) + # For videos that have more than one thread, choose the one with the highest score thread = search_results.data.as(RedditListing).children.sort_by { |child| child.data.as(RedditLink).score }[-1] thread = thread.data.as(RedditLink) - result = client.get("/r/#{thread.subreddit}/comments/#{thread.id}.json?limit=100&sort=top", headers).body + result = client.get("/r/#{thread.subreddit}/comments/#{thread.id}.json?limit=100&sort=#{sort_by}", headers).body result = Array(RedditThing).from_json(result) elsif search_results.status_code == 302 + # Previously, if there was only one result then the API would redirect to that result. + # Now, it appears it will still return a listing so this section is likely unnecessary. + result = client.get(search_results.headers["Location"], headers).body result = Array(RedditThing).from_json(result) diff --git a/src/invidious/helpers/utils.cr b/src/invidious/helpers/utils.cr index eb8fa80a..eb304d8d 100644 --- a/src/invidious/helpers/utils.cr +++ b/src/invidious/helpers/utils.cr @@ -189,7 +189,9 @@ def number_to_short_text(number) text = text.rchop(".0") - if number / 1000000 != 0 + if number / 1_000_000_000 != 0 + text += "B" + elsif number / 1_000_000 != 0 text += "M" elsif number / 1000 != 0 text += "K" diff --git a/src/invidious/trending.cr b/src/invidious/trending.cr index 15630721..8e55f207 100644 --- a/src/invidious/trending.cr +++ b/src/invidious/trending.cr @@ -7,6 +7,8 @@ def fetch_trending(trending_type, proxies, region, locale) region = region.upcase trending = "" + plid = nil + if trending_type && trending_type != "Default" trending_type = trending_type.downcase.capitalize @@ -23,9 +25,11 @@ def fetch_trending(trending_type, proxies, region, locale) url = tabs.select { |tab| tab["channelListSubMenuAvatarRenderer"]["title"]["simpleText"] == trending_type }[0]? if url + url["channelListSubMenuAvatarRenderer"]["navigationEndpoint"]["commandMetadata"]["webCommandMetadata"]["url"] url = url["channelListSubMenuAvatarRenderer"]["navigationEndpoint"]["commandMetadata"]["webCommandMetadata"]["url"].as_s url += "&disable_polymer=1&gl=#{region}&hl=en" trending = client.get(url).body + plid = extract_plid(url) else trending = client.get("/feed/trending?gl=#{region}&hl=en&disable_polymer=1").body end @@ -37,5 +41,37 @@ def fetch_trending(trending_type, proxies, region, locale) nodeset = trending.xpath_nodes(%q(//ul/li[@class="expanded-shelf-content-item-wrapper"])) trending = extract_videos(nodeset) - return trending + return {trending, plid} +end + +def extract_plid(url) + wrapper = HTTP::Params.parse(URI.parse(url).query.not_nil!)["bp"] + + wrapper = URI.unescape(wrapper) + wrapper = Base64.decode(wrapper) + + # 0xe2 0x02 0x2e + wrapper += 3 + + # 0x0a + wrapper += 1 + + # Looks like "/m/[a-z0-9]{5}", not sure what it does here + + item_size = wrapper[0] + wrapper += 1 + item = wrapper[0, item_size] + wrapper += item.size + + # 0x12 + wrapper += 1 + + plid_size = wrapper[0] + wrapper += 1 + plid = wrapper[0, plid_size] + wrapper += plid.size + + plid = String.new(plid) + + return plid end diff --git a/src/invidious/views/channel.ecr b/src/invidious/views/channel.ecr index 746ffcde..d52c01ca 100644 --- a/src/invidious/views/channel.ecr +++ b/src/invidious/views/channel.ecr @@ -67,15 +67,15 @@ </div> <div class="pure-g h-box"> - <div class="pure-u-1 pure-u-md-1-5"> + <div class="pure-u-1 pure-u-lg-1-5"> <% if page >= 2 %> <a href="/channel/<%= ucid %>?page=<%= page - 1 %><% if sort_by != "newest" %>&sort_by=<%= sort_by %><% end %>"> <%= translate(locale, "Previous page") %> </a> <% end %> </div> - <div class="pure-u-1 pure-u-md-3-5"></div> - <div style="text-align:right;" class="pure-u-1 pure-u-md-1-5"> + <div class="pure-u-1 pure-u-lg-3-5"></div> + <div style="text-align:right" class="pure-u-1 pure-u-lg-1-5"> <% if count == 60 %> <a href="/channel/<%= ucid %>?page=<%= page + 1 %><% if sort_by != "newest" %>&sort_by=<%= sort_by %><% end %>"> <%= translate(locale, "Next page") %> diff --git a/src/invidious/views/components/item.ecr b/src/invidious/views/components/item.ecr index e2a5195c..2dc0bea4 100644 --- a/src/invidious/views/components/item.ecr +++ b/src/invidious/views/components/item.ecr @@ -71,7 +71,12 @@ <% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %> <h5><%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %></h5> <% elsif Time.now - item.published > 1.minute %> - <h5><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></h5> + <h5 class="pure-g"> + <div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div> + <div class="pure-u-1-3" style="text-align: right"> + <%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %> + </div> + </h5> <% end %> <% else %> <% if env.get("preferences").as(Preferences).thin_mode %> @@ -108,7 +113,12 @@ <% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp && item.premiere_timestamp.not_nil! > Time.now %> <h5><%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.now).ago, locale)) %></h5> <% elsif Time.now - item.published > 1.minute %> - <h5><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></h5> + <h5 class="pure-g"> + <div class="pure-u-2-3"><%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %></div> + <div class="pure-u-1-3" style="text-align: right"> + <%= item.responds_to?(:views) ? translate(locale, "`x` views", number_to_short_text(item.views)) : "" %> + </div> + </h5> <% end %> <% end %> </div> diff --git a/src/invidious/views/components/subscribe_widget.ecr b/src/invidious/views/components/subscribe_widget.ecr index 5cdb6525..df16658d 100644 --- a/src/invidious/views/components/subscribe_widget.ecr +++ b/src/invidious/views/components/subscribe_widget.ecr @@ -18,7 +18,7 @@ <p> <a id="subscribe" class="pure-button pure-button-primary" href="/login?referer=<%= env.get("current_page") %>"> - <b><%= translate(locale, "Login to subscribe to `x`", author) %></b> + <b><%= translate(locale, "Subscribe") %> | <%= sub_count_text %></b> </a> </p> <% end %> diff --git a/src/invidious/views/history.ecr b/src/invidious/views/history.ecr index 017f5eae..9be40a0d 100644 --- a/src/invidious/views/history.ecr +++ b/src/invidious/views/history.ecr @@ -72,15 +72,15 @@ function mark_unwatched(target) { </script> <div class="pure-g h-box"> - <div class="pure-u-1 pure-u-md-1-5"> + <div class="pure-u-1 pure-u-lg-1-5"> <% if page >= 2 %> <a href="/feed/history?page=<%= page - 1 %>"> <%= translate(locale, "Previous page") %> </a> <% end %> </div> - <div class="pure-u-1 pure-u-md-3-5"></div> - <div style="text-align:right;" class="pure-u-1 pure-u-md-1-5"> + <div class="pure-u-1 pure-u-lg-3-5"></div> + <div style="text-align:right;" class="pure-u-1 pure-u-lg-1-5"> <% if watched.size >= limit %> <a href="/feed/history?page=<%= page + 1 %>"> <%= translate(locale, "Next page") %> diff --git a/src/invidious/views/login.ecr b/src/invidious/views/login.ecr index 82e9396c..ec5dc147 100644 --- a/src/invidious/views/login.ecr +++ b/src/invidious/views/login.ecr @@ -3,8 +3,8 @@ <% end %> <div class="pure-g"> - <div class="pure-u-1 pure-u-md-1-5"></div> - <div class="pure-u-1 pure-u-md-3-5"> + <div class="pure-u-1 pure-u-lg-1-5"></div> + <div class="pure-u-1 pure-u-lg-3-5"> <div class="h-box"> <div class="pure-g"> <div class="pure-u-1-2"> @@ -25,15 +25,15 @@ <% if email %> <input name="email" type="hidden" value="<%= email %>"> <% else %> - <label for="email"><%= translate(locale, "User ID:") %></label> - <input required class="pure-input-1" name="email" type="text" placeholder="User ID"> + <label for="email"><%= translate(locale, "User ID") %> :</label> + <input required class="pure-input-1" name="email" type="text" placeholder="<%= translate(locale, "User ID") %>"> <% end %> <% if password %> <input name="password" type="hidden" value="<%= password %>"> <% else %> - <label for="password"><%= translate(locale, "Password:") %></label> - <input required class="pure-input-1" name="password" type="password" placeholder="Password"> + <label for="password"><%= translate(locale, "Password") %> :</label> + <input required class="pure-input-1" name="password" type="password" placeholder="<%= translate(locale, "Password") %>"> <% end %> <% if captcha %> @@ -56,7 +56,7 @@ <% end %> <input type="hidden" name="captcha_type" value="text"> <label for="answer"><%= captcha[:question] %></label> - <input type="text" name="answer" type="text" placeholder="Answer"> + <input type="text" name="answer" type="text" placeholder="<%= translate(locale, "Answer") %>"> <% end %> <button type="submit" name="action" value="signin" class="pure-button pure-button-primary"> @@ -90,20 +90,20 @@ <% if email %> <input name="email" type="hidden" value="<%= email %>"> <% else %> - <label for="email"><%= translate(locale, "Email:") %></label> - <input required class="pure-input-1" name="email" type="email" placeholder="Email"> + <label for="email"><%= translate(locale, "Email") %> :</label> + <input required class="pure-input-1" name="email" type="email" placeholder="<%= translate(locale, "Email") %>"> <% end %> <% if password %> <input name="password" type="hidden" value="<%= password %>"> <% else %> - <label for="password"><%= translate(locale, "Password:") %></label> - <input required class="pure-input-1" name="password" type="password" placeholder="Password"> + <label for="password"><%= translate(locale, "Password") %> :</label> + <input required class="pure-input-1" name="password" type="password" placeholder="<%= translate(locale, "Password") %>"> <% end %> <% if tfa %> - <label for="tfa"><%= translate(locale, "Google verification code:") %></label> - <input required class="pure-input-1" name="tfa" type="text" placeholder="Google verification code"> + <label for="tfa"><%= translate(locale, "Google verification code") %> :</label> + <input required class="pure-input-1" name="tfa" type="text" placeholder="<%= translate(locale, "Google verification code") %>"> <% end %> <button type="submit" class="pure-button pure-button-primary"><%= translate(locale, "Sign In") %></button> @@ -112,5 +112,5 @@ <% end %> </div> </div> - <div class="pure-u-1 pure-u-md-1-5"></div> + <div class="pure-u-1 pure-u-lg-1-5"></div> </div> diff --git a/src/invidious/views/playlist.ecr b/src/invidious/views/playlist.ecr index 98da42dc..6bd0dc9e 100644 --- a/src/invidious/views/playlist.ecr +++ b/src/invidious/views/playlist.ecr @@ -34,15 +34,15 @@ </div> <div class="pure-g h-box"> - <div class="pure-u-1 pure-u-md-1-5"> + <div class="pure-u-1 pure-u-lg-1-5"> <% if page >= 2 %> <a href="/playlist?list=<%= playlist.id %>&page=<%= page - 1 %>"> <%= translate(locale, "Previous page") %> </a> <% end %> </div> - <div class="pure-u-1 pure-u-md-3-5"></div> - <div style="text-align:right;" class="pure-u-1 pure-u-md-1-5"> + <div class="pure-u-1 pure-u-lg-3-5"></div> + <div style="text-align:right;" class="pure-u-1 pure-u-lg-1-5"> <% if videos.size == 100 %> <a href="/playlist?list=<%= playlist.id %>&page=<%= page + 1 %>"> <%= translate(locale, "Next page") %> diff --git a/src/invidious/views/playlists.ecr b/src/invidious/views/playlists.ecr index 3f661494..ee7918e7 100644 --- a/src/invidious/views/playlists.ecr +++ b/src/invidious/views/playlists.ecr @@ -65,7 +65,7 @@ <div class="pure-g h-box"> <div class="pure-u-1 pure-u-md-4-5"></div> - <div style="text-align:right;" class="pure-u-1 pure-u-md-1-5"> + <div style="text-align:right;" class="pure-u-1 pure-u-lg-1-5"> <% if items.size >= 28 %> <a href="/channel/<%= ucid %>/playlists?continuation=<%= continuation %><% if sort_by != "last" %>&sort_by=<%= sort_by %><% end %>"> <%= translate(locale, "Next page") %> diff --git a/src/invidious/views/search.ecr b/src/invidious/views/search.ecr index a0d3bb7b..4d943127 100644 --- a/src/invidious/views/search.ecr +++ b/src/invidious/views/search.ecr @@ -11,15 +11,15 @@ </div> <div class="pure-g h-box"> - <div class="pure-u-1 pure-u-md-1-5"> + <div class="pure-u-1 pure-u-lg-1-5"> <% if page >= 2 %> <a href="/search?q=<%= HTML.escape(query.not_nil!) %>&page=<%= page - 1 %>"> <%= translate(locale, "Previous page") %> </a> <% end %> </div> - <div class="pure-u-1 pure-u-md-3-5"></div> - <div style="text-align:right;" class="pure-u-1 pure-u-md-1-5"> + <div class="pure-u-1 pure-u-lg-3-5"></div> + <div style="text-align:right;" class="pure-u-1 pure-u-lg-1-5"> <% if count >= 20 %> <a href="/search?q=<%= HTML.escape(query.not_nil!) %>&page=<%= page + 1 %>"> <%= translate(locale, "Next page") %> diff --git a/src/invidious/views/subscriptions.ecr b/src/invidious/views/subscriptions.ecr index 744f77a0..88f0f6c4 100644 --- a/src/invidious/views/subscriptions.ecr +++ b/src/invidious/views/subscriptions.ecr @@ -74,15 +74,15 @@ function mark_watched(target) { </script> <div class="pure-g h-box"> - <div class="pure-u-1 pure-u-md-1-5"> + <div class="pure-u-1 pure-u-lg-1-5"> <% if page >= 2 %> <a href="/feed/subscriptions?max_results=<%= max_results %>&page=<%= page - 1 %>"> <%= translate(locale, "Previous page") %> </a> <% end %> </div> - <div class="pure-u-1 pure-u-md-3-5"></div> - <div style="text-align:right;" class="pure-u-1 pure-u-md-1-5"> + <div class="pure-u-1 pure-u-lg-3-5"></div> + <div style="text-align:right;" class="pure-u-1 pure-u-lg-1-5"> <% if (videos.size + notifications.size) == max_results %> <a href="/feed/subscriptions?max_results=<%= max_results %>&page=<%= page + 1 %>"> <%= translate(locale, "Next page") %> diff --git a/src/invidious/views/trending.ecr b/src/invidious/views/trending.ecr index efd9999a..d6c25266 100644 --- a/src/invidious/views/trending.ecr +++ b/src/invidious/views/trending.ecr @@ -6,9 +6,10 @@ <%= rendered "components/feed_menu" %> <div class="pure-g h-box"> - <div class="pure-u-2-3"> - <form class="pure-form pure-form-aligned" action="/feed/trending" method="get"> - </form> + <div style="align-self:flex-end" class="pure-u-2-3"> + <% if plid %> + <a href="/playlist?list=<%= plid %>"><%= translate(locale, "View as playlist") %></a> + <% end %> </div> <div class="pure-u-1-3"> <div class="pure-g" style="text-align:right;"> diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 954b724f..8c1c66b6 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -40,7 +40,7 @@ </a> <% else %> <a title="<%=translate(locale, "Audio mode")%>" href="/watch?<%= env.params.query %>&listen=1"> - <i class="icon ion-ios-volume-high"></i> + <i class="icon ion-md-headset"></i> </a> <% end %> </h1> @@ -53,7 +53,7 @@ </div> <div class="pure-g"> - <div class="pure-u-1 pure-u-md-1-5"> + <div class="pure-u-1 pure-u-lg-1-5"> <div class="h-box"> <p><a href="https://www.youtube.com/watch?v=<%= video.id %>"><%= translate(locale, "Watch video on Youtube") %></a></p> @@ -122,7 +122,7 @@ </div> </div> - <div class="pure-u-1 <% if params[:related_videos] || plid %>pure-u-md-3-5<% else %>pure-u-md-4-5<% end %>"> + <div class="pure-u-1 <% if params[:related_videos] || plid %>pure-u-lg-3-5<% else %>pure-u-md-4-5<% end %>"> <div class="h-box"> <p> <a href="/channel/<%= video.ucid %>"> @@ -154,7 +154,7 @@ </div> </div> <% if params[:related_videos] || plid %> - <div class="pure-u-1 pure-u-md-1-5"> + <div class="pure-u-1 pure-u-lg-1-5"> <% if plid %> <div id="playlist" class="h-box"> </div> |
