From e8e0aa27fb53675173c3835ed0451cfbaa2ea490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6rdle=20Bot?= Date: Mon, 24 Nov 2025 14:40:34 +0100 Subject: [PATCH] fix: update User-Agent and add Accept and Accept-Language headers for iTunes fetch. --- lib/itunes.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/itunes.ts b/lib/itunes.ts index 4b3ee25..2539f8e 100644 --- a/lib/itunes.ts +++ b/lib/itunes.ts @@ -35,7 +35,9 @@ export async function getReleaseYearFromItunes(artist: string, title: string): P const response = await fetch(url, { headers: { - 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36' + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36', + 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8', + 'Accept-Language': 'en-US,en;q=0.9' } });