fix: Improve iTunes API call success rate by increasing rate limit delay and adding a User-Agent header.

This commit is contained in:
Hördle Bot
2025-11-24 14:36:27 +01:00
parent 3309b5c5ee
commit 7f455053e7
2 changed files with 7 additions and 3 deletions

View File

@@ -36,8 +36,8 @@ export async function POST(request: Request) {
for (const song of songs) {
try {
// Rate limiting: wait 500ms between requests to be safe
await sleep(500);
// Rate limiting: wait 2000ms between requests to be safe (iTunes can be strict)
await sleep(2000);
const year = await getReleaseYearFromItunes(song.artist, song.title);