Merge remote-tracking branch 'upstream/master'
Some checks failed
Build and release container directly from master / release (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.12.1, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.13.2, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.14.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (1.15.0, true) (push) Has been cancelled
Invidious CI / build - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }} (nightly, false) (push) Has been cancelled
Invidious CI / build-docker (push) Has been cancelled
Invidious CI / build-docker-arm64 (push) Has been cancelled
Invidious CI / lint (push) Has been cancelled

This commit is contained in:
Fijxu
2025-03-14 12:26:53 -03:00
9 changed files with 129 additions and 15 deletions

View File

@@ -59,14 +59,12 @@ struct CompanionConnectionPool
@pool = DB::Pool(HTTP::Client).new(options) do
companion = CONFIG.invidious_companion.sample
next make_client(companion.private_url, force_resolve: true)
next make_client(companion.private_url, use_http_proxy: false)
end
end
def client(&)
conn = pool.checkout
# Proxy needs to be reinstated every time we get a client from the pool
conn.proxy = make_configured_http_proxy_client() if CONFIG.http_proxy
begin
response = yield conn
@@ -74,7 +72,7 @@ struct CompanionConnectionPool
conn.close
companion = CONFIG.invidious_companion.sample
conn = make_client(companion.private_url, force_resolve: true)
conn = make_client(companion.private_url, use_http_proxy: false)
response = yield conn
ensure

View File

@@ -672,7 +672,7 @@ module YoutubeAPI
#
def _post_invidious_companion(
endpoint : String,
data : Hash
data : Hash,
) : Hash(String, JSON::Any)
headers = HTTP::Headers{
"Content-Type" => "application/json; charset=UTF-8",