Update extractor.ts

This commit is contained in:
Killer069 2021-12-01 20:50:02 +05:30 committed by GitHub
parent 4a6780a3d6
commit 164b3ac891
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -325,6 +325,8 @@ export async function playlist_info(url: string, options: PlaylistOptions = {}):
proxies: options.proxy ?? undefined,
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 response = JSON.parse(body.split('var ytInitialData = ')[1].split(';</script>')[0]);
if (response.alerts) {
if (response.alerts[0].alertWithButtonRenderer?.type === 'INFO') {