In the past day's i wonder why 2 of my servers just stuck on downloading the videos - i investigated a little and found out that the request from the /lib/info.js to the YouTube page received a captcha form.
<p class='largeText'>Sorry for the interruption. We have been receiving a large volume of requests from your network.</p>
<p>To continue with your YouTube experience, please fill out the form below.</p>
<form action="/das_captcha" method="POST">
<div class="g-recaptcha" data-sitekey="6Lf39AMTAAAAALPbLZdcrWDa8Ygmgk_fmGmrlRog"></div>
<br/>
<input type="hidden" name="next" value="/watch?v=NmJHH026X0c&hl=en&bpctr=1574426741">
<input type="hidden" name="session_token" value="QUFFLUhqbWlTX19rU2Q1X2JXdTZTOHlVWFJxa3VTekhiZ3xBQ3Jtc0tuSU1oR2s2dDYtdGRkbUM4RUZicjVURXU4aTcwdFF5WDZjd2plbFZHamVpbkJFQ0ZGYkI1MHBaV0c5WlpWWmttVTR0TTROR0dYZzVKa3hWY1RlSTQxTmpsNmlEWUhOOEpyZzExVWlZeDI1ajMtWHoxZS1XcXJKRFVKQ0tHQmQ5U2hKS0liRHkwejRaa0wyWGVtbmdlYmhTMERoX0E=">
<input type="hidden" name="action_recaptcha_verify2" value="1">
<input type="submit" value="Submit">
</form>
Is there a way to bypass it, and also it would be nice to get an error or smth. for it.
EDIT:
Maybe it would be nice to parse the form values and send it in an event or smth. so that the user can fill it out.
stumbled upon exactly the same 馃憤
Recaptcha is evil.
Added proxy working with me. @fent issue comment check
Example:
const Agent = require('https-proxy-agent');
const host = '*.*.*.*';
const port = '****';
const proxy = 'http://' + host + ':' + port;
const agent = new Agent(proxy);
exports.getBasicInfo = (id, options, callback) => {
const params = 'hl=' + (options.lang || 'en');
let url = VIDEO_URL + id + '&' + params + '&bpctr=' + Math.ceil(Date.now() / 1000)
// Remove header from watch page request.
// Otherwise, it'll use a different framework for rendering content.
let reqOptions = Object.assign({}, options.requestOptions);
reqOptions.headers = Object.assign({}, reqOptions.headers, {
'User-Agent': ''
});
reqOptions.url = url;
reqOptions.secureProxy = agent.secureProxy;
reqOptions.proxy = agent.proxy;
request(reqOptions, (err, res, body) => {
Strange thing is, that i get the reCAPTCHA on my local computer with ytdl-core now but if i browse YouTube i have no problem.
I will investigate it a bit more.
any solution is there ?
Strange thing is, that i get the reCAPTCHA on my local computer with ytdl-core now but if i browse YouTube i have no problem.
If you browse YouTube using Chrome you will (almost) never encounter this, since Chrome connects using a different protocol (HTTP3 / gQUIC). The only time you will ever get a CAPTCHA like this is if you visit a watch page on startup (before the browser has negotiated an h3 connection).
See this comment for more info.
Then what about using HTTP3? Wouldn't that help?
Currently HTTP/3 is at the draft stage and not widely available. Google has continued developing the protocol internally (gQUIC), which is what Chrome uses when connecting to Google domains.
This comment has more information.