Remove lsquic.cr from Invidious

This commit is contained in:
syeopite 2021-05-23 03:23:21 -07:00
parent a12220ce80
commit e5f9a28b8c
No known key found for this signature in database
GPG Key ID: 6FA616E5A5294A82
4 changed files with 3 additions and 11 deletions

View File

@ -16,10 +16,6 @@ shards:
git: https://github.com/jeromegn/kilt.git
version: 0.4.0
lsquic:
git: https://github.com/iv-org/lsquic.cr.git
version: 2.18.1-1
pg:
git: https://github.com/will/crystal-pg.git
version: 0.23.1

View File

@ -25,9 +25,6 @@ dependencies:
protodec:
github: iv-org/protodec
version: ~> 0.1.3
lsquic:
github: iv-org/lsquic.cr
version: ~> 2.18.1-1
crystal: 0.36.1

View File

@ -1,4 +1,3 @@
require "lsquic"
require "pool/connection"
def add_yt_headers(request)
@ -20,7 +19,7 @@ struct YoutubeConnectionPool
property! url : URI
property! capacity : Int32
property! timeout : Float64
property pool : ConnectionPool(QuicProxyWrapper | HTTP::Client | QUIC::Client)
property pool : ConnectionPool(QuicProxyWrapper | HTTP::Client)
def initialize(url : URI, @capacity = 5, @timeout = 5.0, use_quic = true)
@url = url
@ -47,7 +46,7 @@ struct YoutubeConnectionPool
end
private def build_pool(use_quic)
ConnectionPool(QuicProxyWrapper | HTTP::Client | QUIC::Client).new(capacity: capacity, timeout: timeout) do
ConnectionPool(QuicProxyWrapper | HTTP::Client).new(capacity: capacity, timeout: timeout) do
if use_quic
conn = QuicProxyWrapper.new(URI.parse("http://#{CONFIG.quic_proxy_address}:#{CONFIG.quic_proxy_port}"))
else

View File

@ -51,7 +51,7 @@ class Invidious::Routes::Login < Invidious::Routes::BaseRoute
# See https://github.com/ytdl-org/youtube-dl/blob/2019.04.07/youtube_dl/extractor/youtube.py#L82
begin
client = QUIC::Client.new(LOGIN_URL)
client = QuicProxyWrapper.new(LOGIN_URL)
headers = HTTP::Headers.new
login_page = client.get("/ServiceLogin")