From 2a092577c69d41c06f8f094348c2dd88fc6b1a17 Mon Sep 17 00:00:00 2001 From: Ming Kin Choi Date: Sun, 27 Aug 2023 12:50:36 +0800 Subject: [PATCH 01/21] Fix iOS screen timeout on video playback loop mode --- assets/js/player.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/assets/js/player.js b/assets/js/player.js index bb53ac24d..0c37033dc 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -701,6 +701,21 @@ if (navigator.vendor === 'Apple Computer, Inc.' && video_data.params.listen) { }); } +// Safari screen timeout on looped video playback fix +if (navigator.vendor === 'Apple Computer, Inc.' && !video_data.params.listen && video_data.params.video_loop) { + player.loop(false); + player.on('loadedmetadata', function () { + player.on('timeupdate', function () { + if (player.remainingTime() < 2) { + player.loop(true); + setTimeout(() => { + player.loop(false); + }, 2000 / player.playbackRate()); + } + }); + }); +} + // Watch on Invidious link if (location.pathname.startsWith('/embed/')) { const Button = videojs.getComponent('Button'); From 27d8fa112dad0b531d4e3f24045975a1869ab2ff Mon Sep 17 00:00:00 2001 From: Ming Kin Choi Date: Sun, 27 Aug 2023 14:11:45 +0800 Subject: [PATCH 02/21] Fix iOS screen timeout on video playback loop mode (more elegantly) --- assets/js/player.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/assets/js/player.js b/assets/js/player.js index 0c37033dc..5d88d0692 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -704,14 +704,10 @@ if (navigator.vendor === 'Apple Computer, Inc.' && video_data.params.listen) { // Safari screen timeout on looped video playback fix if (navigator.vendor === 'Apple Computer, Inc.' && !video_data.params.listen && video_data.params.video_loop) { player.loop(false); - player.on('loadedmetadata', function () { - player.on('timeupdate', function () { - if (player.remainingTime() < 2) { - player.loop(true); - setTimeout(() => { - player.loop(false); - }, 2000 / player.playbackRate()); - } + player.ready(function () { + player.on('ended', function () { + player.currentTime(0); + player.play(); }); }); } From 07de1e236f9225ccbebbccedb76036a340837430 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sun, 22 Oct 2023 17:09:52 +0200 Subject: [PATCH 03/21] Videos: Append '&mpd_version=5' to DASH manifest URL This makes Youtube return a MPD manifest with templates rather than lengthy . The returned manifest is about 44 times smaller. --- src/invidious/videos.cr | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 9fbd13745..a8f020562 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -227,8 +227,22 @@ struct Video info.dig?("streamingData", "hlsManifestUrl").try &.as_s end - def dash_manifest_url - info.dig?("streamingData", "dashManifestUrl").try &.as_s + def dash_manifest_url : String? + raw_dash_url = info.dig?("streamingData", "dashManifestUrl").try &.as_s + return nil if raw_dash_url.nil? + + # Use manifest v5 parameter to reduce file size + # See https://github.com/iv-org/invidious/issues/4186 + dash_url = URI.parse(raw_dash_url) + dash_query = dash_url.query || "" + + if dash_query.empty? + dash_url.path = "#{dash_url.path}/mpd_version/5" + else + dash_url.query = "#{dash_query}&mpd_version=5" + end + + return dash_url.to_s end def genre_url : String? From fead0e14acd8d38e52614e89bf89f22a3e2935ea Mon Sep 17 00:00:00 2001 From: syeopite <70992037+syeopite@users.noreply.github.com> Date: Tue, 7 Nov 2023 23:45:01 +0000 Subject: [PATCH 04/21] Drop support for Crystal 1.6.2 --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ca0dc96a..36ec409e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,6 @@ jobs: matrix: stable: [true] crystal: - - 1.6.2 - 1.7.3 - 1.8.2 - 1.9.2 From 2562f80695e2391551cd83e42250c31ad0e1357a Mon Sep 17 00:00:00 2001 From: syeopite <70992037+syeopite@users.noreply.github.com> Date: Tue, 7 Nov 2023 23:46:20 +0000 Subject: [PATCH 05/21] Add CI for Crystal 1.10.1 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36ec409e4..7bdda9c33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,7 @@ jobs: - 1.7.3 - 1.8.2 - 1.9.2 + - 1.10.1 include: - crystal: nightly stable: false From 85257585836b7062e3d6d0ddd29fb3d5f6570b49 Mon Sep 17 00:00:00 2001 From: syeopite Date: Wed, 8 Nov 2023 00:19:24 -0800 Subject: [PATCH 06/21] Use #splat method for macro expressions --- src/invidious/helpers/errors.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index 6e5a975d3..a94a1991e 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -3,7 +3,7 @@ # ------------------- macro error_template(*args) - error_template_helper(env, {{*args}}) + error_template_helper(env, {{args.splat}}) end def github_details(summary : String, content : String) From 8ce91166d66ff93a0ef791fcc7f53f7ae94f8271 Mon Sep 17 00:00:00 2001 From: syeopite Date: Wed, 8 Nov 2023 00:42:46 -0800 Subject: [PATCH 07/21] Remove instance of the * operator in macro expr --- src/invidious/helpers/errors.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index a94a1991e..708500636 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -121,7 +121,7 @@ end # ------------------- macro error_json(*args) - error_json_helper(env, {{*args}}) + error_json_helper(env, {{args.splat}}) end def error_json_helper( From ed8b84ed15616cd269ff5759fcc1fa5150259db8 Mon Sep 17 00:00:00 2001 From: syeopite Date: Wed, 8 Nov 2023 00:49:37 -0800 Subject: [PATCH 08/21] Replace more * in macro with #splat --- src/invidious/channels/channels.cr | 2 +- src/invidious/config.cr | 2 +- src/invidious/helpers/errors.cr | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/invidious/channels/channels.cr b/src/invidious/channels/channels.cr index c3d6124ff..be739673f 100644 --- a/src/invidious/channels/channels.cr +++ b/src/invidious/channels/channels.cr @@ -93,7 +93,7 @@ struct ChannelVideo def to_tuple {% begin %} { - {{*@type.instance_vars.map(&.name)}} + {{@type.instance_vars.map(&.name).splat}} } {% end %} end diff --git a/src/invidious/config.cr b/src/invidious/config.cr index 429d92464..d5d5f2f20 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -48,7 +48,7 @@ struct ConfigPreferences def to_tuple {% begin %} { - {{*@type.instance_vars.map { |var| "#{var.name}: #{var.name}".id }}} + {{(@type.instance_vars.map { |var| "#{var.name}: #{var.name}".id }).splat}} } {% end %} end diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index 708500636..21b789bc5 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -95,7 +95,7 @@ end # ------------------- macro error_atom(*args) - error_atom_helper(env, {{*args}}) + error_atom_helper(env, {{args.splat}}) end def error_atom_helper(env : HTTP::Server::Context, status_code : Int32, exception : Exception) From 86ee7617887469739fda1dc242442fea93af3187 Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Wed, 15 Nov 2023 00:51:43 -0500 Subject: [PATCH 09/21] Fix logic for setting user agent --- src/invidious/yt_backend/connection_pool.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/yt_backend/connection_pool.cr b/src/invidious/yt_backend/connection_pool.cr index 03ff0ee4d..fbf058035 100644 --- a/src/invidious/yt_backend/connection_pool.cr +++ b/src/invidious/yt_backend/connection_pool.cr @@ -1,6 +1,6 @@ def add_yt_headers(request) if request.headers["User-Agent"] == "Crystal" - request.headers["User-Agent"] ||= "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" + request.headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" end request.headers["Accept-Charset"] ||= "ISO-8859-1,utf-8;q=0.7,*;q=0.7" From 8338a73e7bc0585edd36bb7fcd4589e741ce0bab Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Fri, 17 Nov 2023 07:48:34 -0500 Subject: [PATCH 10/21] add user_agent if empty or crystal --- src/invidious/yt_backend/connection_pool.cr | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/invidious/yt_backend/connection_pool.cr b/src/invidious/yt_backend/connection_pool.cr index fbf058035..36e82766d 100644 --- a/src/invidious/yt_backend/connection_pool.cr +++ b/src/invidious/yt_backend/connection_pool.cr @@ -1,7 +1,6 @@ def add_yt_headers(request) - if request.headers["User-Agent"] == "Crystal" - request.headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" - end + request.headers.delete("User-Agent") if request.headers["User-Agent"] == "Crystal" + request.headers["User-Agent"] ||= "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" request.headers["Accept-Charset"] ||= "ISO-8859-1,utf-8;q=0.7,*;q=0.7" request.headers["Accept"] ||= "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" From d9416a0be587ba3ceaa39e0a37e70ed669f7a6ae Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Mon, 20 Nov 2023 17:39:13 +0100 Subject: [PATCH 11/21] Jobs: Remove BypassCaptchaJob --- src/invidious/jobs/bypass_captcha_job.cr | 135 ----------------------- 1 file changed, 135 deletions(-) delete mode 100644 src/invidious/jobs/bypass_captcha_job.cr diff --git a/src/invidious/jobs/bypass_captcha_job.cr b/src/invidious/jobs/bypass_captcha_job.cr deleted file mode 100644 index 71f8a938c..000000000 --- a/src/invidious/jobs/bypass_captcha_job.cr +++ /dev/null @@ -1,135 +0,0 @@ -class Invidious::Jobs::BypassCaptchaJob < Invidious::Jobs::BaseJob - def begin - loop do - begin - random_video = PG_DB.query_one?("select id, ucid from (select id, ucid from channel_videos limit 1000) as s ORDER BY RANDOM() LIMIT 1", as: {id: String, ucid: String}) - if !random_video - random_video = {id: "zj82_v2R6ts", ucid: "UCK87Lox575O_HCHBWaBSyGA"} - end - {"/watch?v=#{random_video["id"]}&gl=US&hl=en&has_verified=1&bpctr=9999999999", produce_channel_videos_url(ucid: random_video["ucid"])}.each do |path| - response = YT_POOL.client &.get(path) - if response.body.includes?("To continue with your YouTube experience, please fill out the form below.") - html = XML.parse_html(response.body) - form = html.xpath_node(%(//form[@action="/das_captcha"])).not_nil! - site_key = form.xpath_node(%(.//div[@id="recaptcha"])).try &.["data-sitekey"] - s_value = form.xpath_node(%(.//div[@id="recaptcha"])).try &.["data-s"] - - inputs = {} of String => String - form.xpath_nodes(%(.//input[@name])).map do |node| - inputs[node["name"]] = node["value"] - end - - headers = response.cookies.add_request_headers(HTTP::Headers.new) - - response = JSON.parse(HTTP::Client.post(CONFIG.captcha_api_url + "/createTask", - headers: HTTP::Headers{"Content-Type" => "application/json"}, body: { - "clientKey" => CONFIG.captcha_key, - "task" => { - "type" => "NoCaptchaTaskProxyless", - "websiteURL" => "https://www.youtube.com#{path}", - "websiteKey" => site_key, - "recaptchaDataSValue" => s_value, - }, - }.to_json).body) - - raise response["error"].as_s if response["error"]? - task_id = response["taskId"].as_i - - loop do - sleep 10.seconds - - response = JSON.parse(HTTP::Client.post(CONFIG.captcha_api_url + "/getTaskResult", - headers: HTTP::Headers{"Content-Type" => "application/json"}, body: { - "clientKey" => CONFIG.captcha_key, - "taskId" => task_id, - }.to_json).body) - - if response["status"]?.try &.== "ready" - break - elsif response["errorId"]?.try &.as_i != 0 - raise response["errorDescription"].as_s - end - end - - inputs["g-recaptcha-response"] = response["solution"]["gRecaptchaResponse"].as_s - headers["Cookies"] = response["solution"]["cookies"].as_h?.try &.map { |k, v| "#{k}=#{v}" }.join("; ") || "" - response = YT_POOL.client &.post("/das_captcha", headers, form: inputs) - - response.cookies - .select { |cookie| cookie.name != "PREF" } - .each { |cookie| CONFIG.cookies << cookie } - - # Persist cookies between runs - File.write("config/config.yml", CONFIG.to_yaml) - elsif response.headers["Location"]?.try &.includes?("/sorry/index") - location = response.headers["Location"].try { |u| URI.parse(u) } - headers = HTTP::Headers{":authority" => location.host.not_nil!} - response = YT_POOL.client &.get(location.request_target, headers) - - html = XML.parse_html(response.body) - form = html.xpath_node(%(//form[@action="index"])).not_nil! - site_key = form.xpath_node(%(.//div[@id="recaptcha"])).try &.["data-sitekey"] - s_value = form.xpath_node(%(.//div[@id="recaptcha"])).try &.["data-s"] - - inputs = {} of String => String - form.xpath_nodes(%(.//input[@name])).map do |node| - inputs[node["name"]] = node["value"] - end - - captcha_client = HTTPClient.new(URI.parse(CONFIG.captcha_api_url)) - captcha_client.family = CONFIG.force_resolve || Socket::Family::INET - response = JSON.parse(captcha_client.post("/createTask", - headers: HTTP::Headers{"Content-Type" => "application/json"}, body: { - "clientKey" => CONFIG.captcha_key, - "task" => { - "type" => "NoCaptchaTaskProxyless", - "websiteURL" => location.to_s, - "websiteKey" => site_key, - "recaptchaDataSValue" => s_value, - }, - }.to_json).body) - - captcha_client.close - - raise response["error"].as_s if response["error"]? - task_id = response["taskId"].as_i - - loop do - sleep 10.seconds - - response = JSON.parse(captcha_client.post("/getTaskResult", - headers: HTTP::Headers{"Content-Type" => "application/json"}, body: { - "clientKey" => CONFIG.captcha_key, - "taskId" => task_id, - }.to_json).body) - - if response["status"]?.try &.== "ready" - break - elsif response["errorId"]?.try &.as_i != 0 - raise response["errorDescription"].as_s - end - end - - inputs["g-recaptcha-response"] = response["solution"]["gRecaptchaResponse"].as_s - headers["Cookies"] = response["solution"]["cookies"].as_h?.try &.map { |k, v| "#{k}=#{v}" }.join("; ") || "" - response = YT_POOL.client &.post("/sorry/index", headers: headers, form: inputs) - headers = HTTP::Headers{ - "Cookie" => URI.parse(response.headers["location"]).query_params["google_abuse"].split(";")[0], - } - cookies = HTTP::Cookies.from_client_headers(headers) - - cookies.each { |cookie| CONFIG.cookies << cookie } - - # Persist cookies between runs - File.write("config/config.yml", CONFIG.to_yaml) - end - end - rescue ex - LOGGER.error("BypassCaptchaJob: #{ex.message}") - ensure - sleep 1.minute - Fiber.yield - end - end - end -end From 7e363fa3c854c0cc9b7f7815bd1da973cb86e2e1 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Mon, 20 Nov 2023 17:39:51 +0100 Subject: [PATCH 12/21] Config: Remove anti-captcha related configs --- config/config.example.yml | 21 --------------------- src/invidious/config.cr | 4 ---- 2 files changed, 25 deletions(-) diff --git a/config/config.example.yml b/config/config.example.yml index b44fcc0e0..38085a20b 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -392,27 +392,6 @@ jobs: enable: true -# ----------------------------- -# Captcha API -# ----------------------------- - -## -## URL of the captcha solving service. -## -## Accepted values: any URL -## Default: https://api.anti-captcha.com -## -#captcha_api_url: https://api.anti-captcha.com - -## -## API key for the captcha solving service. -## -## Accepted values: a string -## Default: -## -#captcha_key: - - # ----------------------------- # Miscellaneous # ----------------------------- diff --git a/src/invidious/config.cr b/src/invidious/config.cr index 429d92464..13e532226 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -133,10 +133,6 @@ class Config # Saved cookies in "name1=value1; name2=value2..." format @[YAML::Field(converter: Preferences::StringToCookies)] property cookies : HTTP::Cookies = HTTP::Cookies.new - # Key for Anti-Captcha - property captcha_key : String? = nil - # API URL for Anti-Captcha - property captcha_api_url : String = "https://api.anti-captcha.com" # Playlist length limit property playlist_length_limit : Int32 = 500 From 3a5d40860239829de6575644235f01d6af35a4b0 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Mon, 20 Nov 2023 17:40:31 +0100 Subject: [PATCH 13/21] Remove leftover functions/specs used by the anti-captcha job --- spec/invidious/helpers_spec.cr | 12 ------------ src/invidious/channels/videos.cr | 6 ------ 2 files changed, 18 deletions(-) diff --git a/spec/invidious/helpers_spec.cr b/spec/invidious/helpers_spec.cr index 142e1653d..9fbb6d6fe 100644 --- a/spec/invidious/helpers_spec.cr +++ b/spec/invidious/helpers_spec.cr @@ -3,18 +3,6 @@ require "../spec_helper" CONFIG = Config.from_yaml(File.open("config/config.example.yml")) Spectator.describe "Helper" do - describe "#produce_channel_videos_url" do - it "correctly produces url for requesting page `x` of a channel's videos" do - # expect(produce_channel_videos_url(ucid: "UCXuqSBlHAE6Xw-yeJA0Tunw")).to eq("/browse_ajax?continuation=4qmFsgI8EhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncaIEVnWjJhV1JsYjNNd0FqZ0JZQUZxQUxnQkFDQUFlZ0V4&gl=US&hl=en") - # - # expect(produce_channel_videos_url(ucid: "UCXuqSBlHAE6Xw-yeJA0Tunw", sort_by: "popular")).to eq("/browse_ajax?continuation=4qmFsgJAEhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncaJEVnWjJhV1JsYjNNd0FqZ0JZQUZxQUxnQkFDQUFlZ0V4R0FFPQ%3D%3D&gl=US&hl=en") - - # expect(produce_channel_videos_url(ucid: "UCXuqSBlHAE6Xw-yeJA0Tunw", page: 20)).to eq("/browse_ajax?continuation=4qmFsgJAEhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncaJEVnWjJhV1JsYjNNd0FqZ0JZQUZxQUxnQkFDQUFlZ0l5TUE9PQ%3D%3D&gl=US&hl=en") - - # expect(produce_channel_videos_url(ucid: "UC-9-kyTW8ZkZNDHQJ6FgpwQ", page: 20, sort_by: "popular")).to eq("/browse_ajax?continuation=4qmFsgJAEhhVQy05LWt5VFc4WmtaTkRIUUo2Rmdwd1EaJEVnWjJhV1JsYjNNd0FqZ0JZQUZxQUxnQkFDQUFlZ0l5TUJnQg%3D%3D&gl=US&hl=en") - end - end - describe "#produce_channel_search_continuation" do it "correctly produces token for searching a specific channel" do expect(produce_channel_search_continuation("UCXuqSBlHAE6Xw-yeJA0Tunw", "", 100)).to eq("4qmFsgJqEhhVQ1h1cVNCbEhBRTZYdy15ZUpBMFR1bncaIEVnWnpaV0Z5WTJnd0FUZ0JZQUY2QkVkS2IxaTRBUUE9WgCaAilicm93c2UtZmVlZFVDWHVxU0JsSEFFNlh3LXllSkEwVHVud3NlYXJjaA%3D%3D") diff --git a/src/invidious/channels/videos.cr b/src/invidious/channels/videos.cr index beb86e088..351790d7e 100644 --- a/src/invidious/channels/videos.cr +++ b/src/invidious/channels/videos.cr @@ -62,12 +62,6 @@ def produce_channel_videos_continuation(ucid, page = 1, auto_generated = nil, so return continuation end -# Used in bypass_captcha_job.cr -def produce_channel_videos_url(ucid, page = 1, auto_generated = nil, sort_by = "newest", v2 = false) - continuation = produce_channel_videos_continuation(ucid, page, auto_generated, sort_by, v2) - return "/browse_ajax?continuation=#{continuation}&gl=US&hl=en" -end - module Invidious::Channel::Tabs extend self From 9ce9c543992243737516750bf08f5d073e899715 Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Tue, 21 Nov 2023 20:47:07 +0100 Subject: [PATCH 14/21] Install rsvg-convert on docker images (#4230) (#4282) In #4103 alpine was updated from 3.16 to 3.18, but in 3.17 librsvg packages was splitted and rsvg-convert is on his own package. --- docker/Dockerfile | 2 +- docker/Dockerfile.arm64 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index c9644ca65..ace096bfe 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -33,7 +33,7 @@ RUN if [[ "${release}" == 1 ]] ; then \ fi FROM alpine:3.18 -RUN apk add --no-cache librsvg ttf-opensans tini +RUN apk add --no-cache rsvg-convert ttf-opensans tini WORKDIR /invidious RUN addgroup -g 1000 -S invidious && \ adduser -u 1000 -S invidious -G invidious diff --git a/docker/Dockerfile.arm64 b/docker/Dockerfile.arm64 index d9a4eeaff..602f3ab2b 100644 --- a/docker/Dockerfile.arm64 +++ b/docker/Dockerfile.arm64 @@ -33,7 +33,7 @@ RUN if [[ "${release}" == 1 ]] ; then \ fi FROM alpine:3.18 -RUN apk add --no-cache librsvg ttf-opensans tini +RUN apk add --no-cache rsvg-convert ttf-opensans tini WORKDIR /invidious RUN addgroup -g 1000 -S invidious && \ adduser -u 1000 -S invidious -G invidious From eb27e097edb6b1ee567b82979f20b917ddc8e937 Mon Sep 17 00:00:00 2001 From: maboroshin <41102508+maboroshin@users.noreply.github.com> Date: Sun, 4 Jun 2023 16:33:30 +0900 Subject: [PATCH 15/21] README: Improve "Projects using Invidious" section --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6a314c16f..192fe8525 100644 --- a/README.md +++ b/README.md @@ -145,17 +145,17 @@ Weblate also allows you to log-in with major SSO providers like Github, Gitlab, ## Projects using Invidious -- [FreeTube](https://github.com/FreeTubeApp/FreeTube): A libre software YouTube app for privacy. -- [CloudTube](https://sr.ht/~cadence/tube/): A JavaScript-rich alternate YouTube player. -- [PeerTubeify](https://gitlab.com/Cha_de_L/peertubeify): On YouTube, displays a link to the same video on PeerTube, if it exists. -- [MusicPiped](https://github.com/deep-gaurav/MusicPiped): A material design music player that streams music from YouTube. -- [HoloPlay](https://github.com/stephane-r/holoplay-pwa): Progressive Web App connecting on Invidious API's with search, playlists and favorites. -- [WatchTube](https://github.com/WatchTubeTeam/WatchTube): Powerful YouTube client for Apple Watch. +- [FreeTube](https://github.com/FreeTubeApp/FreeTube): A libre software YouTube app for privacy. For desktop. +- [Clipious](https://github.com/lamarios/clipious): Unofficial Invidious client for Android. - [Yattee](https://github.com/yattee/yattee): Alternative YouTube frontend for iPhone, iPad, Mac and Apple TV. -- [TubiTui](https://codeberg.org/777/TubiTui): A lightweight, libre, TUI-based YouTube client. +- [CloudTube](https://sr.ht/~cadence/tube/): A JavaScript-rich alternate online YouTube player. +- [HoloPlay](https://github.com/stephane-r/holoplay-pwa): Progressive Web App for music connecting on Invidious API's with search, playlists and favorites. +- [WatchTube](https://github.com/WatchTubeTeam/): Powerful YouTube client for Apple Watch. +- [TubiTui](https://codeberg.org/777/TubiTui): A lightweight, libre, TUI-based YouTube client. For desktop. - [Ytfzf](https://github.com/pystardust/ytfzf): A posix script to find and watch youtube videos from the terminal. (Without API). - [Playlet](https://github.com/iBicha/playlet): Unofficial Youtube client for Roku TV. -- [Clipious](https://github.com/lamarios/clipious): Unofficial Invidious client for Android. +- [MusicPiped](https://github.com/deep-gaurav/MusicPiped): A material design music player that streams music from YouTube for Android. + ## Liability From d5df81f0f84ee8b1967f1177dac0a63be1a439a6 Mon Sep 17 00:00:00 2001 From: maboroshin <41102508+maboroshin@users.noreply.github.com> Date: Tue, 18 Jul 2023 18:27:00 +0900 Subject: [PATCH 16/21] Update README.md Add GTK+ Pipe Viewer, PlasmaTube --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 192fe8525..f3bdbdd96 100644 --- a/README.md +++ b/README.md @@ -150,11 +150,13 @@ Weblate also allows you to log-in with major SSO providers like Github, Gitlab, - [Yattee](https://github.com/yattee/yattee): Alternative YouTube frontend for iPhone, iPad, Mac and Apple TV. - [CloudTube](https://sr.ht/~cadence/tube/): A JavaScript-rich alternate online YouTube player. - [HoloPlay](https://github.com/stephane-r/holoplay-pwa): Progressive Web App for music connecting on Invidious API's with search, playlists and favorites. +- [GTK+ Pipe Viewer](https://github.com/trizen/pipe-viewer): YouTube client for Linux. +- [PlasmaTube](https://apps.kde.org/plasmatube/): YouTube client for Linux. - [WatchTube](https://github.com/WatchTubeTeam/): Powerful YouTube client for Apple Watch. - [TubiTui](https://codeberg.org/777/TubiTui): A lightweight, libre, TUI-based YouTube client. For desktop. - [Ytfzf](https://github.com/pystardust/ytfzf): A posix script to find and watch youtube videos from the terminal. (Without API). - [Playlet](https://github.com/iBicha/playlet): Unofficial Youtube client for Roku TV. -- [MusicPiped](https://github.com/deep-gaurav/MusicPiped): A material design music player that streams music from YouTube for Android. +- [MusicPiped](https://github.com/deep-gaurav/MusicPiped): A material design music player that streams music from YouTube for Android. From 67571b24928c191289e03b1d03aac7d48f289a3e Mon Sep 17 00:00:00 2001 From: syeopite Date: Tue, 21 Nov 2023 12:49:47 -0800 Subject: [PATCH 17/21] Replace projects using invidious with doc link --- README.md | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f3bdbdd96..ec879548f 100644 --- a/README.md +++ b/README.md @@ -145,20 +145,9 @@ Weblate also allows you to log-in with major SSO providers like Github, Gitlab, ## Projects using Invidious -- [FreeTube](https://github.com/FreeTubeApp/FreeTube): A libre software YouTube app for privacy. For desktop. -- [Clipious](https://github.com/lamarios/clipious): Unofficial Invidious client for Android. -- [Yattee](https://github.com/yattee/yattee): Alternative YouTube frontend for iPhone, iPad, Mac and Apple TV. -- [CloudTube](https://sr.ht/~cadence/tube/): A JavaScript-rich alternate online YouTube player. -- [HoloPlay](https://github.com/stephane-r/holoplay-pwa): Progressive Web App for music connecting on Invidious API's with search, playlists and favorites. -- [GTK+ Pipe Viewer](https://github.com/trizen/pipe-viewer): YouTube client for Linux. -- [PlasmaTube](https://apps.kde.org/plasmatube/): YouTube client for Linux. -- [WatchTube](https://github.com/WatchTubeTeam/): Powerful YouTube client for Apple Watch. -- [TubiTui](https://codeberg.org/777/TubiTui): A lightweight, libre, TUI-based YouTube client. For desktop. -- [Ytfzf](https://github.com/pystardust/ytfzf): A posix script to find and watch youtube videos from the terminal. (Without API). -- [Playlet](https://github.com/iBicha/playlet): Unofficial Youtube client for Roku TV. -- [MusicPiped](https://github.com/deep-gaurav/MusicPiped): A material design music player that streams music from YouTube for Android. - +A list of projects and extensions for or utilizing Invidious can be found here +https://docs.invidious.io/applications/ ## Liability From 6868cade0534a345c0fec9e5a94f61915fc4bb04 Mon Sep 17 00:00:00 2001 From: TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> Date: Thu, 23 Nov 2023 22:23:54 +0100 Subject: [PATCH 18/21] Rewording and formating --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index ec879548f..b139c5f68 100644 --- a/README.md +++ b/README.md @@ -145,9 +145,7 @@ Weblate also allows you to log-in with major SSO providers like Github, Gitlab, ## Projects using Invidious -A list of projects and extensions for or utilizing Invidious can be found here - -https://docs.invidious.io/applications/ +A list of projects and extensions for or utilizing Invidious can be found in the documentation: https://docs.invidious.io/applications/ ## Liability From d76fed585003728ea759767d8e5e24fe918118f5 Mon Sep 17 00:00:00 2001 From: Abdul Rauf Date: Fri, 1 Dec 2023 23:11:45 +0500 Subject: [PATCH 19/21] ci: update github actions (#4209) * ci: update actions/checkout to v4 * ci: remove patch version from crystal-lang/install-crystal latest patch will be automatically installed which is 1.8.1 https://github.com/crystal-lang/install-crystal * ci: update docker/setup-buildx-action to v3 * ci: update docker/build-push-action to v5 * ci: update docker/setup-qemu-action to v3 * ci: update docker/login-action to v3 * ci: actions/stale to v8 https://github.com/actions/stale/blob/main/CHANGELOG.md * Revert "ci: remove patch version from crystal-lang/install-crystal" This reverts commit 8c39ce846fa0a7057d66dc25b853c40b2366faf3. --- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/container-release.yml | 12 ++++++------ .github/workflows/stale.yml | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ca0dc96a..7fb7ffa7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: stable: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true @@ -87,7 +87,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build Docker run: docker-compose build --build-arg release=0 @@ -103,18 +103,18 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: arm64 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build Docker ARM64 image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: . file: docker/Dockerfile.arm64 diff --git a/.github/workflows/container-release.yml b/.github/workflows/container-release.yml index c2756fcc4..8b3202d75 100644 --- a/.github/workflows/container-release.yml +++ b/.github/workflows/container-release.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Crystal uses: crystal-lang/install-crystal@v1.8.0 @@ -38,15 +38,15 @@ jobs: fi - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: arm64 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: quay.io username: ${{ secrets.QUAY_USERNAME }} @@ -54,7 +54,7 @@ jobs: - name: Build and push Docker AMD64 image for Push Event if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: . file: docker/Dockerfile @@ -67,7 +67,7 @@ jobs: - name: Build and push Docker ARM64 image for Push Event if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: . file: docker/Dockerfile.arm64 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index a7e218a27..b25199e32 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -10,7 +10,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v5 + - uses: actions/stale@v8 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 365 From 9e970fe4bdec406113928d0cbb4d395d070a27ed Mon Sep 17 00:00:00 2001 From: unbelauscht <58393353+unbelauscht@users.noreply.github.com> Date: Wed, 6 Dec 2023 12:19:21 +0100 Subject: [PATCH 20/21] docker-meta generate versioned docker tags & OCI labels (#4161) * Use docker-meta to generate tags and labels + versioning I updated the workflow to have additional tags based on git tags. This way an administrator can get images by Invidious version tag. * Use current date as image tag * Switch to YYYY.MM.DD-SHA_SHORT * Use short sha to follow existing tagging style * revert build-push-actions to v5 --------- Co-authored-by: panda --- .github/workflows/container-release.yml | 37 ++++++++++++++++++++----- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/.github/workflows/container-release.yml b/.github/workflows/container-release.yml index 8b3202d75..678c3513e 100644 --- a/.github/workflows/container-release.yml +++ b/.github/workflows/container-release.yml @@ -11,7 +11,6 @@ on: - invidious.service - .git* - .editorconfig - - screenshots/* - .github/ISSUE_TEMPLATE/* - kubernetes/** @@ -52,28 +51,52 @@ jobs: username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_PASSWORD }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: quay.io/invidious/invidious + tags: | + type=sha,format=short + 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') }} + labels: | + quay.expires-after=12w + - name: Build and push Docker AMD64 image for Push Event - if: github.ref == 'refs/heads/master' uses: docker/build-push-action@v5 with: context: . file: docker/Dockerfile platforms: linux/amd64 - labels: quay.expires-after=12w + labels: ${{ steps.meta.outputs.labels }} push: true - tags: quay.io/invidious/invidious:${{ github.sha }},quay.io/invidious/invidious:latest + tags: ${{ steps.meta.outputs.tags }} build-args: | "release=1" + - name: Docker meta + id: meta-arm64 + uses: docker/metadata-action@v5 + with: + images: quay.io/invidious/invidious + flavor: | + suffix=-arm64 + tags: | + type=sha,format=short + 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') }} + labels: | + quay.expires-after=12w + - name: Build and push Docker ARM64 image for Push Event - if: github.ref == 'refs/heads/master' uses: docker/build-push-action@v5 with: context: . file: docker/Dockerfile.arm64 platforms: linux/arm64/v8 - labels: quay.expires-after=12w + labels: ${{ steps.meta-arm64.outputs.labels }} push: true - tags: quay.io/invidious/invidious:${{ github.sha }}-arm64,quay.io/invidious/invidious:latest-arm64 + tags: ${{ steps.meta-arm64.outputs.tags }} build-args: | "release=1" From 72478ba7048f036f07b9623690d560708334c46f Mon Sep 17 00:00:00 2001 From: unbelauscht <58393353+unbelauscht@users.noreply.github.com> Date: Wed, 6 Dec 2023 14:20:51 +0100 Subject: [PATCH 21/21] Remove short sha docker tag (#4312) --- .github/workflows/container-release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/container-release.yml b/.github/workflows/container-release.yml index 678c3513e..e44ac2004 100644 --- a/.github/workflows/container-release.yml +++ b/.github/workflows/container-release.yml @@ -57,7 +57,6 @@ jobs: with: images: quay.io/invidious/invidious tags: | - type=sha,format=short 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') }} labels: | @@ -83,7 +82,6 @@ jobs: flavor: | suffix=-arm64 tags: | - type=sha,format=short 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') }} labels: |