Compare commits

...

8 Commits

Author SHA1 Message Date
shiny-comic
5cfe294063
Fix 0 view count on related videos section (#5446)
* Fix 0 view count on related videos

* Remove view_count variable since it's unused by Innertube

* Remove view_count from specs and API

---------

Co-authored-by: Fijxu <fijxu@nadeko.net>
2025-10-16 21:59:34 -03:00
Fijxu
0c13c4fab1
Prevent timestamp from being set for Livestreams on "Watch on Youtube" links (#5481) 2025-10-16 17:32:01 -03:00
Fijxu
fdf0a25b9e
Add Livestreams to trending page (#5480) 2025-10-16 17:31:48 -03:00
Fijxu
3226e17953
Fix button overflow (#5452) 2025-10-16 17:31:33 -03:00
dependabot[bot]
710b3f250b Bump crystal-lang/install-crystal from 1.8.2 to 1.8.3
Bumps [crystal-lang/install-crystal](https://github.com/crystal-lang/install-crystal) from 1.8.2 to 1.8.3.
- [Release notes](https://github.com/crystal-lang/install-crystal/releases)
- [Commits](https://github.com/crystal-lang/install-crystal/compare/v1.8.2...v1.8.3)

---
updated-dependencies:
- dependency-name: crystal-lang/install-crystal
  dependency-version: 1.8.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-30 19:56:16 +02:00
Alex
42d34cd084 Removed specific section from hyperlink in config.cr 2025-09-24 18:54:27 +02:00
Alex
18a8490587 Fixed broken companion hyperlink 2025-09-24 18:54:27 +02:00
syeopite
325e013e0d
Prepare for the next release 2025-09-13 11:55:10 -07:00
13 changed files with 30 additions and 31 deletions

View File

@ -58,7 +58,7 @@ jobs:
shell: bash
- name: Install Crystal
uses: crystal-lang/install-crystal@v1.8.2
uses: crystal-lang/install-crystal@v1.8.3
with:
crystal: ${{ matrix.crystal }}
@ -134,7 +134,7 @@ jobs:
- name: Install Crystal
id: lint_step_install_crystal
uses: crystal-lang/install-crystal@v1.8.2
uses: crystal-lang/install-crystal@v1.8.3
with:
crystal: latest

View File

@ -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;

View File

@ -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

View File

@ -408,6 +408,7 @@
"Default": "Default",
"Music": "Music",
"Gaming": "Gaming",
"Livestreams": "Livestreams",
"News": "News",
"Movies": "Movies",
"Download": "Download",

View File

@ -1,5 +1,5 @@
name: invidious
version: 2.20250913.0
version: 2.20250913.0-dev
authors:
- Invidious team <contact@invidious.io>

View File

@ -52,7 +52,6 @@ Spectator.describe "parse_video_info" do
expect(info["relatedVideos"][0]["title"]).to eq("$1 vs $250,000,000 Private Island!")
expect(info["relatedVideos"][0]["author"]).to eq("MrBeast")
expect(info["relatedVideos"][0]["ucid"]).to eq("UCX6OQ3DkcsbYNE6H8uQQuVA")
expect(info["relatedVideos"][0]["view_count"]).to eq("230617484")
expect(info["relatedVideos"][0]["short_view_count"]).to eq("230M")
expect(info["relatedVideos"][0]["author_verified"]).to eq("true")
@ -138,7 +137,6 @@ Spectator.describe "parse_video_info" do
expect(info["relatedVideos"][0]["title"]).to eq("Chris Rea - The Road To Hell 1989 Full Version")
expect(info["relatedVideos"][0]["author"]).to eq("NEA ZIXNH")
expect(info["relatedVideos"][0]["ucid"]).to eq("UCYMEOGcvav3gCgImK2J07CQ")
expect(info["relatedVideos"][0]["view_count"]).to eq("53298661")
expect(info["relatedVideos"][0]["short_view_count"]).to eq("53M")
expect(info["relatedVideos"][0]["author_verified"]).to eq("false")

View File

@ -75,7 +75,6 @@ Spectator.describe "parse_video_info" do
expect(info["relatedVideos"][0]["id"]).to eq("j7jPzzjbVuk")
expect(info["relatedVideos"][0]["author"]).to eq("Democracy Now!")
expect(info["relatedVideos"][0]["ucid"]).to eq("UCzuqE7-t13O4NIDYJfakrhw")
expect(info["relatedVideos"][0]["view_count"]).to eq("7576")
expect(info["relatedVideos"][0]["short_view_count"]).to eq("7.5K")
expect(info["relatedVideos"][0]["author_verified"]).to eq("true")

View File

@ -285,9 +285,9 @@ class Config
end
end
elsif config.signature_server
puts("WARNING: inv-sig-helper is deprecated. Please switch to Invidious companion: https://docs.invidious.io/companion-installation/")
puts("WARNING: inv-sig-helper is deprecated. Please switch to Invidious companion: https://docs.invidious.io/installation/")
else
puts("WARNING: Invidious companion is required to view and playback videos. For more information see https://docs.invidious.io/companion-installation/")
puts("WARNING: Invidious companion is required to view and playback videos. For more information see https://docs.invidious.io/installation/")
end
# HMAC_key is mandatory

View File

@ -266,7 +266,6 @@ module Invidious::JSONify::APIv1
json.field "lengthSeconds", rv["length_seconds"]?.try &.to_i
json.field "viewCountText", rv["short_view_count"]?
json.field "viewCount", rv["view_count"]?.try &.empty? ? nil : rv["view_count"].to_i64
json.field "published", rv["published"]?
if rv["published"]?.try &.presence
json.field "publishedText", translate(locale, "`x` ago", recode_date(Time.parse_rfc3339(rv["published"].to_s), locale))

View File

@ -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)

View File

@ -25,11 +25,6 @@ def parse_related_video(related : JSON::Any) : Hash(String, JSON::Any)?
ucid = channel_info.try { |ci| HelperExtractors.get_browse_id(ci) }
# "4,088,033 views", only available on compact renderer
# and when video is not a livestream
view_count = related.dig?("viewCountText", "simpleText")
.try &.as_s.gsub(/\D/, "")
short_view_count = related.try do |r|
HelperExtractors.get_short_view_count(r).to_s
end
@ -51,7 +46,6 @@ def parse_related_video(related : JSON::Any) : Hash(String, JSON::Any)?
"author" => author || JSON::Any.new(""),
"ucid" => JSON::Any.new(ucid || ""),
"length_seconds" => JSON::Any.new(length || "0"),
"view_count" => JSON::Any.new(view_count || "0"),
"short_view_count" => JSON::Any.new(short_view_count || "0"),
"author_verified" => JSON::Any.new(author_verified),
"published" => JSON::Any.new(published || ""),

View File

@ -21,7 +21,7 @@
</div>
<div class="pure-u-1-3">
<div class="pure-g" style="text-align:right">
<% {"Default", "Music", "Gaming", "Movies"}.each do |option| %>
<% {"Default", "Music", "Gaming", "Movies", "Livestreams"}.each do |option| %>
<div class="pure-u-1 pure-md-1-3">
<% if trending_type == option %>
<b><%= translate(locale, option) %></b>

View File

@ -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
%>
</script>
@ -354,9 +355,8 @@ we're going to need to do it here in order to allow for translations.
<div class="pure-u-10-24" style="text-align:right">
<b class="width:100%"><%=
views = rv["view_count"]?.try &.to_i?
views ||= rv["view_count_short"]?.try { |x| short_text_to_number(x) }
translate_count(locale, "generic_views_count", views || 0, NumberFormatting::Short)
views = short_text_to_number(rv["short_view_count"]? || "0")
translate_count(locale, "generic_views_count", views, NumberFormatting::Short)
%></b>
</div>
</h5>