summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-01-20 09:51:35 -0600
committerOmar Roth <omarroth@hotmail.com>2019-01-20 10:03:36 -0600
commitdaa2329f8b7adc44f9cf424a56488136ee6a5b1f (patch)
tree3275a2a6f5dfcfb06a161437f15cdd2793dc50c9
parentb23710f89f23f453a7823e56258930d95fe7d46b (diff)
downloadinvidious-daa2329f8b7adc44f9cf424a56488136ee6a5b1f.tar.gz
invidious-daa2329f8b7adc44f9cf424a56488136ee6a5b1f.tar.bz2
invidious-daa2329f8b7adc44f9cf424a56488136ee6a5b1f.zip
Add fix for pulling comments from age-gated videos
-rw-r--r--src/invidious/comments.cr4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr
index c95f79b2..a5ea012c 100644
--- a/src/invidious/comments.cr
+++ b/src/invidious/comments.cr
@@ -67,7 +67,7 @@ def fetch_youtube_comments(id, continuation, proxies, format, locale)
itct = body.match(/itct=(?<itct>[^"]+)"/).not_nil!["itct"]
ctoken = body.match(/'COMMENTS_TOKEN': "(?<ctoken>[^"]+)"/)
- if body.match(/<meta itemprop="regionsAllowed" content="">/)
+ if body.match(/<meta itemprop="regionsAllowed" content="">/) && !body.match(/player-age-gate-content\">/)
bypass_channel = Channel({String, HTTPClient, HTTP::Headers} | Nil).new
proxies.each do |proxy_region, list|
@@ -79,7 +79,7 @@ def fetch_youtube_comments(id, continuation, proxies, format, locale)
proxy_headers["Cookie"] = response.cookies.add_request_headers(headers)["cookie"]
proxy_html = response.body
- if !proxy_html.match(/<meta itemprop="regionsAllowed" content="">/)
+ if !proxy_html.match(/<meta itemprop="regionsAllowed" content="">/) && !proxy_html.match(/player-age-gate-content\">/)
bypass_channel.send({proxy_html, proxy_client, proxy_headers})
else
bypass_channel.send(nil)