From 3226e17953637858b216639047d284058f56d20f Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 16 Oct 2025 17:31:33 -0300 Subject: [PATCH 1/3] Fix button overflow (#5452) --- assets/css/default.css | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/css/default.css b/assets/css/default.css index 01d4b736..644d91c2 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -167,6 +167,7 @@ body a.pure-button-primary, .pure-button-primary, .pure-button-secondary { + white-space: normal; border: 1px solid #a0a0a0; border-radius: 3px; margin: 0 .4em; From fdf0a25b9e356538310f4103850574e8cbb5c226 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 16 Oct 2025 17:31:48 -0300 Subject: [PATCH 2/3] Add Livestreams to trending page (#5480) --- locales/en-US.json | 1 + src/invidious/trending.cr | 7 ++++++- src/invidious/views/feeds/trending.ecr | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/locales/en-US.json b/locales/en-US.json index fa28e7f8..6fd1ab0b 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -408,6 +408,7 @@ "Default": "Default", "Music": "Music", "Gaming": "Gaming", + "Livestreams": "Livestreams", "News": "News", "Movies": "Movies", "Download": "Download", diff --git a/src/invidious/trending.cr b/src/invidious/trending.cr index d14cde5d..e289ed5b 100644 --- a/src/invidious/trending.cr +++ b/src/invidious/trending.cr @@ -4,6 +4,8 @@ def fetch_trending(trending_type, region, locale) plid = nil + browse_id = "FEtrending" + case trending_type.try &.downcase when "music" params = "4gINGgt5dG1hX2NoYXJ0cw%3D%3D" @@ -11,12 +13,15 @@ def fetch_trending(trending_type, region, locale) params = "4gIcGhpnYW1pbmdfY29ycHVzX21vc3RfcG9wdWxhcg%3D%3D" when "movies" params = "4gIKGgh0cmFpbGVycw%3D%3D" + when "livestreams" + browse_id = "UC4R8DWoMoI7CAwX8_LjQHig" + params = "EgdsaXZldGFikgEDCKEK" else # Default params = "" end client_config = YoutubeAPI::ClientConfig.new(region: region) - initial_data = YoutubeAPI.browse("FEtrending", params: params, client_config: client_config) + initial_data = YoutubeAPI.browse(browse_id, params: params, client_config: client_config) items, _ = extract_items(initial_data) diff --git a/src/invidious/views/feeds/trending.ecr b/src/invidious/views/feeds/trending.ecr index 7dc416c6..69483f30 100644 --- a/src/invidious/views/feeds/trending.ecr +++ b/src/invidious/views/feeds/trending.ecr @@ -21,7 +21,7 @@
- <% {"Default", "Music", "Gaming", "Movies"}.each do |option| %> + <% {"Default", "Music", "Gaming", "Movies", "Livestreams"}.each do |option| %>
<% if trending_type == option %> <%= translate(locale, option) %> From 0c13c4fab182a352a47ac9b63f73050e78ba25d6 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Thu, 16 Oct 2025 17:32:01 -0300 Subject: [PATCH 3/3] Prevent timestamp from being set for Livestreams on "Watch on Youtube" links (#5481) --- assets/js/player.js | 22 ++++++++++++---------- src/invidious/views/watch.ecr | 3 ++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/assets/js/player.js b/assets/js/player.js index 10870915..ecdc0448 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -137,16 +137,18 @@ player.on('timeupdate', function () { // YouTube links - let elem_yt_watch = document.getElementById('link-yt-watch'); - if (elem_yt_watch) { - let base_url_yt_watch = elem_yt_watch.getAttribute('data-base-url'); - elem_yt_watch.href = addCurrentTimeToURL(base_url_yt_watch); - } - - let elem_yt_embed = document.getElementById('link-yt-embed'); - if (elem_yt_embed) { - let base_url_yt_embed = elem_yt_embed.getAttribute('data-base-url'); - elem_yt_embed.href = addCurrentTimeToURL(base_url_yt_embed); + if (!video_data.live_now) { + let elem_yt_watch = document.getElementById('link-yt-watch'); + if (elem_yt_watch) { + let base_url_yt_watch = elem_yt_watch.getAttribute('data-base-url'); + elem_yt_watch.href = addCurrentTimeToURL(base_url_yt_watch); + } + + let elem_yt_embed = document.getElementById('link-yt-embed'); + if (elem_yt_embed) { + let base_url_yt_embed = elem_yt_embed.getAttribute('data-base-url'); + elem_yt_embed.href = addCurrentTimeToURL(base_url_yt_embed); + } } // Invidious links diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index fada6361..59b9a167 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -65,7 +65,8 @@ we're going to need to do it here in order to allow for translations. "vr" => video.vr?, "projection_type" => video.projection_type, "local_disabled" => CONFIG.disabled?("local"), - "support_reddit" => true + "support_reddit" => true, + "live_now" => video.live_now }.to_pretty_json %>