From b23d32cdfbd5bcceee03682afc2739b28f233c9d Mon Sep 17 00:00:00 2001 From: syeopite Date: Wed, 27 Oct 2021 04:27:15 -0700 Subject: [PATCH] Change captcha job to test RSS & caption endpoints --- src/invidious/jobs/bypass_captcha_job.cr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/invidious/jobs/bypass_captcha_job.cr b/src/invidious/jobs/bypass_captcha_job.cr index 71f8a938..c233d278 100644 --- a/src/invidious/jobs/bypass_captcha_job.cr +++ b/src/invidious/jobs/bypass_captcha_job.cr @@ -6,7 +6,11 @@ class Invidious::Jobs::BypassCaptchaJob < Invidious::Jobs::BaseJob if !random_video random_video = {id: "zj82_v2R6ts", ucid: "UCK87Lox575O_HCHBWaBSyGA"} end - {"/watch?v=#{random_video["id"]}&gl=US&hl=en&has_verified=1&bpctr=9999999999", produce_channel_videos_url(ucid: random_video["ucid"])}.each do |path| + + # As of commit 2b81a82, only the RSS and captions endpoint are susceptible to blocking. + video_information = get_video(random_video["id"], PG_DB) + + {video_information.captions.sample(1)[0].base_url, "/feeds/videos.xml?channel_id=#{random_video["ucid"]}"}.each do |path| response = YT_POOL.client &.get(path) if response.body.includes?("To continue with your YouTube experience, please fill out the form below.") html = XML.parse_html(response.body)