diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-10-14 09:53:40 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-10-14 11:29:20 -0500 |
| commit | e46e6183aeeaa4ba5a9ee04f800cfbd96427cf80 (patch) | |
| tree | 7eaadff14e45c11b85e444d1fc75052897862342 /src/invidious.cr | |
| parent | b49623f90fd17f2dcba5d6471f5857ca936e210e (diff) | |
| download | invidious-e46e6183aeeaa4ba5a9ee04f800cfbd96427cf80.tar.gz invidious-e46e6183aeeaa4ba5a9ee04f800cfbd96427cf80.tar.bz2 invidious-e46e6183aeeaa4ba5a9ee04f800cfbd96427cf80.zip | |
Fix proxying for videos
Diffstat (limited to 'src/invidious.cr')
| -rw-r--r-- | src/invidious.cr | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index d655363e..8edbb715 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -1885,7 +1885,6 @@ get "/api/v1/comments/:id" do |env| proxy_client.read_timeout = 10.seconds proxy_client.connect_timeout = 10.seconds - proxy = list.sample(1)[0] proxy = HTTPProxy.new(proxy_host: proxy[:ip], proxy_port: proxy[:port]) proxy_client.set_proxy(proxy) @@ -1894,13 +1893,10 @@ get "/api/v1/comments/:id" do |env| proxy_headers["cookie"] = response.cookies.add_request_headers(headers)["cookie"] proxy_html = response.body - if proxy_html.match(/<meta itemprop="regionsAllowed" content="">/) - bypass_channel.send(nil) - else + if !proxy_html.match(/<meta itemprop="regionsAllowed" content="">/) bypass_channel.send({proxy_html, proxy_client, proxy_headers}) + break end - - break rescue ex end end |
