mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-26 15:37:23 +00:00
Add fix for pulling comments from age-gated videos
This commit is contained in:
parent
b23710f89f
commit
daa2329f8b
@ -67,7 +67,7 @@ def fetch_youtube_comments(id, continuation, proxies, format, locale)
|
|||||||
itct = body.match(/itct=(?<itct>[^"]+)"/).not_nil!["itct"]
|
itct = body.match(/itct=(?<itct>[^"]+)"/).not_nil!["itct"]
|
||||||
ctoken = body.match(/'COMMENTS_TOKEN': "(?<ctoken>[^"]+)"/)
|
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
|
bypass_channel = Channel({String, HTTPClient, HTTP::Headers} | Nil).new
|
||||||
|
|
||||||
proxies.each do |proxy_region, list|
|
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_headers["Cookie"] = response.cookies.add_request_headers(headers)["cookie"]
|
||||||
proxy_html = response.body
|
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})
|
bypass_channel.send({proxy_html, proxy_client, proxy_headers})
|
||||||
else
|
else
|
||||||
bypass_channel.send(nil)
|
bypass_channel.send(nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user