Use HTTP pools for image requests to YouTube

This commit is contained in:
syeopite
2023-12-08 18:20:17 -08:00
parent c5fdd9ea65
commit 480e073fa9
3 changed files with 28 additions and 7 deletions

View File

@@ -92,6 +92,14 @@ SOFTWARE = {
YT_POOL = YoutubeConnectionPool.new(YT_URL, capacity: CONFIG.pool_size)
# Image request pool
GGPHT_POOL = YoutubeConnectionPool.new(URI.parse("https://yt3.ggpht.com"), capacity: CONFIG.pool_size)
# Mapping of subdomain => YoutubeConnectionPool
# This is needed as we may need to access arbitrary subdomains of ytimg
YTIMG_POOLS = {} of String => YoutubeConnectionPool
# CLI
Kemal.config.extra_options do |parser|
parser.banner = "Usage: invidious [arguments]"