diff --git a/play-dl/YouTube/search.ts b/play-dl/YouTube/search.ts index 7f9fedc..22c4e29 100644 --- a/play-dl/YouTube/search.ts +++ b/play-dl/YouTube/search.ts @@ -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; }