needle
needle copied to clipboard
Z_BUF_ERROR when requesting YouTube channel about page
trafficstars
I searched all issues for my error and got nothing. I tried requesting "https://www.youtube.com/c/TRGOArchive/about" with headers and got the error Z_BUF_ERROR.
The code
var options = { headers: {
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0",
"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Accept-Language":"en-US,en;q=0.5",
"Accept-Encoding":"gzip, deflate, br",
"DNT":"1",
"Connection":"keep-alive",
"Upgrade-Insecure-Requests":"1",
"TE":"Trailers"
}}
needle.get("https://www.youtube.com/c/TRGOArchive/about",options,function(err,resp,body) {
console.log(body);
console.log(resp);
console.log(err);
})
The error
Error: unexpected end of file
at BrotliDecoder.zlibOnError [as onerror] (zlib.js:170:17) {
errno: -5,
code: 'Z_BUF_ERROR'
}
might be a duplicate of https://github.com/tomas/needle/issues/314