Compare commits

...

3 commits

Author SHA1 Message Date
b95a8bfbd3
Update CI
All checks were successful
Invidious CI / build (push) Successful in 5m10s
2024-11-05 00:36:24 -03:00
4849286814
Videos: Add support for OpenGraph videos
All checks were successful
Invidious CI / build (push) Successful in 5m18s
To support OpenGraph clients like Discord and other platforms able to
pull the video from the OpenGraph metadata.
2024-11-04 23:49:45 -03:00
Brahim Hadriche
e3da8f408d
[Alternative] Fix for channel live videos
All checks were successful
Invidious CI / build (push) Successful in 6m30s
Signed-off-by: Fijxu <fijxu@nadeko.net>

refactor

Signed-off-by: Fijxu <fijxu@nadeko.net>
2024-11-01 13:56:32 -03:00
5 changed files with 42 additions and 14 deletions

View file

@ -37,13 +37,15 @@ jobs:
type=sha,format=short,prefix={{date 'YYYY.MM.DD'}}-,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} type=sha,format=short,prefix={{date 'YYYY.MM.DD'}}-,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
- uses: https://code.forgejo.org/docker/build-push-action@v5 - uses: https://code.forgejo.org/docker/build-push-action@v6
name: Build images name: Build images
with: with:
context: . context: .
file: docker/Dockerfile file: docker/Dockerfile
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64 platforms: linux/amd64
# cache-from: type=gha
# cache-to: type=gha,mode=max
push: true push: true
build-args: | build-args: |
"release=1" "release=1"

View file

@ -1,4 +1,4 @@
FROM crystallang/crystal:1.12.1-alpine AS builder FROM crystallang/crystal:1.14.0-alpine AS builder
RUN apk add --no-cache sqlite-static yaml-static RUN apk add --no-cache sqlite-static yaml-static

View file

@ -23,14 +23,31 @@ def produce_channel_content_continuation(ucid, content_type, page = 1, auto_gene
else 15 # Fallback to "videos" else 15 # Fallback to "videos"
end end
sort_by_numerical = sort_type_numerical =
case sort_by case content_type
when "newest" then 1_i64 when "videos" then 3
when "popular" then 2_i64 when "livestreams" then 5
when "oldest" then 4_i64 else 3 # Fallback to "videos"
else 1_i64 # Fallback to "newest"
end end
if content_type == "livestreams"
sort_by_numerical =
case sort_by
when "newest" then 12_i64
when "popular" then 14_i64
when "oldest" then 13_i64
else 12_i64 # Fallback to "newest"
end
else
sort_by_numerical =
case sort_by
when "newest" then 1_i64
when "popular" then 2_i64
when "oldest" then 4_i64
else 1_i64 # Fallback to "newest"
end
end
object_inner_1 = { object_inner_1 = {
"110:embedded" => { "110:embedded" => {
"3:embedded" => { "3:embedded" => {
@ -41,7 +58,7 @@ def produce_channel_content_continuation(ucid, content_type, page = 1, auto_gene
"2:embedded" => { "2:embedded" => {
"1:string" => "00000000-0000-0000-0000-000000000000", "1:string" => "00000000-0000-0000-0000-000000000000",
}, },
"3:varint" => sort_by_numerical, "#{sort_type_numerical}:varint" => sort_by_numerical,
}, },
}, },
}, },

View file

@ -152,6 +152,7 @@ module Invidious::Routes::Watch
end end
end end
# Removes non default audio tracks
audio_streams.reject! do |z| audio_streams.reject! do |z|
z if z.dig?("audioTrack", "audioIsDefault") == false z if z.dig?("audioTrack", "audioIsDefault") == false
end end
@ -218,6 +219,12 @@ module Invidious::Routes::Watch
captions: video.captions captions: video.captions
) )
begin
video_url = fmt_stream[0]["url"].to_s
rescue
video_url = nil
end
templated "watch" templated "watch"
end end

View file

@ -13,11 +13,13 @@
<meta property="og:image" content="<%= HOST_URL %>/vi/<%= video.id %>/maxres.jpg"> <meta property="og:image" content="<%= HOST_URL %>/vi/<%= video.id %>/maxres.jpg">
<meta property="og:description" content="<%= HTML.escape(video.short_description) %>"> <meta property="og:description" content="<%= HTML.escape(video.short_description) %>">
<meta property="og:type" content="video.other"> <meta property="og:type" content="video.other">
<meta property="og:video:url" content="<%= HOST_URL %>/embed/<%= video.id %>"> <!-- This shouldn't be empty, ever. -->
<meta property="og:video:secure_url" content="<%= HOST_URL %>/embed/<%= video.id %>"> <meta property="og:video" content="<%= video_url %>">
<meta property="og:video:type" content="text/html"> <meta property="og:video:url" content="<%= video_url %>">
<meta property="og:video:width" content="1280"> <meta property="og:video:secure_url" content="<%= video_url %>">
<meta property="og:video:height" content="720"> <meta property="og:video:type" content="video/mp4">
<meta property="og:video:width" content="640">
<meta property="og:video:height" content="360">
<meta name="twitter:card" content="player"> <meta name="twitter:card" content="player">
<meta name="twitter:url" content="<%= HOST_URL %>/watch?v=<%= video.id %>"> <meta name="twitter:url" content="<%= HOST_URL %>/watch?v=<%= video.id %>">
<meta name="twitter:title" content="<%= title %>"> <meta name="twitter:title" content="<%= title %>">