From f298e225a114578e0551e04d5e68f2bfcbe84e72 Mon Sep 17 00:00:00 2001 From: chunky programmer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Mon, 24 Apr 2023 19:29:34 -0400 Subject: [PATCH 01/13] fix live video attachments, parse playlists --- src/invidious/channels/community.cr | 68 ++++++--------------- src/invidious/helpers/serialized_yt_data.cr | 1 + src/invidious/yt_backend/extractors.cr | 2 +- 3 files changed, 22 insertions(+), 49 deletions(-) diff --git a/src/invidious/channels/community.cr b/src/invidious/channels/community.cr index ad786f3a..87430305 100644 --- a/src/invidious/channels/community.cr +++ b/src/invidious/channels/community.cr @@ -123,49 +123,13 @@ def fetch_channel_community(ucid, continuation, locale, format, thin_mode) if attachment = post["backstageAttachment"]? json.field "attachment" do - json.object do - case attachment.as_h - when .has_key?("videoRenderer") - attachment = attachment["videoRenderer"] - json.field "type", "video" - - if !attachment["videoId"]? - error_message = (attachment["title"]["simpleText"]? || - attachment["title"]["runs"]?.try &.[0]?.try &.["text"]?) - - json.field "error", error_message - else - video_id = attachment["videoId"].as_s - - video_title = attachment["title"]["simpleText"]? || attachment["title"]["runs"]?.try &.[0]?.try &.["text"]? - json.field "title", video_title - json.field "videoId", video_id - json.field "videoThumbnails" do - Invidious::JSONify::APIv1.thumbnails(json, video_id) - end - - json.field "lengthSeconds", decode_length_seconds(attachment["lengthText"]["simpleText"].as_s) - - author_info = attachment["ownerText"]["runs"][0].as_h - - json.field "author", author_info["text"].as_s - json.field "authorId", author_info["navigationEndpoint"]["browseEndpoint"]["browseId"] - json.field "authorUrl", author_info["navigationEndpoint"]["commandMetadata"]["webCommandMetadata"]["url"] - - # TODO: json.field "authorThumbnails", "channelThumbnailSupportedRenderers" - # TODO: json.field "authorVerified", "ownerBadges" - - published = decode_date(attachment["publishedTimeText"]["simpleText"].as_s) - - json.field "published", published.to_unix - json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale)) - - view_count = attachment["viewCountText"]?.try &.["simpleText"].as_s.gsub(/\D/, "").to_i64? || 0_i64 - - json.field "viewCount", view_count - json.field "viewCountText", translate_count(locale, "generic_views_count", view_count, NumberFormatting::Short) - end - when .has_key?("backstageImageRenderer") + case attachment.as_h + when .has_key?("videoRenderer") + parse_item(attachment) + .as(SearchVideo) + .to_json(locale, json) + when .has_key?("backstageImageRenderer") + json.object do attachment = attachment["backstageImageRenderer"] json.field "type", "image" @@ -186,7 +150,9 @@ def fetch_channel_community(ucid, continuation, locale, format, thin_mode) end end end - when .has_key?("pollRenderer") + end + when .has_key?("pollRenderer") + json.object do attachment = attachment["pollRenderer"] json.field "type", "poll" json.field "totalVotes", short_text_to_number(attachment["totalVotes"]["simpleText"].as_s.split(" ")[0]) @@ -219,7 +185,9 @@ def fetch_channel_community(ucid, continuation, locale, format, thin_mode) end end end - when .has_key?("postMultiImageRenderer") + end + when .has_key?("postMultiImageRenderer") + json.object do attachment = attachment["postMultiImageRenderer"] json.field "type", "multiImage" json.field "images" do @@ -243,10 +211,14 @@ def fetch_channel_community(ucid, continuation, locale, format, thin_mode) end end end - else - json.field "type", "unknown" - json.field "error", "Unrecognized attachment type." end + when .has_key?("playlistRenderer") + parse_item(attachment) + .as(SearchPlaylist) + .to_json(locale, json) + else + json.field "type", "unknown" + json.field "error", "Unrecognized attachment type." end end end diff --git a/src/invidious/helpers/serialized_yt_data.cr b/src/invidious/helpers/serialized_yt_data.cr index c1874780..7c12ad0e 100644 --- a/src/invidious/helpers/serialized_yt_data.cr +++ b/src/invidious/helpers/serialized_yt_data.cr @@ -84,6 +84,7 @@ struct SearchVideo json.field "descriptionHtml", self.description_html json.field "viewCount", self.views + json.field "viewCountText", translate_count(locale, "generic_views_count", self.views, NumberFormatting::Short) json.field "published", self.published.to_unix json.field "publishedText", translate(locale, "`x` ago", recode_date(self.published, locale)) json.field "lengthSeconds", self.length_seconds diff --git a/src/invidious/yt_backend/extractors.cr b/src/invidious/yt_backend/extractors.cr index 9c041361..8ff4c1f9 100644 --- a/src/invidious/yt_backend/extractors.cr +++ b/src/invidious/yt_backend/extractors.cr @@ -268,7 +268,7 @@ private module Parsers end private def self.parse(item_contents, author_fallback) - title = item_contents["title"]["simpleText"]?.try &.as_s || "" + title = extract_text(item_contents["title"]) || "" plid = item_contents["playlistId"]?.try &.as_s || "" video_count = HelperExtractors.get_video_count(item_contents) From 2d5145614be46c0b59a87c26cecac0c4b69e3437 Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Tue, 2 May 2023 21:10:57 -0400 Subject: [PATCH 02/13] Fix unknown type attachment Co-authored-by: Samantaz Fox --- src/invidious/channels/community.cr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/invidious/channels/community.cr b/src/invidious/channels/community.cr index 87430305..2c7b9fec 100644 --- a/src/invidious/channels/community.cr +++ b/src/invidious/channels/community.cr @@ -217,8 +217,10 @@ def fetch_channel_community(ucid, continuation, locale, format, thin_mode) .as(SearchPlaylist) .to_json(locale, json) else - json.field "type", "unknown" - json.field "error", "Unrecognized attachment type." + json.object do + json.field "type", "unknown" + json.field "error", "Unrecognized attachment type." + end end end end From 7aac401407627fef167b2d0f5bb3dd2324de6a1c Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sat, 6 May 2023 19:23:55 +0200 Subject: [PATCH 03/13] CSS: limit width of the comments in community tab --- assets/css/default.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/assets/css/default.css b/assets/css/default.css index 42f6958f..4d06b77f 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -321,6 +321,16 @@ p.channel-name { margin: 0; } p.video-data { margin: 0; font-weight: bold; font-size: 80%; } +/* + * Comments & community posts + */ + +#comments { + max-width: 800px; + margin: auto; +} + + /* * Footer */ From ce2649420fb868596bd926393fb1073d2671a4f5 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sat, 6 May 2023 19:36:52 +0200 Subject: [PATCH 04/13] CSS: Fix iframe attachment size in community posts --- assets/css/default.css | 14 ++++++++++++++ src/invidious/comments.cr | 18 +++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/assets/css/default.css b/assets/css/default.css index 4d06b77f..23649f8f 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -330,6 +330,20 @@ p.video-data { margin: 0; font-weight: bold; font-size: 80%; } margin: auto; } +.video-iframe-wrapper { + position: relative; + height: 0; + padding-bottom: 56.25%; +} + +.video-iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border: none; +} /* * Footer diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index ec4449f0..f43e39c6 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -372,27 +372,19 @@ def template_youtube_comments(comments, locale, thin_mode, is_replies = false) END_HTML when "video" - html << <<-END_HTML -
-
-
- END_HTML - if attachment["error"]? html << <<-END_HTML +

