This commit is contained in:
syeopite 2021-05-23 06:50:47 -07:00
parent 8cad76b2cf
commit ba77812a85
No known key found for this signature in database
GPG Key ID: 6FA616E5A5294A82
2 changed files with 9 additions and 10 deletions

View File

@ -72,14 +72,13 @@ class QuicProxyWrapper
@yt_headers = header_retreival.headers @yt_headers = header_retreival.headers
# Scans through yt_headers and makes sure that all values are strings. # Scans through yt_headers and makes sure that all values are strings.
@yt_headers.each do |k,v| @yt_headers.each do |k, v|
if v.is_a? Array if v.is_a? Array
@yt_headers[k] = v[0] @yt_headers[k] = v[0]
end end
end end
end end
def family=(value) def family=(value)
@conn.family = value @conn.family = value
end end
@ -155,7 +154,7 @@ class QuicProxyWrapper
headers = convert_headers(headers) headers = convert_headers(headers)
headers.merge!(@yt_headers) headers.merge!(@yt_headers)
data = {"method" => "POST", "url" => "#{YT_URL.to_s}#{url}", data = {"method" => "POST", "url" => "#{YT_URL.to_s}#{url}",
"headers"=>headers.to_h, "data" => form}.to_json "headers" => headers.to_h, "data" => form}.to_json
return @conn.post("/", body: data) return @conn.post("/", body: data)
end end
@ -175,15 +174,15 @@ end
# We're just using this to retreive the headers from add_yt_headers # We're just using this to retreive the headers from add_yt_headers
class HackyHeaderRetrevialClass class HackyHeaderRetrevialClass
def initialize() def initialize
@headers_dict = {} of String => String @headers_dict = {} of String => String
end end
def headers() def headers
return @headers_dict return @headers_dict
end end
def resource() def resource
return "" return ""
end end
end end