From 0321dda1d76cb17a20b90a0fe26542dd5b3af0d0 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Mon, 29 Jul 2019 20:39:12 -0500 Subject: [PATCH 01/11] Fix handling for video content warnings --- src/invidious/videos.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 7e2e0f5ae..7abc84040 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -1179,7 +1179,7 @@ def fetch_video(id, region) raise "Video unavailable." end - if info["reason"]? + if info["reason"]? && !info["player_response"]["videoDetails"]? raise info["reason"] end From f6431751564fcab712e798ea31f2397b841b5c27 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Tue, 30 Jul 2019 10:12:41 -0500 Subject: [PATCH 02/11] Fix typo in video extractor --- src/invidious/videos.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 7abc84040..ea02b9382 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -1187,7 +1187,7 @@ def fetch_video(id, region) title = player_json["videoDetails"]["title"].as_s author = player_json["videoDetails"]["author"]?.try &.as_s || "" - ucid = player_json["videoDetails"]["ucid"]?.try &.as_s || "" + ucid = player_json["videoDetails"]["channelId"]?.try &.as_s || "" views = html.xpath_node(%q(//meta[@itemprop="interactionCount"])) .try &.["content"].to_i64? || 0_i64 From 8af33084ed313e6a3931d08732e3703ed143a18b Mon Sep 17 00:00:00 2001 From: TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> Date: Wed, 31 Jul 2019 13:52:41 +0000 Subject: [PATCH 03/11] French translation updated - New words, consistency (#643) * New words translated, more consistency --- locales/fr.json | 68 ++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/locales/fr.json b/locales/fr.json index f5693ab4f..37a773f17 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -6,7 +6,7 @@ "Unsubscribe": "Se désabonner", "Subscribe": "S'abonner", "View channel on YouTube": "Voir la chaîne sur YouTube", - "View playlist on YouTube": "", + "View playlist on YouTube": "Voir la liste de lecture sur YouTube", "newest": "Date d'ajout (la plus récente)", "oldest": "Date d'ajout (la plus ancienne)", "popular": "Les plus populaires", @@ -53,10 +53,10 @@ "Player preferences": "Préférences du lecteur", "Always loop: ": "Lire en boucle : ", "Autoplay: ": "Lire automatiquement : ", - "Play next by default: ": "Jouer suirvante par défaut : ", - "Autoplay next video: ": "Lire automatiquement la vidéo suivante : ", + "Play next by default: ": "Lire les vidéos suivantes par défaut (similaire a YouTube) : ", + "Autoplay next video: ": "Lire automatiquement la vidéo en file d'attente : ", "Listen by default: ": "Audio uniquement : ", - "Proxy videos: ": "Charger les vidéos à travers un proxy ? ", + "Proxy videos: ": "Charger les vidéos à travers un proxy : ", "Default speed: ": "Vitesse par défaut : ", "Preferred video quality: ": "Qualité vidéo souhaitée : ", "Player volume: ": "Volume du lecteur : ", @@ -64,16 +64,16 @@ "youtube": "YouTube", "reddit": "Reddit", "Default captions: ": "Sous-titres par défaut : ", - "Fallback captions: ": "Sous-titres de repli : ", - "Show related videos: ": "Voir les vidéos liées ? ", - "Show annotations by default: ": "Voir les annotations par défaut ? ", + "Fallback captions: ": "Fallback captions: ", + "Show related videos: ": "Voir les vidéos liées : ", + "Show annotations by default: ": "Voir les annotations par défaut : ", "Visual preferences": "Préférences du site", "Dark mode: ": "Mode Sombre : ", "Thin mode: ": "Mode Simplifié : ", "Subscription preferences": "Préférences de la page d'abonnements", - "Show annotations by default for subscribed channels: ": "Voir les annotations par défaut sur les chaînes suivies ? ", + "Show annotations by default for subscribed channels: ": "Voir les annotations par défaut sur les chaînes suivies : ", "Redirect homepage to feed: ": "Rediriger la page d'accueil vers la page d'abonnements : ", - "Number of videos shown in feed: ": "Nombre de vidéos montrées dans la page d'abonnements : ", + "Number of videos shown in feed: ": "Nombre de vidéos affichées dans la page d'abonnements : ", "Sort videos by: ": "Trier les vidéos par : ", "published": "date de publication", "published - reverse": "date de publication - inversé", @@ -85,9 +85,9 @@ "Only show latest unwatched video from channel: ": "Afficher uniquement la dernière vidéo de la chaîne non regardée : ", "Only show unwatched: ": "Afficher uniquement les vidéos non regardées : ", "Only show notifications (if there are any): ": "Afficher uniquement les notifications (s'il y en a) : ", - "Enable web notifications": "", - "`x` uploaded a video": "", - "`x` is live": "", + "Enable web notifications": "Activer les notifications web", + "`x` uploaded a video": "`x` a partagé(e) une video", + "`x` is live": "`x` est en direct", "Data preferences": "Préférences liées aux données", "Clear watch history": "Supprimer l'historique des vidéos regardées", "Import/export data": "Importer/exporter les données", @@ -99,11 +99,11 @@ "Administrator preferences": "Préferences d'Administrateur", "Default homepage: ": "Page d'accueil par défaut : ", "Feed menu: ": "Menu des Flux : ", - "Top enabled: ": "Top activé ? ", - "CAPTCHA enabled: ": "CAPTCHA activé ? ", - "Login enabled: ": "Connexion activé ? ", - "Registration enabled: ": "Inscription activée ? ", - "Report statistics: ": "Télémétrie activé ? ", + "Top enabled: ": "Top activé : ", + "CAPTCHA enabled: ": "CAPTCHA activé : ", + "Login enabled: ": "Connexion activé : ", + "Registration enabled: ": "Inscription activée : ", + "Report statistics: ": "Télémétrie activé : ", "Save preferences": "Enregistrer les préférences", "Subscription manager": "Gestionnaire d'abonnement", "Token manager": "Gestionnaire de tokens", @@ -112,15 +112,15 @@ "`x` tokens": "`x` tokens", "Import/export": "Importer/Exporter", "unsubscribe": "se désabonner", - "revoke": "annuler", + "revoke": "révoquer", "Subscriptions": "Abonnements", "`x` unseen notifications": "`x` notifications non vues", - "search": "Rechercher", + "search": "rechercher", "Log out": "Déconnexion", "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.": "Voir la politique de confidentialité.", + "Source available here.": "Code Source disponible ici.", + "View JavaScript license information.": "Informations des licences JavaScript.", + "View privacy policy.": "Politique de confidentialité.", "Trending": "Tendances", "Unlisted": "Non répertoriée", "Watch on YouTube": "Voir la vidéo sur Youtube", @@ -130,13 +130,13 @@ "License: ": "Licence : ", "Family friendly? ": "Tout Public ? ", "Wilson score: ": "Score de Wilson : ", - "Engagement: ": "Poucentage de spectateur aillant aimé Like ou Dislike la vidéo : ", - "Whitelisted regions: ": "Régions en liste blanche : ", + "Engagement: ": "Poucentage de spectateur aillant Like ou Dislike la vidéo : ", + "Whitelisted regions: ": "Régions sur liste blanche : ", "Blacklisted regions: ": "Régions sur liste noire : ", "Shared `x`": "Ajoutée le `x`", "`x` views": "`x` vues", "Premieres in `x`": "Première dans `x`", - "Premieres `x`": "", + "Premieres `x`": "Première le `x`", "Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they 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", "View more comments on Reddit": "Voir plus de commentaires sur Reddit", @@ -170,16 +170,16 @@ "Load more": "Charger plus", "`x` points": "`x` points", "Could not create mix.": "Impossible de charger cette liste de lecture.", - "Empty playlist": "La liste de lecture est vide", + "Empty playlist": "Liste de lecture vide", "Not a playlist.": "Liste de lecture invalide.", "Playlist does not exist.": "La liste de lecture n'existe pas.", "Could not pull trending pages.": "Impossible de charger les pages de tendances.", "Hidden field \"challenge\" is a required field": "Hidden field \"challenge\" is a required field", - "Hidden field \"token\" is a required field": "Hidden field \"token\" is a required field", - "Erroneous challenge": "Erroneous challenge", - "Erroneous token": "Erroneous token", - "No such user": "No such user", - "Token is expired, please try again": "Token is expired, please try again", + "Hidden field \"token\" is a required field": "Le champ caché \"token\" est requis", + "Erroneous challenge": "Challenge Erroné", + "Erroneous token": "Token Erroné", + "No such user": "Cet utilisateur n'existe pas", + "Token is expired, please try again": "Le token est expiré, veuillez réessayer", "English": "Anglais", "English (auto-generated)": "Anglais (générés automatiquement)", "Afrikaans": "Afrikaans", @@ -309,13 +309,13 @@ "Download as: ": "Télécharger en : ", "%A %B %-d, %Y": "%A %-d %B %Y", "(edited)": "(modifié)", - "YouTube comment permalink": "Lien YouTube permanent vers le commentaire", + "YouTube comment permalink": "Lien permanent vers le commentaire sur YouTube", "permalink": "", "`x` marked it with a ❤": "`x` l'a marqué d'un ❤", "Audio mode": "Mode Audio", "Video mode": "Mode Vidéo", "Videos": "Vidéos", "Playlists": "Liste de lecture", - "Community": "", + "Community": "Communauté", "Current version: ": "Version actuelle : " -} \ No newline at end of file +} From 7528b7bc1a2d7d928ffc2474fa3d946d57f1d79a Mon Sep 17 00:00:00 2001 From: Brn9hrd7 <46742447+Brn9hrd7@users.noreply.github.com> Date: Wed, 31 Jul 2019 16:32:16 +0200 Subject: [PATCH 04/11] Update german translation (#650) --- locales/de.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/locales/de.json b/locales/de.json index 247eb502d..388630734 100644 --- a/locales/de.json +++ b/locales/de.json @@ -16,12 +16,12 @@ "Clear watch history?": "Verlauf löschen?", "New password": "Neues Passwort", "New passwords must match": "Neue Passwörter müssen übereinstimmen", - "Cannot change password for Google accounts": "Das Passwort für Google -Konten kann nicht geändert werden", + "Cannot change password for Google accounts": "Das Passwort für Google-Konten kann nicht geändert werden", "Authorize token?": "Token autorisieren?", "Authorize token for `x`?": "Token für `x` autorisieren?", "Yes": "Ja", "No": "Nein", - "Import and Export Data": "Import und Export Daten", + "Import and Export Data": "Daten importieren und exportieren", "Import": "Importieren", "Import Invidious data": "Invidious Daten importieren", "Import YouTube subscriptions": "YouTube Abonnements importieren", @@ -39,18 +39,18 @@ "source": "Quelle", "Log in": "Einloggen", "Log in/register": "Einloggen/Registrieren", - "Log in with Google": "In Google einloggen", + "Log in with Google": "Mit Google einloggen", "User ID": "Benutzer ID", "Password": "Passwort", "Time (h:mm:ss):": "Zeit (h:mm:ss):", "Text CAPTCHA": "Text CAPTCHA", - "Image CAPTCHA": "Image CAPTCHA", + "Image CAPTCHA": "Bild CAPTCHA", "Sign In": "Einloggen", "Register": "Registrieren", "E-mail": "Email", "Google verification code": "Google Bestätigungscode", "Preferences": "Einstellungen", - "Player preferences": "Playereinstellungen", + "Player preferences": "Wiedergabeeinstellungen", "Always loop: ": "Immer wiederholen: ", "Autoplay: ": "Automatisch abspielen: ", "Play next by default: ": "Standardmäßig als nächstes abspielen: ", @@ -59,7 +59,7 @@ "Proxy videos: ": "Proxy-Videos? ", "Default speed: ": "Standardgeschwindigkeit: ", "Preferred video quality: ": "Bevorzugte Videoqualität: ", - "Player volume: ": "Playerlautstärke: ", + "Player volume: ": "Wiedergabelautstärke: ", "Default comments: ": "Standardkommentare: ", "youtube": "youtube", "reddit": "reddit", @@ -90,7 +90,7 @@ "`x` is live": "`x` ist live", "Data preferences": "Dateneinstellungen", "Clear watch history": "Verlauf löschen", - "Import/export data": "Daten im- exportieren", + "Import/export data": "Daten im-/exportieren", "Change password": "Passwort ändern", "Manage subscriptions": "Abonnements verwalten", "Manage tokens": "Token verwalten", @@ -106,7 +106,7 @@ "Report statistics: ": "Statistiken berichten? ", "Save preferences": "Einstellungen speichern", "Subscription manager": "Abonnementverwaltung", - "Token manager": "Token-Manager", + "Token manager": "Token-Verwaltung", "Token": "Token", "`x` subscriptions": "`x` Abonnements", "`x` tokens": "`x` Tokens", @@ -177,9 +177,9 @@ "Hidden field \"challenge\" is a required field": "Verstecktes Feld \"challenge\" ist eine erforderliche Eingabe", "Hidden field \"token\" is a required field": "Verstecktes Feld \"token\" ist eine erforderliche Eingabe", "Erroneous challenge": "Ungültiger Test", - "Erroneous token": "Ungöltige Marke", + "Erroneous token": "Ungültiger Token", "No such user": "Ungültiger Benutzer", - "Token is expired, please try again": "Marke ist abgelaufen, bitte erneut versuchen", + "Token is expired, please try again": "Token ist abgelaufen, bitte erneut versuchen", "English": "Englisch", "English (auto-generated)": "Englisch (automatisch erzeugt)", "Afrikaans": "Afrikaans", @@ -310,12 +310,12 @@ "%A %B %-d, %Y": "%A %B %-d, %Y", "(edited)": "(editiert)", "YouTube comment permalink": "YouTube-Kommentar Permalink", - "permalink": "", + "permalink": "Permalink", "`x` marked it with a ❤": "`x` markierte es mit einem ❤", "Audio mode": "Audiomodus", "Video mode": "Videomodus", "Videos": "Videos", "Playlists": "Wiedergabelisten", - "Community": "", + "Community": "Community", "Current version: ": "Aktuelle Version: " -} \ No newline at end of file +} From 2458db03de08e5f0324e706e18cd8654495c0029 Mon Sep 17 00:00:00 2001 From: recette-lemon <854qskawygnrtcdo@protonmail.com> Date: Fri, 19 Jul 2019 09:47:46 +0000 Subject: [PATCH 05/11] Update Icelandic translation --- locales/is.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/locales/is.json b/locales/is.json index faf7e07bb..43ba26e9c 100644 --- a/locales/is.json +++ b/locales/is.json @@ -9,7 +9,7 @@ "View playlist on YouTube": "Skoða spilunarlisti á YouTube", "newest": "nýjasta", "oldest": "elsta", - "popular": "vinsællt", + "popular": "vinsælt", "last": "síðast", "Next page": "Næsta síða", "Previous page": "Fyrri síða", @@ -59,7 +59,7 @@ "Proxy videos: ": "Proxy myndbönd? ", "Default speed: ": "Sjálfgefinn hraði: ", "Preferred video quality: ": "Æskilegt myndbands gæði: ", - "Player volume: ": "Spilara bindi: ", + "Player volume: ": "Spilara hljóðstyrkur: ", "Default comments: ": "Sjálfgefin ummæli: ", "youtube": "youtube", "reddit": "reddit", @@ -166,14 +166,14 @@ "Could not get channel info.": "Ekki tókst að fá rásarupplýsingar.", "Could not fetch comments": "Ekki tókst að sækja ummæli", "View `x` replies.": "Skoða `x` svör.", - "`x` ago": "' x ' síðan", + "`x` ago": "`x` síðan", "Load more": "Hlaða meira", "`x` points.": "`x` stig.", "Could not create mix.": "Ekki tókst að búa til blöndu.", "Empty playlist": "Tómur spilunarlisti", "Not a playlist.": "Ekki spilunarlisti.", "Playlist does not exist.": "Spilunarlisti er ekki til.", - "Could not pull trending pages.": "Ekki tókst að draga vinsællar síður.", + "Could not pull trending pages.": "Ekki tókst að draga vinsælar síður.", "Hidden field \"challenge\" is a required field": "Falinn reitur \"áskorun\" er nauðsynlegur reitur", "Hidden field \"token\" is a required field": "Falinn reitur \"tákn\" er nauðsynlegur reitur", "Erroneous challenge": "Röng áskorun", @@ -286,15 +286,15 @@ "Yiddish": "Jiddíska", "Yoruba": "Jórúba", "Zulu": "Zúlú", - "`x` years.": "' x ' ár.", - "`x` months.": "' x ' mánuði.", + "`x` years.": "`x` ár.", + "`x` months.": "`x` mánuði.", "`x` weeks.": "`x` vikur.", - "`x` days.": "' x ' dagar.", + "`x` days.": "`x` dagar.", "`x` hours.": "`x` klukkustundir.", "`x` minutes.": "`x` mínútur.", "`x` seconds.": "`x` sekúndur.", "Fallback comments: ": "Vara ummæli: ", - "Popular": "Vinsællt", + "Popular": "Vinsælt", "Top": "Topp", "About": "Um", "Rating: ": "Einkunn: ", @@ -316,4 +316,4 @@ "Videos": "Myndbönd", "Playlists": "Spilunarlistar", "Current version: ": "Núverandi útgáfa: " -} \ No newline at end of file +} From ec36c69984e79d3639a1fda35212a1ad01e05b0c Mon Sep 17 00:00:00 2001 From: mondstern Date: Wed, 24 Jul 2019 10:22:22 +0000 Subject: [PATCH 06/11] Update German translation --- locales/de.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locales/de.json b/locales/de.json index 388630734..33edb706c 100644 --- a/locales/de.json +++ b/locales/de.json @@ -136,7 +136,7 @@ "Shared `x`": "Geteilt `x`", "`x` views": "`x` Ansichten", "Premieres in `x`": "Premieren in `x`", - "Premieres `x`": "", + "Premieres `x`": "Erster Start `x`", "Hi! Looks like you have JavaScript turned off. Click here to view comments, keep in mind they 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", "View more comments on Reddit": "Mehr Kommentare auf Reddit anzeigen", @@ -318,4 +318,4 @@ "Playlists": "Wiedergabelisten", "Community": "Community", "Current version: ": "Aktuelle Version: " -} +} \ No newline at end of file From f99a7b2a8c8c480f175f15155e8616cdefb59300 Mon Sep 17 00:00:00 2001 From: leonklingele <5585491+leonklingele@users.noreply.github.com> Date: Wed, 31 Jul 2019 16:48:45 +0200 Subject: [PATCH 07/11] Fix engagement for zero-view videos (#654) Division by zero resulted in 'NaN'. Fixes https://github.com/omarroth/invidious/issues/653. --- src/invidious.cr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index 315363d75..c43af7291 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -521,7 +521,11 @@ get "/watch" do |env| end rating = video.info["avg_rating"].to_f64 - engagement = ((video.dislikes.to_f + video.likes.to_f)/video.views * 100) + if video.views > 0 + engagement = ((video.dislikes.to_f + video.likes.to_f)/video.views * 100) + else + engagement = 0 + end playability_status = video.player_response["playabilityStatus"]? if playability_status && playability_status["status"] == "LIVE_STREAM_OFFLINE" && !video.premiere_timestamp From dce5816b18e201a66419010a1b2e0e7e24a6f1db Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Wed, 31 Jul 2019 19:16:09 -0500 Subject: [PATCH 08/11] Fix image url extractor --- src/invidious.cr | 6 +++--- src/invidious/channels.cr | 3 ++- src/invidious/search.cr | 2 +- src/invidious/videos.cr | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index c43af7291..d64790028 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -3739,7 +3739,7 @@ get "/api/v1/channels/:ucid" do |env| qualities.each do |quality| json.object do - json.field "url", channel.author_thumbnail.gsub("=s100-", "=s#{quality}-") + json.field "url", channel.author_thumbnail.gsub(/=\d+/, "=s#{quality}") json.field "width", quality json.field "height", quality end @@ -3781,7 +3781,7 @@ get "/api/v1/channels/:ucid" do |env| qualities.each do |quality| json.object do - json.field "url", related_channel.author_thumbnail.gsub("=s48-", "=s#{quality}-") + json.field "url", related_channel.author_thumbnail.gsub(/=\d+/, "=s#{quality}") json.field "width", quality json.field "height", quality end @@ -4079,7 +4079,7 @@ get "/api/v1/playlists/:plid" do |env| qualities.each do |quality| json.object do - json.field "url", playlist.author_thumbnail.gsub("=s100-", "=s#{quality}-") + json.field "url", playlist.author_thumbnail.gsub(/=\d+/, "=s#{quality}") json.field "width", quality json.field "height", quality end diff --git a/src/invidious/channels.cr b/src/invidious/channels.cr index 988b39f44..792ed2882 100644 --- a/src/invidious/channels.cr +++ b/src/invidious/channels.cr @@ -804,12 +804,13 @@ def fetch_channel_community(ucid, continuation, locale, config, kemal_config, fo width = thumbnail["width"].as_i height = thumbnail["height"].as_i aspect_ratio = (width.to_f / height.to_f) + url = thumbnail["url"].as_s.gsub(/=w\d+-h\d+(-p)?(-nd)?(-df)?(-rwa)?/, "=s640") qualities = {320, 560, 640, 1280, 2000} qualities.each do |quality| json.object do - json.field "url", thumbnail["url"].as_s.gsub("=s640-", "=s#{quality}-") + json.field "url", url.gsub(/=s\d+/, "=s#{quality}") json.field "width", quality json.field "height", (quality / aspect_ratio).ceil.to_i end diff --git a/src/invidious/search.cr b/src/invidious/search.cr index 79bfd55aa..1d4805bf5 100644 --- a/src/invidious/search.cr +++ b/src/invidious/search.cr @@ -176,7 +176,7 @@ struct SearchChannel qualities.each do |quality| json.object do - json.field "url", self.author_thumbnail.gsub("=s176-", "=s#{quality}-") + json.field "url", self.author_thumbnail.gsub(/=\d+/, "=s#{quality}") json.field "width", quality json.field "height", quality end diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index ea02b9382..49ff04943 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -319,7 +319,7 @@ struct Video qualities.each do |quality| json.object do - json.field "url", self.author_thumbnail.gsub("=s48-", "=s#{quality}-") + json.field "url", self.author_thumbnail.gsub(/=s\d+/, "=s#{quality}") json.field "width", quality json.field "height", quality end From f71d5c429d4e3abc4e6a7eaf461fd46587316121 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Wed, 31 Jul 2019 19:29:16 -0500 Subject: [PATCH 09/11] Add description to channel pages --- src/invidious/views/channel.ecr | 4 ++++ src/invidious/views/community.ecr | 4 ++++ src/invidious/views/playlists.ecr | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/invidious/views/channel.ecr b/src/invidious/views/channel.ecr index 624dbe9c1..9e7ec88c7 100644 --- a/src/invidious/views/channel.ecr +++ b/src/invidious/views/channel.ecr @@ -27,6 +27,10 @@ +
+

<%= XML.parse_html(channel.description_html).xpath_node(%q(.//pre)).try &.content %>

+
+
<% ucid = channel.ucid %> <% author = channel.author %> diff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecr index 705d06a81..732ae9bd0 100644 --- a/src/invidious/views/community.ecr +++ b/src/invidious/views/community.ecr @@ -26,6 +26,10 @@
+
+

<%= XML.parse_html(channel.description_html).xpath_node(%q(.//pre)).try &.content %>

+
+
<% ucid = channel.ucid %> <% author = channel.author %> diff --git a/src/invidious/views/playlists.ecr b/src/invidious/views/playlists.ecr index 1825bb485..216f44758 100644 --- a/src/invidious/views/playlists.ecr +++ b/src/invidious/views/playlists.ecr @@ -26,6 +26,10 @@
+
+

<%= XML.parse_html(channel.description_html).xpath_node(%q(.//pre)).try &.content %>

+
+
<% ucid = channel.ucid %> <% author = channel.author %> From fe2cffb25b43adc7d846c3d9a32154a661b945e0 Mon Sep 17 00:00:00 2001 From: Leon Klingele Date: Thu, 1 Aug 2019 09:35:57 +0200 Subject: [PATCH 10/11] Fix jumpy page on search field focus --- assets/css/default.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/css/default.css b/assets/css/default.css index 3d27f26bc..c527cbcab 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -159,6 +159,8 @@ img.thumbnail { } .navbar > .searchbar .pure-form input[type="search"] { + margin-bottom: 1px; + border-top: 0; border-left: 0; border-right: 0; @@ -169,7 +171,6 @@ img.thumbnail { box-shadow: none; - transition: 0.1s border-bottom; -webkit-appearance: none; } @@ -188,6 +189,7 @@ input[type="search"]::-webkit-search-cancel-button { /* attract focus to the searchbar by adding a subtle transition */ .navbar > .searchbar .pure-form input[type="search"]:focus { + margin-bottom: 0px; border-bottom: 2px solid #aaa; } From c41beae99a1b522de0d1dd2bda3e38ffd294d2c7 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Thu, 1 Aug 2019 07:49:33 -0500 Subject: [PATCH 11/11] Add fix for channels with empty descriptions --- src/invidious/channels.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/invidious/channels.cr b/src/invidious/channels.cr index 792ed2882..5e01cef27 100644 --- a/src/invidious/channels.cr +++ b/src/invidious/channels.cr @@ -958,7 +958,8 @@ def get_about_info(ucid, locale) banner = nil end - description_html = about.xpath_node(%q(//div[contains(@class,"about-description")])).try &.to_s || "" + description_html = about.xpath_node(%q(//div[contains(@class,"about-description")])).try &.to_s || + %(
) paid = about.xpath_node(%q(//meta[@itemprop="paid"])).not_nil!["content"] == "True" is_family_friendly = about.xpath_node(%q(//meta[@itemprop="isFamilyFriendly"])).not_nil!["content"] == "True"