#{attachment["error"]}

+
END_HTML else html << <<-END_HTML - +
+ +
END_HTML end - - html << <<-END_HTML -
-
-
- END_HTML else nil # Ignore end end From 720789b6221518fd1614debfcee794a422df9466 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sat, 6 May 2023 19:41:07 +0200 Subject: [PATCH 05/13] HTML: wrap comments metadata in a paragraph --- src/invidious/comments.cr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index f43e39c6..01556099 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -390,6 +390,7 @@ def template_youtube_comments(comments, locale, thin_mode, is_replies = false) end html << <<-END_HTML +

#{translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64), locale))} #{child["isEdited"] == true ? translate(locale, "(edited)") : ""} | END_HTML @@ -408,6 +409,7 @@ def template_youtube_comments(comments, locale, thin_mode, is_replies = false) html << <<-END_HTML #{number_with_separator(child["likeCount"])} +

END_HTML if child["creatorHeart"]? From 36f7c99cfb96dd743df237a09c390e11cedae420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milien=20Devos=20=28perso=29?= Date: Sun, 7 May 2023 17:49:43 +0200 Subject: [PATCH 06/13] Update config.example.yml Document save playback position in the config.example.yml --- config/config.example.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/config.example.yml b/config/config.example.yml index 8abe1b9e..7ea80017 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -817,6 +817,16 @@ default_user_preferences: ## Default: true ## #vr_mode: true + + ## + ## Save the playback position + ## Allow to continue watching at the previous position when + ## watching the same video. + ## + ## Accepted values: true, false + ## Default: false + ## + #save_player_pos: false # ----------------------------- # Subscription feed From f3d9db10a2be1c8ef3f9b919343dde6a6f36fcb0 Mon Sep 17 00:00:00 2001 From: Fjuro Date: Mon, 1 May 2023 12:59:27 +0000 Subject: [PATCH 07/13] Update Czech translation --- locales/cs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/cs.json b/locales/cs.json index 0e8610bf..d9e5b4d5 100644 --- a/locales/cs.json +++ b/locales/cs.json @@ -13,7 +13,7 @@ "Previous page": "Předchozí strana", "Clear watch history?": "Smazat historii?", "New password": "Nové heslo", - "New passwords must match": "Hesla se musí schodovat", + "New passwords must match": "Hesla se musí shodovat", "Cannot change password for Google accounts": "Nelze změnit heslo pro účty Google", "Authorize token?": "Autorizovat token?", "Authorize token for `x`?": "Autorizovat token pro `x`?", From cca8bcf2a85fe7c2e241cb26ec94ee51dd8f37e7 Mon Sep 17 00:00:00 2001 From: xrfmkrh Date: Mon, 1 May 2023 05:57:30 +0000 Subject: [PATCH 08/13] Update Korean translation --- locales/ko.json | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/locales/ko.json b/locales/ko.json index d4f3a711..2b454add 100644 --- a/locales/ko.json +++ b/locales/ko.json @@ -46,7 +46,7 @@ "Log in/register": "로그인/회원가입", "Log in": "로그인", "source": "출처", - "JavaScript license information": "자바스크립트 라이센스 정보", + "JavaScript license information": "자바스크립트 라이선스 정보", "An alternative front-end to YouTube": "유튜브의 프론트엔드 대안", "History": "역사", "Delete account?": "계정을 삭제 하시겠습니까?", @@ -116,7 +116,7 @@ "Show replies": "댓글 보기", "Hide replies": "댓글 숨기기", "Incorrect password": "잘못된 비밀번호", - "License: ": "라이센스: ", + "License: ": "라이선스: ", "Genre: ": "장르: ", "Editing playlist `x`": "재생목록 `x` 수정하기", "Playlist privacy": "재생목록 공개 범위", @@ -135,7 +135,7 @@ "Unlisted": "목록에 없음", "Public": "공개", "View privacy policy.": "개인정보 처리방침 보기.", - "View JavaScript license information.": "자바스크립트 라이센스 정보 보기.", + "View JavaScript license information.": "자바스크립트 라이선스 정보 보기.", "Source available here.": "소스는 여기에서 사용할 수 있습니다.", "Log out": "로그아웃", "search": "검색", @@ -460,5 +460,12 @@ "channel_tab_shorts_label": "쇼츠", "channel_tab_streams_label": "실시간 스트리밍", "channel_tab_channels_label": "채널", - "channel_tab_playlists_label": "재생목록" + "channel_tab_playlists_label": "재생목록", + "Standard YouTube license": "표준 유튜브 라이선스", + "Song: ": "제목: ", + "Channel Sponsor": "채널 스폰서", + "Album: ": "앨범: ", + "Music in this video": "동영상 속 음악", + "Artist: ": "아티스트: ", + "Download is disabled": "다운로드가 비활성화 되어있음" } From 56ebb477caff6189da5db40291d68c6e895fc2d8 Mon Sep 17 00:00:00 2001 From: gallegonovato Date: Wed, 3 May 2023 12:25:54 +0000 Subject: [PATCH 09/13] Update Spanish translation --- locales/es.json | 75 +++++++++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 30 deletions(-) diff --git a/locales/es.json b/locales/es.json index 09f510a7..63079d9e 100644 --- a/locales/es.json +++ b/locales/es.json @@ -398,37 +398,51 @@ "search_filters_features_option_three_sixty": "360°", "videoinfo_watch_on_youTube": "Ver en YouTube", "preferences_save_player_pos_label": "Guardar posición de reproducción: ", - "generic_views_count": "{{count}} visualización", - "generic_views_count_plural": "{{count}} visualizaciones", - "generic_subscribers_count": "{{count}} suscriptor", - "generic_subscribers_count_plural": "{{count}} suscriptores", - "generic_subscriptions_count": "{{count}} suscripción", - "generic_subscriptions_count_plural": "{{count}} suscripciones", - "subscriptions_unseen_notifs_count": "{{count}} notificación no vista", - "subscriptions_unseen_notifs_count_plural": "{{count}} notificaciones no vistas", - "generic_count_days": "{{count}} día", - "generic_count_days_plural": "{{count}} días", - "comments_view_x_replies": "Ver {{count}} respuesta", - "comments_view_x_replies_plural": "Ver {{count}} respuestas", - "generic_count_weeks": "{{count}} semana", - "generic_count_weeks_plural": "{{count}} semanas", - "generic_playlists_count": "{{count}} lista de reproducción", - "generic_playlists_count_plural": "{{count}} listas de reproducción", + "generic_views_count_0": "{{count}} vista", + "generic_views_count_1": "{{count}} vistas", + "generic_views_count_2": "{{count}} vistas", + "generic_subscribers_count_0": "{{count}} suscriptor", + "generic_subscribers_count_1": "{{count}} suscriptores", + "generic_subscribers_count_2": "{{count}} suscriptores", + "generic_subscriptions_count_0": "{{count}} suscripción", + "generic_subscriptions_count_1": "{{count}} suscripciones", + "generic_subscriptions_count_2": "{{count}} suscripciones", + "subscriptions_unseen_notifs_count_0": "{{count}} notificación sin ver", + "subscriptions_unseen_notifs_count_1": "{{count}} notificaciones sin ver", + "subscriptions_unseen_notifs_count_2": "{{count}} notificaciones sin ver", + "generic_count_days_0": "{{count}} día", + "generic_count_days_1": "{{count}} días", + "generic_count_days_2": "{{count}} días", + "comments_view_x_replies_0": "Ver {{count}} respuesta", + "comments_view_x_replies_1": "Ver {{count}} respuestas", + "comments_view_x_replies_2": "Ver {{count}} respuestas", + "generic_count_weeks_0": "{{count}} semana", + "generic_count_weeks_1": "{{count}} semanas", + "generic_count_weeks_2": "{{count}} semanas", + "generic_playlists_count_0": "{{count}} reproducción", + "generic_playlists_count_1": "{{count}} reproducciones", + "generic_playlists_count_2": "{{count}} reproducciones", "generic_videos_count_0": "{{count}} video", "generic_videos_count_1": "{{count}} videos", "generic_videos_count_2": "{{count}} videos", - "generic_count_months": "{{count}} mes", - "generic_count_months_plural": "{{count}} meses", - "comments_points_count": "{{count}} punto", - "comments_points_count_plural": "{{count}} puntos", - "generic_count_years": "{{count}} año", - "generic_count_years_plural": "{{count}} años", - "generic_count_hours": "{{count}} hora", - "generic_count_hours_plural": "{{count}} horas", - "generic_count_minutes": "{{count}} minuto", - "generic_count_minutes_plural": "{{count}} minutos", - "generic_count_seconds": "{{count}} segundo", - "generic_count_seconds_plural": "{{count}} segundos", + "generic_count_months_0": "{{count}} mes", + "generic_count_months_1": "{{count}} meses", + "generic_count_months_2": "{{count}} meses", + "comments_points_count_0": "{{count}} punto", + "comments_points_count_1": "{{count}} puntos", + "comments_points_count_2": "{{count}} puntos", + "generic_count_years_0": "{{count}} año", + "generic_count_years_1": "{{count}} años", + "generic_count_years_2": "{{count}} años", + "generic_count_hours_0": "{{count}} hora", + "generic_count_hours_1": "{{count}} horas", + "generic_count_hours_2": "{{count}} horas", + "generic_count_minutes_0": "{{count}} minuto", + "generic_count_minutes_1": "{{count}} minutos", + "generic_count_minutes_2": "{{count}} minutos", + "generic_count_seconds_0": "{{count}} segundo", + "generic_count_seconds_1": "{{count}} segundos", + "generic_count_seconds_2": "{{count}} segundos", "crash_page_before_reporting": "Antes de notificar un error asegúrate de que has:", "crash_page_switch_instance": "probado a usar otra instancia", "crash_page_read_the_faq": "leído las Preguntas Frecuentes", @@ -469,8 +483,9 @@ "search_filters_duration_option_none": "Cualquier duración", "search_filters_features_option_vr180": "VR180", "search_filters_apply_button": "Aplicar filtros", - "tokens_count": "{{count}} ficha", - "tokens_count_plural": "{{count}} fichas", + "tokens_count_0": "{{count}} token", + "tokens_count_1": "{{count}} tokens", + "tokens_count_2": "{{count}} tokens", "search_message_use_another_instance": " También puede buscar en otra instancia.", "Popular enabled: ": "¿Habilitar la sección popular? ", "error_video_not_in_playlist": "El video que solicitaste no existe en esta lista de reproducción. Haz clic aquí para acceder a la página de inicio de la lista de reproducción.", From ce1fb8d08c86f747ee638289c8bcfeb208702445 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Mon, 8 May 2023 00:53:08 +0200 Subject: [PATCH 10/13] Use XML.parse instead of XML.parse_html Due to recent changes to libxml2 (between 2.9.14 and 2.10.4, See https://gitlab.gnome.org/GNOME/libxml2/-/issues/508), the HTML parser doesn't take into account the namespaces (xmlns). Because HTML shouldn't contain namespaces anyway, there is no reason for use to keep using it. But switching to the XML parser means that we have to pass the namespaces to every single 'xpath_node(s)' method for it to be able to properly navigate the XML structure. --- src/invidious/channels/channels.cr | 36 +++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/invidious/channels/channels.cr b/src/invidious/channels/channels.cr index 63dd2194..b09d93b1 100644 --- a/src/invidious/channels/channels.cr +++ b/src/invidious/channels/channels.cr @@ -159,12 +159,18 @@ def fetch_channel(ucid, pull_all_videos : Bool) LOGGER.debug("fetch_channel: #{ucid}") LOGGER.trace("fetch_channel: #{ucid} : pull_all_videos = #{pull_all_videos}") + namespaces = { + "yt" => "http://www.youtube.com/xml/schemas/2015", + "media" => "http://search.yahoo.com/mrss/", + "default" => "http://www.w3.org/2005/Atom", + } + LOGGER.trace("fetch_channel: #{ucid} : Downloading RSS feed") rss = YT_POOL.client &.get("/feeds/videos.xml?channel_id=#{ucid}").body LOGGER.trace("fetch_channel: #{ucid} : Parsing RSS feed") - rss = XML.parse_html(rss) + rss = XML.parse(rss) - author = rss.xpath_node(%q(//feed/title)) + author = rss.xpath_node("//default:feed/default:title", namespaces) if !author raise InfoException.new("Deleted or invalid channel") end @@ -192,15 +198,23 @@ def fetch_channel(ucid, pull_all_videos : Bool) videos, continuation = IV::Channel::Tabs.get_videos(channel) LOGGER.trace("fetch_channel: #{ucid} : Extracting videos from channel RSS feed") - rss.xpath_nodes("//feed/entry").each do |entry| - video_id = entry.xpath_node("videoid").not_nil!.content - title = entry.xpath_node("title").not_nil!.content - published = Time.parse_rfc3339(entry.xpath_node("published").not_nil!.content) - updated = Time.parse_rfc3339(entry.xpath_node("updated").not_nil!.content) - author = entry.xpath_node("author/name").not_nil!.content - ucid = entry.xpath_node("channelid").not_nil!.content - views = entry.xpath_node("group/community/statistics").try &.["views"]?.try &.to_i64? - views ||= 0_i64 + rss.xpath_nodes("//default:feed/default:entry", namespaces).each do |entry| + video_id = entry.xpath_node("yt:videoid", namespaces).not_nil!.content + title = entry.xpath_node("default:title", namespaces).not_nil!.content + + published = Time.parse_rfc3339( + entry.xpath_node("default:published", namespaces).not_nil!.content + ) + updated = Time.parse_rfc3339( + entry.xpath_node("default:updated", namespaces).not_nil!.content + ) + + author = entry.xpath_node("default:author/default:name", namespaces).not_nil!.content + ucid = entry.xpath_node("yt:channelid", namespaces).not_nil!.content + + views = entry + .xpath_node("media:group/media:community/media:statistics", namespaces) + .try &.["views"]?.try &.to_i64? || 0_i64 channel_video = videos .select(SearchVideo) From c385a944e642ce9e060c2dcf2082ecf0bb10b45a Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Mon, 8 May 2023 13:10:18 +0200 Subject: [PATCH 11/13] Subscriptions: Fix casing of XML tag names --- src/invidious/channels/channels.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/invidious/channels/channels.cr b/src/invidious/channels/channels.cr index b09d93b1..c3d6124f 100644 --- a/src/invidious/channels/channels.cr +++ b/src/invidious/channels/channels.cr @@ -199,7 +199,7 @@ def fetch_channel(ucid, pull_all_videos : Bool) LOGGER.trace("fetch_channel: #{ucid} : Extracting videos from channel RSS feed") rss.xpath_nodes("//default:feed/default:entry", namespaces).each do |entry| - video_id = entry.xpath_node("yt:videoid", namespaces).not_nil!.content + video_id = entry.xpath_node("yt:videoId", namespaces).not_nil!.content title = entry.xpath_node("default:title", namespaces).not_nil!.content published = Time.parse_rfc3339( @@ -210,7 +210,7 @@ def fetch_channel(ucid, pull_all_videos : Bool) ) author = entry.xpath_node("default:author/default:name", namespaces).not_nil!.content - ucid = entry.xpath_node("yt:channelid", namespaces).not_nil!.content + ucid = entry.xpath_node("yt:channelId", namespaces).not_nil!.content views = entry .xpath_node("media:group/media:community/media:statistics", namespaces) From 544fc9f92e9f3a55e362282680542b6ecbebfdc3 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Mon, 8 May 2023 15:33:23 +0200 Subject: [PATCH 12/13] Fix broken Spanish locale (i18next v3->v4 mixup) --- locales/es.json | 80 ++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 48 deletions(-) diff --git a/locales/es.json b/locales/es.json index 63079d9e..68ff0170 100644 --- a/locales/es.json +++ b/locales/es.json @@ -398,51 +398,36 @@ "search_filters_features_option_three_sixty": "360°", "videoinfo_watch_on_youTube": "Ver en YouTube", "preferences_save_player_pos_label": "Guardar posición de reproducción: ", - "generic_views_count_0": "{{count}} vista", - "generic_views_count_1": "{{count}} vistas", - "generic_views_count_2": "{{count}} vistas", - "generic_subscribers_count_0": "{{count}} suscriptor", - "generic_subscribers_count_1": "{{count}} suscriptores", - "generic_subscribers_count_2": "{{count}} suscriptores", - "generic_subscriptions_count_0": "{{count}} suscripción", - "generic_subscriptions_count_1": "{{count}} suscripciones", - "generic_subscriptions_count_2": "{{count}} suscripciones", - "subscriptions_unseen_notifs_count_0": "{{count}} notificación sin ver", - "subscriptions_unseen_notifs_count_1": "{{count}} notificaciones sin ver", - "subscriptions_unseen_notifs_count_2": "{{count}} notificaciones sin ver", - "generic_count_days_0": "{{count}} día", - "generic_count_days_1": "{{count}} días", - "generic_count_days_2": "{{count}} días", - "comments_view_x_replies_0": "Ver {{count}} respuesta", - "comments_view_x_replies_1": "Ver {{count}} respuestas", - "comments_view_x_replies_2": "Ver {{count}} respuestas", - "generic_count_weeks_0": "{{count}} semana", - "generic_count_weeks_1": "{{count}} semanas", - "generic_count_weeks_2": "{{count}} semanas", - "generic_playlists_count_0": "{{count}} reproducción", - "generic_playlists_count_1": "{{count}} reproducciones", - "generic_playlists_count_2": "{{count}} reproducciones", - "generic_videos_count_0": "{{count}} video", - "generic_videos_count_1": "{{count}} videos", - "generic_videos_count_2": "{{count}} videos", - "generic_count_months_0": "{{count}} mes", - "generic_count_months_1": "{{count}} meses", - "generic_count_months_2": "{{count}} meses", - "comments_points_count_0": "{{count}} punto", - "comments_points_count_1": "{{count}} puntos", - "comments_points_count_2": "{{count}} puntos", - "generic_count_years_0": "{{count}} año", - "generic_count_years_1": "{{count}} años", - "generic_count_years_2": "{{count}} años", - "generic_count_hours_0": "{{count}} hora", - "generic_count_hours_1": "{{count}} horas", - "generic_count_hours_2": "{{count}} horas", - "generic_count_minutes_0": "{{count}} minuto", - "generic_count_minutes_1": "{{count}} minutos", - "generic_count_minutes_2": "{{count}} minutos", - "generic_count_seconds_0": "{{count}} segundo", - "generic_count_seconds_1": "{{count}} segundos", - "generic_count_seconds_2": "{{count}} segundos", + "generic_views_count": "{{count}} vista", + "generic_views_count_plural": "{{count}} vistas", + "generic_subscribers_count": "{{count}} suscriptor", + "generic_subscribers_count_plural": "{{count}} suscriptores", + "generic_subscriptions_count": "{{count}} suscripción", + "generic_subscriptions_count_plural": "{{count}} suscripciones", + "subscriptions_unseen_notifs_count": "{{count}} notificación sin ver", + "subscriptions_unseen_notifs_count_plural": "{{count}} notificaciones sin ver", + "generic_count_days": "{{count}} día", + "generic_count_days_plural": "{{count}} días", + "comments_view_x_replies": "Ver {{count}} respuesta", + "comments_view_x_replies_plural": "Ver {{count}} respuestas", + "generic_count_weeks": "{{count}} semana", + "generic_count_weeks_plural": "{{count}} semanas", + "generic_playlists_count": "{{count}} reproducción", + "generic_playlists_count_plural": "{{count}} reproducciones", + "generic_videos_count": "{{count}} video", + "generic_videos_count_plural": "{{count}} videos", + "generic_count_months": "{{count}} mes", + "generic_count_months_plural": "{{count}} meses", + "comments_points_count": "{{count}} punto", + "comments_points_count_plural": "{{count}} puntos", + "generic_count_years": "{{count}} año", + "generic_count_years_plural": "{{count}} años", + "generic_count_hours": "{{count}} hora", + "generic_count_hours_plural": "{{count}} horas", + "generic_count_minutes": "{{count}} minuto", + "generic_count_minutes_plural": "{{count}} minutos", + "generic_count_seconds": "{{count}} segundo", + "generic_count_seconds_plural": "{{count}} segundos", "crash_page_before_reporting": "Antes de notificar un error asegúrate de que has:", "crash_page_switch_instance": "probado a usar otra instancia", "crash_page_read_the_faq": "leído las Preguntas Frecuentes", @@ -483,9 +468,8 @@ "search_filters_duration_option_none": "Cualquier duración", "search_filters_features_option_vr180": "VR180", "search_filters_apply_button": "Aplicar filtros", - "tokens_count_0": "{{count}} token", - "tokens_count_1": "{{count}} tokens", - "tokens_count_2": "{{count}} tokens", + "tokens_count": "{{count}} token", + "tokens_count_plural": "{{count}} tokens", "search_message_use_another_instance": " También puede buscar en otra instancia.", "Popular enabled: ": "¿Habilitar la sección popular? ", "error_video_not_in_playlist": "El video que solicitaste no existe en esta lista de reproducción. Haz clic aquí para acceder a la página de inicio de la lista de reproducción.", From 6755e31b726fa857e75ede988af216a52eab8cc7 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sun, 14 May 2023 20:10:56 +0200 Subject: [PATCH 13/13] Fix hashtag continuation token --- src/invidious/hashtag.cr | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/invidious/hashtag.cr b/src/invidious/hashtag.cr index bc329205..d9d584c9 100644 --- a/src/invidious/hashtag.cr +++ b/src/invidious/hashtag.cr @@ -17,21 +17,18 @@ module Invidious::Hashtag "80226972:embedded" => { "2:string" => "FEhashtag", "3:base64" => { - "1:varint" => cursor.to_i64, - }, - "7:base64" => { - "325477796:embedded" => { - "1:embedded" => { - "2:0:embedded" => { - "2:string" => '#' + hashtag, - "4:varint" => 0_i64, - "11:string" => "", - }, - "4:string" => "browse-feedFEhashtag", - }, - "2:string" => hashtag, + "1:varint" => 60_i64, # result count + "15:base64" => { + "1:varint" => cursor.to_i64, + "2:varint" => 0_i64, + }, + "93:2:embedded" => { + "1:string" => hashtag, + "2:varint" => 0_i64, + "3:varint" => 1_i64, }, }, + "35:string" => "browse-feedFEhashtag", }, }