From 0826bd144191dbba26133ed91bea2aa184d903a6 Mon Sep 17 00:00:00 2001 From: Nulo Date: Fri, 22 Dec 2023 13:50:02 -0300 Subject: [PATCH] =?UTF-8?q?insistir=20en=20compresi=C3=B3=C3=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scraper/fetch.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scraper/fetch.ts b/scraper/fetch.ts index 3c13d75..0f78c6c 100644 --- a/scraper/fetch.ts +++ b/scraper/fetch.ts @@ -4,7 +4,10 @@ import { pipeline } from "node:stream/promises"; export async function getHtml(url: string) { const res = await request(url, { - headers: {}, + headers: { + "Accept-Encoding": "gzip, deflate, br", + }, + throwOnError: true, }); let output: Buffer; switch (res.headers["content-encoding"]) {