From 2824c13fc3bd50dfc0417c3d7d2ee8c433f42dce Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 27 May 2025 17:50:58 +0800 Subject: [PATCH] feat: picnob ua --- lib/routes/picnob/user.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/routes/picnob/user.ts b/lib/routes/picnob/user.ts index c296e5de94..d76b60ef23 100644 --- a/lib/routes/picnob/user.ts +++ b/lib/routes/picnob/user.ts @@ -54,7 +54,11 @@ async function handler(ctx) { let html; let usePuppeteer = false; try { - const data = await ofetch(profileUrl); + const data = await ofetch(profileUrl, { + headers: { + 'user-agent': 'PostmanRuntime/7.44.0', + }, + }); html = data; } catch { html = await puppeteerGet(profileUrl, browser); @@ -83,7 +87,13 @@ async function handler(ctx) { list.map((item) => cache.tryGet(`picnob:user:${id}:${item.guid}`, async () => { try { - const html = usePuppeteer ? await puppeteerGet(item.link, browser) : await ofetch(item.link); + const html = usePuppeteer + ? await puppeteerGet(item.link, browser) + : await ofetch(item.link, { + headers: { + 'user-agent': 'PostmanRuntime/7.44.0', + }, + }); const $ = load(html); if ($('.video_img').length > 0) { return `
${$('.sum_full').text()}`;