Added User agents support

This commit is contained in:
killer069
2021-12-07 10:43:23 +05:30
parent e0c30e9853
commit 327bcce360
10 changed files with 86 additions and 267 deletions

View File

@@ -40,9 +40,8 @@ export async function yt_search(search: string, options: ParseSearchInterface =
}
}
const body = await request(url, {
headers: {
'accept-language': 'en-US,en;q=0.9',
'user-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36',
headers: {
'accept-language': 'en-US,en;q=0.9'
}
});
if (body.indexOf('Our systems have detected unusual traffic from your computer network.') !== -1)