feat(routes): redirect to the backend selected at the time of downloading
Some checks are pending
Build and release container directly from master / release (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.2, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.0, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.0, true) (push) Waiting to run
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Waiting to run
Invidious CI / build-docker (push) Waiting to run
Invidious CI / build-docker-arm64 (push) Waiting to run
Invidious CI / lint (push) Waiting to run

This commit is contained in:
Fijxu 2025-05-08 00:44:36 -04:00
parent b9114cbb9d
commit 6f0ed2a8b5
No known key found for this signature in database
GPG Key ID: 32C1DDF333EDA6A4

View File

@ -312,7 +312,9 @@ module Invidious::Routes::Watch
return error_template(403, "Administrator has disabled this endpoint.")
end
if CONFIG.invidious_companion.present?
return error_template(403, "Downloads should be routed through Companion when present")
current_companion = env.get("current_companion").as(Int32)
invidious_companion = CONFIG.invidious_companion[current_companion]
return env.redirect invidious_companion.public_url
end
title = env.params.body["title"]? || ""