Added Captcha Error in search
This commit is contained in:
parent
50d6d930b4
commit
57cd5a5d30
@ -40,6 +40,8 @@ export async function yt_search(search: string, options: ParseSearchInterface =
|
||||
const body = await request(url, {
|
||||
headers: { 'accept-language': 'en-US,en-IN;q=0.9,en;q=0.8,hi;q=0.7' }
|
||||
});
|
||||
if (body.indexOf('Our systems have detected unusual traffic from your computer network.') !== -1)
|
||||
throw new Error('Captcha page: YouTube has detected that you are a bot!');
|
||||
const data = ParseSearchResult(body, options);
|
||||
return data;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user