chore: update public repo

This commit is contained in:
desu-bot 2025-01-18 07:55:22 +00:00
parent 090a502ece
commit 67a6238632
No known key found for this signature in database
2 changed files with 142 additions and 19 deletions

View file

@ -6,6 +6,7 @@ import { ffetchZodAdapter } from '@fuman/fetch/zod'
import { webReadableToFuman, write } from '@fuman/io'
import { nodeWritableToFuman } from '@fuman/node'
import { type CheerioAPI, load } from 'cheerio'
import { ProxyAgent } from 'undici'
const cheerioAddon: FfetchAddon<object, { cheerio: () => Promise<CheerioAPI> }> = {
response: {
@ -23,6 +24,9 @@ export const ffetch = ffetchBase.extend({
cheerioAddon,
toughCookieAddon(),
],
extra: {
dispatcher: process.env.http_proxy ? new ProxyAgent(process.env.http_proxy) : undefined,
} as any,
})
export async function downloadStream(stream: ReadableStream, path: string) {