From 71bc9eea28ed6fb22992d774443f64ce1d1551be Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sat, 9 Nov 2019 14:18:19 -0500 Subject: Add support for Anti-Captcha --- src/invidious.cr | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/invidious.cr') diff --git a/src/invidious.cr b/src/invidious.cr index 90b428f6..06f9e624 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -212,6 +212,19 @@ spawn do end end +if CONFIG.captcha_key + spawn do + bypass_captcha(CONFIG.captcha_key, logger) do |cookies| + cookies.each do |cookie| + config.cookies << cookie + end + + # Persist cookies between runs + File.write("config/config.yml", config.to_yaml) + end + end +end + connection_channel = Channel({Bool, Channel(PQ::Notification)}).new(32) spawn do connections = [] of Channel(PQ::Notification) -- cgit v1.2.3