strictly match only youtube.com and ytimg.com subdomains

This commit is contained in:
Fijxu 2026-09-16 00:18:11 -03:00
parent ba19fffa8f
commit a2f16f5859
No known key found for this signature in database
GPG Key ID: 32C1DDF333EDA6A4

View File

@ -133,8 +133,8 @@ def make_client(url : URI, region = nil, force_resolve : Bool = false, force_you
# ytimg.com does not contain any cookies, so we skip the youtube cookies
# for that domain and subdomains (i9.ytimg.com, i.ytimg.com, etc)
yt = url.host.try &.ends_with?("youtube.com")
ytimg = url.host.try &.ends_with?("ytimg.com")
yt = url.host.try { |host| host == "youtube.com" || host.ends_with?(".youtube.com") }
ytimg = url.host.try { |host| host == "ytimg.com" || host.ends_with?(".ytimg.com") }
youtube_domain = yt || ytimg
client.before_request do |r|