Fix geo-bypass threads
This commit is contained in:
parent
3e3de1890a
commit
2e65997447
|
@ -465,7 +465,7 @@ class CaptionName
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_video(id, db, refresh = true, proxies = {} of String => Array({ip: String, port: Int32, score: Float64}))
|
def get_video(id, db, proxies = {} of String => Array({ip: String, port: Int32}), refresh = true)
|
||||||
if db.query_one?("SELECT EXISTS (SELECT true FROM videos WHERE id = $1)", id, as: Bool)
|
if db.query_one?("SELECT EXISTS (SELECT true FROM videos WHERE id = $1)", id, as: Bool)
|
||||||
video = db.query_one("SELECT * FROM videos WHERE id = $1", id, as: Video)
|
video = db.query_one("SELECT * FROM videos WHERE id = $1", id, as: Video)
|
||||||
|
|
||||||
|
@ -498,7 +498,7 @@ def get_video(id, db, refresh = true, proxies = {} of String => Array({ip: Strin
|
||||||
return video
|
return video
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch_video(id, proxies = {} of String => Array({ip: String, port: Int32, score: Float64}))
|
def fetch_video(id, proxies)
|
||||||
html_channel = Channel(XML::Node).new
|
html_channel = Channel(XML::Node).new
|
||||||
info_channel = Channel(HTTP::Params).new
|
info_channel = Channel(HTTP::Params).new
|
||||||
|
|
||||||
|
@ -557,7 +557,7 @@ def fetch_video(id, proxies = {} of String => Array({ip: String, port: Int32, sc
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
BYPASS_REGIONS.size.times do
|
proxies.size.times do
|
||||||
response = bypass_channel.receive
|
response = bypass_channel.receive
|
||||||
if response[0] || response[1]
|
if response[0] || response[1]
|
||||||
info = response[0].not_nil!
|
info = response[0].not_nil!
|
||||||
|
|
Loading…
Reference in New Issue